warning/portability fixes.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 30 Oct 2010 17:16:37 +0000 (17:16 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 30 Oct 2010 17:16:37 +0000 (17:16 +0000)
source/blender/blenkernel/BKE_brush.h
source/blender/blenkernel/BKE_utildefines.h
source/blender/blenlib/intern/BLI_mempool.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/space_sequencer/sequencer_edit.c

index 25d0eb5bc36154637b7ae01afa94b3019167915f..5afab9af9b3fdd8bda5debf928510dfbfc0bb06c 100644 (file)
@@ -36,7 +36,7 @@ struct Brush;
 struct ImBuf;
 struct Scene;
 struct wmOperator;
-enum CurveMappingPreset;
+// enum CurveMappingPreset;
 
 /* datablock functions */
 struct Brush *add_brush(const char *name);
index 016aef4d865f8d40edbfc0b57f613fffb21c157d..a7b4a71c84dce26bfe0beeae79682326011fca63 100644 (file)
@@ -279,8 +279,11 @@ behaviour, though it may not be the best in practice.
 /*little macro so inline keyword works*/
 #if defined(_MSC_VER)
 #define BM_INLINE static __forceinline
-#else
+#elif defined(__GNUC__)
 #define BM_INLINE static inline __attribute((always_inline))
+#else
+#warning "MSC/GNUC defines not found, inline non-functional"
+#define BM_INLINE static 
 #endif
 
 #define BMEMSET(mem, val, size) {unsigned int _i; char *_c = (char*) mem; for (_i=0; _i<size; _i++) *_c++ = val;}
index 26d6f5af147ce657542bc589b41779a26ea46bd1..823841ef152b8c2e65b2925a689bfec37c16f714 100644 (file)
@@ -154,9 +154,11 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr){ //doesnt protect against d
                first = pool->chunks.first;
                BLI_remlink(&pool->chunks, first);
 
-               for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) 
-                       pool->use_sysmalloc ? free(mpchunk->data) : MEM_freeN(mpchunk->data);
-               
+               for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
+                       if(pool->use_sysmalloc) free(mpchunk->data);
+                       else                                    MEM_freeN(mpchunk->data);
+               }
+
                pool->use_sysmalloc ? BLI_freelist(&(pool->chunks)) : BLI_freelistN(&(pool->chunks));
                
                BLI_addtail(&pool->chunks, first);
@@ -175,9 +177,18 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr){ //doesnt protect against d
 void BLI_mempool_destroy(BLI_mempool *pool)
 {
        BLI_mempool_chunk *mpchunk=NULL;
-       for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next)
-               pool->use_sysmalloc ? free(mpchunk->data) : MEM_freeN(mpchunk->data);
-       
-       pool->use_sysmalloc ? BLI_freelist(&(pool->chunks)) : BLI_freelistN(&(pool->chunks));   
-       pool->use_sysmalloc ? free(pool) : MEM_freeN(pool);
+       if(pool->use_sysmalloc) {
+               for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
+                       free(mpchunk->data);
+               }
+               BLI_freelist(&(pool->chunks));
+               free(pool);
+       }
+       else {
+               for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
+                       MEM_freeN(mpchunk->data);
+               }
+               BLI_freelistN(&(pool->chunks));
+               MEM_freeN(pool);
+       }
 }
index cd2e1d030ff0165a7ef7ea846ed1581db4c2671f..196c8babf377267a0ace7c2d574469e666c59d1f 100644 (file)
@@ -1035,12 +1035,17 @@ void ED_screen_draw(wmWindow *win)
 /* make this screen usable */
 /* for file read and first use, for scaling window, area moves */
 void ED_screen_refresh(wmWindowManager *wm, wmWindow *win)
-{
-       ScrArea *sa;
-       rcti winrct= {0, win->sizex-1, 0, win->sizey-1};
-       
+{      
        /* exception for bg mode, we only need the screen context */
        if (!G.background) {
+               ScrArea *sa;
+               rcti winrct;
+       
+               winrct.xmin= 0;
+               winrct.xmax= win->sizex-1;
+               winrct.ymin= 0;
+               winrct.ymax= win->sizey-1;
+               
                screen_test_scale(win->screen, win->sizex, win->sizey);
                
                if(win->screen->mainwin==0)
index b9a593b520c3af382f4c712570a03aa60a37151d..286442ba08c3b41affeafe3228ce24b87db1d157 100644 (file)
@@ -1502,7 +1502,6 @@ static int sequencer_swap_inputs_exec(bContext *C, wmOperator *op)
 {
        Scene *scene= CTX_data_scene(C);
        Sequence *seq, *last_seq = seq_active_get(scene);
-       char *error_msg;
 
        if(last_seq->seq1==NULL || last_seq->seq2 == NULL) {
                BKE_report(op->reports, RPT_ERROR, "No valid inputs to swap");