Kaydet (Commit) 27f3b885 authored tarafından Bahadır Kandemir's avatar Bahadır Kandemir

* pass unsigned char to hash_string

* load_file returns char
üst cb476900
......@@ -13,7 +13,7 @@ char *strsub(const char *str, int start, int end);
char *strrep(const char *str, char old, char new);
int check_file(const char *fname);
unsigned char *load_file(const char *fname, int *sizeptr);
char *load_file(const char *fname, int *sizeptr);
int save_file(const char *fname, const char *buffer, size_t size);
unsigned long time_diff(struct timeval *start, struct timeval *end);
......@@ -134,7 +134,7 @@ model_lookup_interface(const char *iface)
struct node *n;
int val;
val = hash_string(iface, strlen(iface)) % TABLE_SIZE;
val = hash_string((unsigned char*) iface, strlen(iface)) % TABLE_SIZE;
for (n = node_table[val]; n; n = n->next) {
if (N_INTERFACE == n->type && strcmp(n->path, iface) == 0) {
return n->no;
......@@ -163,7 +163,7 @@ model_lookup_method(const char *iface, const char *method)
snprintf(path, size, "%s.%s", iface, method);
path[size - 1] = '\0';
val = hash_string(path, strlen(path)) % TABLE_SIZE;
val = hash_string((unsigned char*) path, strlen(path)) % TABLE_SIZE;
for (n = node_table[val]; n; n = n->next) {
if (N_METHOD == n->type && strcmp(n->path, path) == 0) {
free(path);
......@@ -204,7 +204,7 @@ model_lookup_signal(const char *iface, const char *signal)
snprintf(path, size, "%s.%s", iface, signal);
path[size - 1] = '\0';
val = hash_string(path, strlen(path)) % TABLE_SIZE;
val = hash_string((unsigned char*) path, strlen(path)) % TABLE_SIZE;
for (n = node_table[val]; n; n = n->next) {
if (N_SIGNAL == n->type && strcmp(n->path, path) == 0) {
free(path);
......@@ -239,7 +239,7 @@ add_node(int parent_no, const char *path, char *label, int type)
n->no = model_nr_nodes++;
n->access_label = label;
val = hash_string(path, len) % TABLE_SIZE;
val = hash_string((unsigned char*) path, len) % TABLE_SIZE;
n->next = node_table[val];
node_table[val] = n;
......
......@@ -96,7 +96,7 @@ check_file(const char *fname)
}
//! Returns content of a file
unsigned char *
char *
load_file(const char *fname, int *sizeptr)
{
/*!
......@@ -110,7 +110,7 @@ load_file(const char *fname, int *sizeptr)
FILE *f;
struct stat fs;
size_t size;
unsigned char *data;
char *data;
if (stat(fname, &fs) != 0) return NULL;
size = fs.st_size;
......
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