Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-10-30 21:16:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-10-30 21:16:37 +0400
commit001259ccb6a8dbe0c70e4eb0f47a82b9b574d3b4 (patch)
treeacb3aa815ebe1f3ce355e8677a78af8e6f89d0e7 /source/blender
parentc69f2eaca97084e0e830756b574c9ec8a55c6643 (diff)
warning/portability fixes.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_brush.h2
-rw-r--r--source/blender/blenkernel/BKE_utildefines.h5
-rw-r--r--source/blender/blenlib/intern/BLI_mempool.c27
-rw-r--r--source/blender/editors/screen/screen_edit.c13
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c1
5 files changed, 33 insertions, 15 deletions
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; _i<size; _i++) *_c++ = val;}
diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c
index 26d6f5af147..823841ef152 100644
--- a/source/blender/blenlib/intern/BLI_mempool.c
+++ b/source/blender/blenlib/intern/BLI_mempool.c
@@ -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);
+ }
}
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");