Commit 64d1e176 authored by Rémi Duraffort's avatar Rémi Duraffort

galaktos: fix a buch of anoying warnings.

parent b91b84d6
......@@ -38,7 +38,7 @@ void * copy_func_key(char * string) {
}
func_t * create_func (char * name, double (*func_ptr)(), int num_args) {
func_t * create_func (const char * name, double (*func_ptr)(), int num_args) {
func_t * func;
func = (func_t*)malloc(sizeof(func_t));
......@@ -137,7 +137,7 @@ int compare_func(char * name, char * name2) {
}
/* Loads a builtin function */
int load_builtin_func(char * name, double (*func_ptr)(), int num_args) {
int load_builtin_func(const char * name, double (*func_ptr)(), int num_args) {
func_t * func;
int retval;
......
......@@ -2,13 +2,13 @@
#define FUNC_H
/* Public Prototypes */
func_t * create_func (char * name, double (*func_ptr)(), int num_args);
func_t * create_func (const char * name, double (*func_ptr)(), int num_args);
int remove_func(func_t * func);
func_t * find_func(char * name);
int init_builtin_func_db();
int destroy_builtin_func_db();
int load_all_builtin_func();
int load_builtin_func(char * name, double (*func_ptr)(), int num_args);
int load_builtin_func(const char * name, double (*func_ptr)(), int num_args);
void free_func(func_t * func);
#endif
......@@ -53,25 +53,25 @@ int is_valid_param_string(char * string); /* true if string is valid variable or
/* A splay tree of builtin parameters */
splaytree_t * builtin_param_tree = NULL;
int insert_param_alt_name(param_t * param, char * alt_name);
int insert_param_alt_name(param_t * param, const char * alt_name);
int insert_builtin_param(param_t * param);
/* Private function prototypes */
int compare_param(char * name, char * name2);
int load_builtin_param_double(char * name, void * engine_val, void * matrix, short int flags,
double init_val, double upper_bound, double lower_bound, char * alt_name);
int load_builtin_param_double(const char * name, void * engine_val, void * matrix, short int flags,
double init_val, double upper_bound, double lower_bound, const char * alt_name);
int load_builtin_param_int(char * name, void * engine_val, short int flags,
int init_val, int upper_bound, int lower_bound, char * alt_name);
int load_builtin_param_int(const char * name, void * engine_val, short int flags,
int init_val, int upper_bound, int lower_bound, const char * alt_name);
int load_builtin_param_bool(char * name, void * engine_val, short int flags,
int init_val, char * alt_name);
int load_builtin_param_bool(const char * name, void * engine_val, short int flags,
int init_val, const char * alt_name);
param_t * create_param (char * name, short int type, short int flags, void * engine_val, void * matrix,
param_t * create_param (const char * name, short int type, short int flags, void * engine_val, void * matrix,
value_t default_init_val, value_t upper_bound, value_t lower_bound) {
param_t * param = NULL;
......@@ -179,7 +179,7 @@ int destroy_builtin_param_db() {
/* Insert a parameter into the database with an alternate name */
int insert_param_alt_name(param_t * param, char * alt_name) {
int insert_param_alt_name(param_t * param, const char * alt_name) {
if (param == NULL)
return ERROR;
......@@ -408,8 +408,8 @@ void free_param(param_t * param) {
}
/* Loads a double parameter into the builtin database */
int load_builtin_param_double(char * name, void * engine_val, void * matrix, short int flags,
double init_val, double upper_bound, double lower_bound, char * alt_name) {
int load_builtin_param_double(const char * name, void * engine_val, void * matrix, short int flags,
double init_val, double upper_bound, double lower_bound, const char * alt_name) {
param_t * param = NULL;
value_t iv, ub, lb;
......@@ -466,7 +466,7 @@ int load_builtin_param_double(char * name, void * engine_val, void * matrix, sho
/* Loads a double parameter into the builtin database */
param_t * new_param_double(char * name, short int flags, void * engine_val, void * matrix,
param_t * new_param_double(const char * name, short int flags, void * engine_val, void * matrix,
double upper_bound, double lower_bound, double init_val) {
param_t * param;
......@@ -486,7 +486,7 @@ param_t * new_param_double(char * name, short int flags, void * engine_val, void
/* Creates a new parameter of type int */
param_t * new_param_int(char * name, short int flags, void * engine_val,
param_t * new_param_int(const char * name, short int flags, void * engine_val,
int upper_bound, int lower_bound, int init_val) {
param_t * param;
......@@ -505,7 +505,7 @@ param_t * new_param_int(char * name, short int flags, void * engine_val,
}
/* Creates a new parameter of type bool */
param_t * new_param_bool(char * name, short int flags, void * engine_val,
param_t * new_param_bool(const char * name, short int flags, void * engine_val,
int upper_bound, int lower_bound, int init_val) {
param_t * param;
......@@ -525,8 +525,8 @@ param_t * new_param_bool(char * name, short int flags, void * engine_val,
/* Loads a integer parameter into the builtin database */
int load_builtin_param_int(char * name, void * engine_val, short int flags,
int init_val, int upper_bound, int lower_bound, char * alt_name) {
int load_builtin_param_int(const char * name, void * engine_val, short int flags,
int init_val, int upper_bound, int lower_bound, const char * alt_name) {
param_t * param;
value_t iv, ub, lb;
......@@ -555,8 +555,8 @@ int load_builtin_param_int(char * name, void * engine_val, short int flags,
}
/* Loads a boolean parameter */
int load_builtin_param_bool(char * name, void * engine_val, short int flags,
int init_val, char * alt_name) {
int load_builtin_param_bool(const char * name, void * engine_val, short int flags,
int init_val, const char * alt_name) {
param_t * param;
value_t iv, ub, lb;
......
......@@ -8,7 +8,7 @@
/* Used to store a number of decidable type */
/* Function prototypes */
param_t * create_param (char * name, short int type, short int flags, void * eqn_val, void * matrix,
param_t * create_param (const char * name, short int type, short int flags, void * eqn_val, void * matrix,
value_t default_init_val, value_t upper_bound, value_t lower_bound);
param_t * create_user_param(char * name);
int init_builtin_param_db();
......@@ -22,13 +22,13 @@ void free_param(param_t * param);
int load_all_builtin_param();
int insert_param(param_t * param, splaytree_t * database);
param_t * find_builtin_param(char * name);
param_t * new_param_double(char * name, short int flags, void * engine_val, void * matrix,
param_t * new_param_double(const char * name, short int flags, void * engine_val, void * matrix,
double upper_bound, double lower_bound, double init_val);
param_t * new_param_int(char * name, short int flags, void * engine_val,
param_t * new_param_int(const char * name, short int flags, void * engine_val,
int upper_bound, int lower_bound, int init_val);
param_t * new_param_bool(char * name, short int flags, void * engine_val,
param_t * new_param_bool(const char * name, short int flags, void * engine_val,
int upper_bound, int lower_bound, int init_val);
param_t * find_param_db(char * name, splaytree_t * database, int create_flag);
......
......@@ -403,7 +403,7 @@ splaynode_t * new_splaynode(int type, void * key, void * data) {
}
/* Inserts a link into the splay tree */
int splay_insert_link(void * alias_key, void * orig_key, splaytree_t * splaytree) {
int splay_insert_link(const void * alias_key, void * orig_key, splaytree_t * splaytree) {
splaynode_t * splaynode, * data_node;
void * key_clone;
......
......@@ -10,7 +10,7 @@
void * splay_find(void * key, splaytree_t * t);
int splay_insert(void * data, void * key, splaytree_t * t);
int splay_insert_link(void * alias_key, void * orig_key, splaytree_t * splaytree);
int splay_insert_link(const void * alias_key, void * orig_key, splaytree_t * splaytree);
int splay_delete(void * key, splaytree_t * splaytree);
int splay_size(splaytree_t * t);
splaytree_t * create_splaytree(int (*compare)(), void * (*copy_key)(), void (*free_key)());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment