diff options
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/BLI_args.c | 36 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_callbacks.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash.c | 14 | ||||
-rw-r--r-- | source/blender/blenlib/intern/bpath.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/dynlib.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 4 | ||||
-rw-r--r-- | source/blender/blenlib/intern/scanfill.c | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 4 |
8 files changed, 35 insertions, 35 deletions
diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c index 8d72311f80b..b9df4b309df 100644 --- a/source/blender/blenlib/intern/BLI_args.c +++ b/source/blender/blenlib/intern/BLI_args.c @@ -43,14 +43,14 @@ char NO_DOCS[] = "NO DOCUMENTATION SPECIFIED"; struct bArgDoc; typedef struct bArgDoc { struct bArgDoc *next, *prev; - char *short_arg; - char *long_arg; - char *documentation; + const char *short_arg; + const char *long_arg; + const char *documentation; int done; } bArgDoc; typedef struct bAKey { - char *arg; + const char *arg; uintptr_t pass; /* cast easier */ int case_str; /* case specific or not */ } bAKey; @@ -70,8 +70,8 @@ struct bArgs { int *passes; }; -static unsigned int case_strhash(void *ptr) { - char *s= ptr; +static unsigned int case_strhash(const void *ptr) { + const char *s= ptr; unsigned int i= 0; unsigned char c; @@ -81,27 +81,27 @@ static unsigned int case_strhash(void *ptr) { return i; } -static unsigned int keyhash(void *ptr) +static unsigned int keyhash(const void *ptr) { - bAKey *k = ptr; + const bAKey *k = ptr; return case_strhash(k->arg); // ^ BLI_ghashutil_inthash((void*)k->pass); } -static int keycmp(void *a, void *b) +static int keycmp(const void *a, const void *b) { - bAKey *ka = a; - bAKey *kb = b; + const bAKey *ka = a; + const bAKey *kb = b; if (ka->pass == kb->pass || ka->pass == -1 || kb->pass == -1) { /* -1 is wildcard for pass */ if (ka->case_str == 1 || kb->case_str == 1) return BLI_strcasecmp(ka->arg, kb->arg); else return strcmp(ka->arg, kb->arg); } else { - return BLI_ghashutil_intcmp((void*)ka->pass, (void*)kb->pass); + return BLI_ghashutil_intcmp((const void*)ka->pass, (const void*)kb->pass); } } -static bArgument *lookUp(struct bArgs *ba, char *arg, int pass, int case_str) +static bArgument *lookUp(struct bArgs *ba, const char *arg, int pass, int case_str) { bAKey key; @@ -150,7 +150,7 @@ char **BLI_argsArgv(struct bArgs *ba) return ba->argv; } -static bArgDoc *internalDocs(struct bArgs *ba, char *short_arg, char *long_arg, char *doc) +static bArgDoc *internalDocs(struct bArgs *ba, const char *short_arg, const char *long_arg, const char *doc) { bArgDoc *d; @@ -168,7 +168,7 @@ static bArgDoc *internalDocs(struct bArgs *ba, char *short_arg, char *long_arg, return d; } -static void internalAdd(struct bArgs *ba, char *arg, int pass, int case_str, BA_ArgCallback cb, void *data, bArgDoc *d) +static void internalAdd(struct bArgs *ba, const char *arg, int pass, int case_str, BA_ArgCallback cb, void *data, bArgDoc *d) { bArgument *a; bAKey *key; @@ -196,7 +196,7 @@ static void internalAdd(struct bArgs *ba, char *arg, int pass, int case_str, BA_ BLI_ghash_insert(ba->items, key, a); } -void BLI_argsAddCase(struct bArgs *ba, int pass, char *short_arg, int short_case, char *long_arg, int long_case, char *doc, BA_ArgCallback cb, void *data) +void BLI_argsAddCase(struct bArgs *ba, int pass, const char *short_arg, int short_case, const char *long_arg, int long_case, const char *doc, BA_ArgCallback cb, void *data) { bArgDoc *d = internalDocs(ba, short_arg, long_arg, doc); @@ -209,7 +209,7 @@ void BLI_argsAddCase(struct bArgs *ba, int pass, char *short_arg, int short_case } -void BLI_argsAdd(struct bArgs *ba, int pass, char *short_arg, char *long_arg, char *doc, BA_ArgCallback cb, void *data) +void BLI_argsAdd(struct bArgs *ba, int pass, const char *short_arg, const char *long_arg, const char *doc, BA_ArgCallback cb, void *data) { BLI_argsAddCase(ba, pass, short_arg, 0, long_arg, 0, doc, cb, data); } @@ -226,7 +226,7 @@ static void internalDocPrint(bArgDoc *d) printf(" %s\n\n", d->documentation); } -void BLI_argsPrintArgDoc(struct bArgs *ba, char *arg) +void BLI_argsPrintArgDoc(struct bArgs *ba, const char *arg) { bArgument *a = lookUp(ba, arg, -1, -1); diff --git a/source/blender/blenlib/intern/BLI_callbacks.h b/source/blender/blenlib/intern/BLI_callbacks.h index 7f85cf16708..56e6cdd428b 100644 --- a/source/blender/blenlib/intern/BLI_callbacks.h +++ b/source/blender/blenlib/intern/BLI_callbacks.h @@ -35,7 +35,7 @@ #define BLI_CALLBACKS_H // This is blenlib internal only -void callLocalErrorCallBack(char* msg); +void callLocalErrorCallBack(const char* msg); #endif diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 6daa2928716..729f5309523 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -149,17 +149,17 @@ int BLI_ghashIterator_isDone(GHashIterator *ghi) { /***/ -unsigned int BLI_ghashutil_ptrhash(void *key) { +unsigned int BLI_ghashutil_ptrhash(const void *key) { return (unsigned int)(intptr_t)key; } -int BLI_ghashutil_ptrcmp(void *a, void *b) { +int BLI_ghashutil_ptrcmp(const void *a, const void *b) { if (a==b) return 0; else return (a<b)?-1:1; } -unsigned int BLI_ghashutil_inthash(void *ptr) { +unsigned int BLI_ghashutil_inthash(const void *ptr) { uintptr_t key = (uintptr_t)ptr; key += ~(key << 16); @@ -172,15 +172,15 @@ unsigned int BLI_ghashutil_inthash(void *ptr) { return (unsigned int)(key & 0xffffffff); } -int BLI_ghashutil_intcmp(void *a, void *b) { +int BLI_ghashutil_intcmp(const void *a, const void *b) { if (a==b) return 0; else return (a<b)?-1:1; } -unsigned int BLI_ghashutil_strhash(void *ptr) { - char *s= ptr; +unsigned int BLI_ghashutil_strhash(const void *ptr) { + const char *s= ptr; unsigned int i= 0; unsigned char c; @@ -189,6 +189,6 @@ unsigned int BLI_ghashutil_strhash(void *ptr) { return i; } -int BLI_ghashutil_strcmp(void *a, void *b) { +int BLI_ghashutil_strcmp(const void *a, const void *b) { return strcmp(a, b); } diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 06932f24bcb..a21db4751f1 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -442,7 +442,7 @@ int BLI_bpathIterator_isDone( struct BPathIterator *bpi) { /* include the path argument */ static void bpath_as_report(struct BPathIterator *bpi, const char *message, ReportList *reports) { - char *prefix; + const char *prefix; const char *name; char path_expanded[FILE_MAXDIR*2]; diff --git a/source/blender/blenlib/intern/dynlib.c b/source/blender/blenlib/intern/dynlib.c index a674f38cec6..77ef00ca4e4 100644 --- a/source/blender/blenlib/intern/dynlib.c +++ b/source/blender/blenlib/intern/dynlib.c @@ -117,7 +117,7 @@ PILdynlib *PIL_dynlib_open(char *name) { } } -void *PIL_dynlib_find_symbol(PILdynlib* lib, char *symname) { +void *PIL_dynlib_find_symbol(PILdynlib* lib, const char *symname) { return dlsym(lib->handle, symname); } diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index a87617868d1..8400bdbeef5 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1649,10 +1649,10 @@ void BLI_where_am_i(char *fullname, const char *name) char *path = NULL, *temp; #ifdef _WIN32 - char *separator = ";"; + const char *separator = ";"; char slash = '\\'; #else - char *separator = ":"; + const char *separator = ":"; char slash = '/'; #endif diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c index 699eca38a5a..85412e28c4f 100644 --- a/source/blender/blenlib/intern/scanfill.c +++ b/source/blender/blenlib/intern/scanfill.c @@ -36,10 +36,10 @@ #include "BLI_math.h" /* callbacks for errors and interrupts and some goo */ -static void (*BLI_localErrorCallBack)(char*) = NULL; +static void (*BLI_localErrorCallBack)(const char*) = NULL; static int (*BLI_localInterruptCallBack)(void) = NULL; -void BLI_setErrorCallBack(void (*f)(char*)) +void BLI_setErrorCallBack(void (*f)(const char *)) { BLI_localErrorCallBack = f; } @@ -50,7 +50,7 @@ void BLI_setInterruptCallBack(int (*f)(void)) } /* just flush the error to /dev/null if the error handler is missing */ -void callLocalErrorCallBack(char* msg) +void callLocalErrorCallBack(const char* msg) { if (BLI_localErrorCallBack) { BLI_localErrorCallBack(msg); diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 70d9d080c31..53d9f2b78e7 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -201,7 +201,7 @@ double BLI_diskfree(const char *dir) #endif } -void BLI_builddir(const char *dirname, char *relname) +void BLI_builddir(const char *dirname, const char *relname) { struct dirent *fname; struct dirlink *dlink; @@ -294,7 +294,7 @@ void BLI_adddirstrings(void) char datum[100]; char buf[512]; char size[250]; - static char * types[8] = {"---", "--x", "-w-", "-wx", "r--", "r-x", "rw-", "rwx"}; + static const char * types[8] = {"---", "--x", "-w-", "-wx", "r--", "r-x", "rw-", "rwx"}; int num, mode; #ifdef WIN32 __int64 st_size; |