From 001259ccb6a8dbe0c70e4eb0f47a82b9b574d3b4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 30 Oct 2010 17:16:37 +0000 Subject: warning/portability fixes. --- source/blender/blenkernel/BKE_brush.h | 2 +- source/blender/blenkernel/BKE_utildefines.h | 5 +++- source/blender/blenlib/intern/BLI_mempool.c | 27 +++++++++++++++------- source/blender/editors/screen/screen_edit.c | 13 +++++++---- .../editors/space_sequencer/sequencer_edit.c | 1 - 5 files changed, 33 insertions(+), 15 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h index 25d0eb5bc36..5afab9af9b3 100644 --- a/source/blender/blenkernel/BKE_brush.h +++ b/source/blender/blenkernel/BKE_brush.h @@ -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); diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h index 016aef4d865..a7b4a71c84d 100644 --- a/source/blender/blenkernel/BKE_utildefines.h +++ b/source/blender/blenkernel/BKE_utildefines.h @@ -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; _ichunks.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); + } } diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index cd2e1d030ff..196c8babf37 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -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) diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index b9a593b520c..286442ba08c 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -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"); -- cgit v1.2.3