Code cleanup: use 'const' for arrays (windowmanager)
authorCampbell Barton <ideasman42@gmail.com>
Sat, 26 Apr 2014 14:21:43 +0000 (00:21 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 26 Apr 2014 14:25:15 +0000 (00:25 +1000)
source/blender/windowmanager/intern/wm_cursors.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_gesture.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_playanim.c
source/blender/windowmanager/intern/wm_window.c

index 01cd1514a3a2ee5d25839efb8b41f62e27c42c79..9a9e113ba90882c9a2cf1db73eb85e96e34c78bd 100644 (file)
@@ -300,7 +300,7 @@ void WM_cursor_time(wmWindow *win, int nr)
        
        /* print number bottom right justified */
        for (idx = 3; nr && idx >= 0; idx--) {
-               char *digit = number_bitmaps[nr % 10];
+               const char *digit = number_bitmaps[nr % 10];
                int x = idx % 2;
                int y = idx / 2;
 
index 553f9a6318fe80ffacb2e4608d04c617b4099c73..c4d08e7e900c7a47ac1d9a60edaeb2e4da525187 100644 (file)
@@ -708,7 +708,7 @@ void wm_read_history(void)
        char name[FILE_MAX];
        LinkNode *l, *lines;
        struct RecentFile *recent;
-       char *line;
+       const char *line;
        int num;
        const char * const cfgdir = BLI_get_folder(BLENDER_USER_CONFIG, NULL);
 
index 9a00e709d857b4cdadc6899c7f4a48333c3b3068..c9ef473a442617c48e22d86ce18002ee22e479f8 100644 (file)
@@ -247,7 +247,7 @@ static void draw_filled_lasso_px_cb(int x, int y, void *user_data)
 
 static void draw_filled_lasso(wmWindow *win, wmGesture *gt)
 {
-       short *lasso = (short *)gt->customdata;
+       const short *lasso = (short *)gt->customdata;
        const int tot = gt->points;
        int (*moves)[2] = MEM_mallocN(sizeof(*moves) * (tot + 1), __func__);
        int i;
@@ -295,7 +295,7 @@ static void draw_filled_lasso(wmWindow *win, wmGesture *gt)
 
 static void wm_gesture_draw_lasso(wmWindow *win, wmGesture *gt, bool filled)
 {
-       short *lasso = (short *)gt->customdata;
+       const short *lasso = (short *)gt->customdata;
        int i;
 
        if (filled) {
index a291cffb89db2fe03bb6a038c7f98f89ac4d99bd..b4aaac99092c54b94c447d656628843b42b5380f 100644 (file)
@@ -497,7 +497,7 @@ bool WM_operatortype_remove(const char *idname)
 /* SOME_OT_op -> some.op */
 void WM_operator_py_idname(char *to, const char *from)
 {
-       char *sep = strstr(from, "_OT_");
+       const char *sep = strstr(from, "_OT_");
        if (sep) {
                int ofs = (sep - from);
                
@@ -519,7 +519,7 @@ void WM_operator_py_idname(char *to, const char *from)
 void WM_operator_bl_idname(char *to, const char *from)
 {
        if (from) {
-               char *sep = strchr(from, '.');
+               const char *sep = strchr(from, '.');
 
                if (sep) {
                        int ofs = (sep - from);
@@ -3336,7 +3336,7 @@ static void gesture_lasso_apply(bContext *C, wmOperator *op)
        PointerRNA itemptr;
        float loc[2];
        int i;
-       short *lasso = gesture->customdata;
+       const short *lasso = gesture->customdata;
        
        /* operator storage as path. */
 
index 16c424f4aecf4d776a44a30003bc7665a59a848b..6bacd399767b46c0d087a4fbac52a5fff42682cd 100644 (file)
@@ -206,7 +206,7 @@ typedef struct PlayAnimPict {
        struct PlayAnimPict *next, *prev;
        char *mem;
        int size;
-       char *name;
+       const char *name;
        struct ImBuf *ibuf;
        struct anim *anim;
        int frame;
@@ -1223,7 +1223,7 @@ void WM_main_playanim(int argc, const char **argv)
        bool looping = true;
 
        while (looping) {
-               char *filepath = wm_main_playanim_intern(argc, argv);
+               const char *filepath = wm_main_playanim_intern(argc, argv);
 
                if (filepath) { /* use simple args */
                        argv[1] = "-a";
index b589009d72406993f9b2243411746b0d7925311f..e850b4fd19be7ba0def468f168d800702a77718d 100644 (file)
@@ -918,7 +918,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr
                        {
                                PointerRNA props_ptr;
                                wmWindow *oldWindow;
-                               char *path = GHOST_GetEventData(evt);
+                               const char *path = GHOST_GetEventData(evt);
                                
                                if (path) {
                                        /* operator needs a valid window in context, ensures