Code cleanup: use 'const' for arrays (windowmanager)

This commit is contained in:
Campbell Barton 2014-04-27 00:21:43 +10:00
parent e73d0f57a3
commit 15d77d201d
6 changed files with 10 additions and 10 deletions

View 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;

View 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);

View 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) {

View 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. */

View 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";

View 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