style cleanup

This commit is contained in:
2012-08-11 22:12:32 +00:00
parent c567cf3fab
commit b96c622015
38 changed files with 99 additions and 95 deletions

View File

@@ -38,7 +38,7 @@
inline unsigned int CTR_Hash(void *inDWord) inline unsigned int CTR_Hash(void *inDWord)
{ {
size_t key = (size_t)inDWord; size_t key = (size_t)inDWord;
return (unsigned int)(key ^ (key>>4)); return (unsigned int)(key ^ (key >> 4));
} }
class CTR_HashedPtr class CTR_HashedPtr

View File

@@ -860,7 +860,8 @@ int GHOST_toggleConsole(int action)
} }
int GHOST_confirmQuit(GHOST_WindowHandle windowhandle){ int GHOST_confirmQuit(GHOST_WindowHandle windowhandle)
{
GHOST_ISystem *system = GHOST_ISystem::getSystem(); GHOST_ISystem *system = GHOST_ISystem::getSystem();
return system->confirmQuit((GHOST_IWindow *) windowhandle); return system->confirmQuit((GHOST_IWindow *) windowhandle);
} }

View File

@@ -1662,17 +1662,19 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
case NSKeyDown: case NSKeyDown:
case NSKeyUp: case NSKeyUp:
charsIgnoringModifiers = [event charactersIgnoringModifiers]; charsIgnoringModifiers = [event charactersIgnoringModifiers];
if ([charsIgnoringModifiers length]>0) if ([charsIgnoringModifiers length] > 0) {
keyCode = convertKey([event keyCode], keyCode = convertKey([event keyCode],
[charsIgnoringModifiers characterAtIndex:0], [charsIgnoringModifiers characterAtIndex:0],
[event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp); [event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp);
else }
else {
keyCode = convertKey([event keyCode],0, keyCode = convertKey([event keyCode],0,
[event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp); [event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp);
}
/* handling both unicode or ascii */ /* handling both unicode or ascii */
characters = [event characters]; characters = [event characters];
if ([characters length]>0) { if ([characters length] > 0) {
convertedCharacters = [characters dataUsingEncoding:NSUTF8StringEncoding]; convertedCharacters = [characters dataUsingEncoding:NSUTF8StringEncoding];
for (int x = 0; x < [convertedCharacters length]; x++) { for (int x = 0; x < [convertedCharacters length]; x++) {

View File

@@ -502,7 +502,7 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
if (stereoVisual) pixelFormatAttrsWindow[i++] = NSOpenGLPFAStereo; if (stereoVisual) pixelFormatAttrsWindow[i++] = NSOpenGLPFAStereo;
if (numOfAASamples>0) { if (numOfAASamples > 0) {
// Multisample anti-aliasing // Multisample anti-aliasing
pixelFormatAttrsWindow[i++] = NSOpenGLPFAMultisample; pixelFormatAttrsWindow[i++] = NSOpenGLPFAMultisample;
@@ -550,7 +550,7 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
} }
if (numOfAASamples>0) { //Set m_numOfAASamples to the actual value if (numOfAASamples > 0) { //Set m_numOfAASamples to the actual value
GLint gli; GLint gli;
[pixelFormat getValues:&gli forAttribute:NSOpenGLPFASamples forVirtualScreen:0]; [pixelFormat getValues:&gli forAttribute:NSOpenGLPFASamples forVirtualScreen:0];
if (m_numOfAASamples != (GHOST_TUns16)gli) { if (m_numOfAASamples != (GHOST_TUns16)gli) {
@@ -653,7 +653,7 @@ void GHOST_WindowCocoa::setTitle(const STR_String& title)
fileStrRange.location = [windowTitle rangeOfString:@"["].location+1; fileStrRange.location = [windowTitle rangeOfString:@"["].location+1;
len = [windowTitle rangeOfString:@"]"].location - fileStrRange.location; len = [windowTitle rangeOfString:@"]"].location - fileStrRange.location;
if (len >0) if (len > 0)
{ {
fileStrRange.length = len; fileStrRange.length = len;
associatedFileName = [windowTitle substringWithRange:fileStrRange]; associatedFileName = [windowTitle substringWithRange:fileStrRange];
@@ -1424,9 +1424,9 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorShape(GHOST_TStandardCursor sha
/** Reverse the bits in a GHOST_TUns8 /** Reverse the bits in a GHOST_TUns8
static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch) static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch)
{ {
ch= ((ch>>1)&0x55) | ((ch<<1)&0xAA); ch= ((ch >> 1) & 0x55) | ((ch << 1) & 0xAA);
ch= ((ch>>2)&0x33) | ((ch<<2)&0xCC); ch= ((ch >> 2) & 0x33) | ((ch << 2) & 0xCC);
ch= ((ch>>4)&0x0F) | ((ch<<4)&0xF0); ch= ((ch >> 4) & 0x0F) | ((ch << 4) & 0xF0);
return ch; return ch;
} }
*/ */
@@ -1435,10 +1435,10 @@ static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch)
/** Reverse the bits in a GHOST_TUns16 */ /** Reverse the bits in a GHOST_TUns16 */
static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt) static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt)
{ {
shrt= ((shrt>>1)&0x5555) | ((shrt<<1)&0xAAAA); shrt = ((shrt >> 1) & 0x5555) | ((shrt << 1) & 0xAAAA);
shrt= ((shrt>>2)&0x3333) | ((shrt<<2)&0xCCCC); shrt = ((shrt >> 2) & 0x3333) | ((shrt << 2) & 0xCCCC);
shrt= ((shrt>>4)&0x0F0F) | ((shrt<<4)&0xF0F0); shrt = ((shrt >> 4) & 0x0F0F) | ((shrt << 4) & 0xF0F0);
shrt= ((shrt>>8)&0x00FF) | ((shrt<<8)&0xFF00); shrt = ((shrt >> 8) & 0x00FF) | ((shrt << 8) & 0xFF00);
return shrt; return shrt;
} }

View File

@@ -1314,8 +1314,8 @@ validate()
*/ */
GHOST_WindowX11:: GHOST_WindowX11::
~GHOST_WindowX11( ~GHOST_WindowX11()
){ {
static Atom Primary_atom, Clipboard_atom; static Atom Primary_atom, Clipboard_atom;
Window p_owner, c_owner; Window p_owner, c_owner;
/*Change the owner of the Atoms to None if we are the owner*/ /*Change the owner of the Atoms to None if we are the owner*/

View File

@@ -80,7 +80,7 @@ int main (int argc, char *argv[])
for (i = 0; i < NUM_BLOCKS; i++) { for (i = 0; i < NUM_BLOCKS; i++) {
int blocksize = 10000; int blocksize = 10000;
char tagstring[1000]; char tagstring[1000];
if (verbose >1) printf("|--* Allocating block %d\n", i); if (verbose > 1) printf("|--* Allocating block %d\n", i);
sprintf(tagstring,"Memblock no. %d : ", i); sprintf(tagstring,"Memblock no. %d : ", i);
p[i]= MEM_callocN(blocksize, strdup(tagstring)); p[i]= MEM_callocN(blocksize, strdup(tagstring));
} }
@@ -112,7 +112,7 @@ int main (int argc, char *argv[])
for (i = 0; i < NUM_BLOCKS; i++) { for (i = 0; i < NUM_BLOCKS; i++) {
int blocksize = 10000; int blocksize = 10000;
char tagstring[1000]; char tagstring[1000];
if (verbose >1) printf("|--* Allocating block %d\n", i); if (verbose > 1) printf("|--* Allocating block %d\n", i);
sprintf(tagstring,"Memblock no. %d : ", i); sprintf(tagstring,"Memblock no. %d : ", i);
p[i]= MEM_callocN(blocksize, strdup(tagstring)); p[i]= MEM_callocN(blocksize, strdup(tagstring));
} }

View File

@@ -102,7 +102,7 @@ public:
// Properties // Properties
bool IsUpper() const; bool IsUpper() const;
bool IsLower() const; bool IsLower() const;
inline bool IsEmpty() const { return Len==0; } inline bool IsEmpty() const { return Len == 0; }
inline int Length() const { return Len; } inline int Length() const { return Len; }
// Data access // Data access
@@ -122,8 +122,8 @@ public:
// Comparison // Comparison
int Compare(rcSTR_String rhs) const; int Compare(rcSTR_String rhs) const;
int CompareNoCase(rcSTR_String rhs) const; int CompareNoCase(rcSTR_String rhs) const;
inline bool IsEqual(rcSTR_String rhs) const { return (Compare(rhs)==0); } inline bool IsEqual(rcSTR_String rhs) const { return (Compare(rhs) == 0); }
inline bool IsEqualNoCase(rcSTR_String rhs) const { return (CompareNoCase(rhs)==0); } inline bool IsEqualNoCase(rcSTR_String rhs) const { return (CompareNoCase(rhs) == 0); }
// Search/replace // Search/replace
int Find(char c, int pos = 0) const; int Find(char c, int pos = 0) const;
@@ -178,12 +178,12 @@ public:
inline friend bool operator>=(rcSTR_String lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)>=0); } inline friend bool operator>=(rcSTR_String lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)>=0); }
inline friend bool operator>=(rcSTR_String lhs, const char *rhs) { return (strcmp(lhs, rhs)>=0); } inline friend bool operator>=(rcSTR_String lhs, const char *rhs) { return (strcmp(lhs, rhs)>=0); }
inline friend bool operator>=(const char *lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)>=0); } inline friend bool operator>=(const char *lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)>=0); }
inline friend bool operator==(rcSTR_String lhs, rcSTR_String rhs) { return ((lhs.Length() == rhs.Length()) && (memcmp(lhs, rhs, lhs.Length())==0)); } inline friend bool operator==(rcSTR_String lhs, rcSTR_String rhs) { return ((lhs.Length() == rhs.Length()) && (memcmp(lhs, rhs, lhs.Length()) == 0)); }
inline friend bool operator==(rcSTR_String lhs, const char *rhs) { return (memcmp(lhs, rhs, lhs.Length()+1)==0); } inline friend bool operator==(rcSTR_String lhs, const char *rhs) { return (memcmp(lhs, rhs, lhs.Length() + 1) == 0); }
inline friend bool operator==(const char *lhs, rcSTR_String rhs) { return (memcmp(lhs, rhs, rhs.Length()+1)==0); } inline friend bool operator==(const char *lhs, rcSTR_String rhs) { return (memcmp(lhs, rhs, rhs.Length() + 1) == 0); }
inline friend bool operator!=(rcSTR_String lhs, rcSTR_String rhs) { return ((lhs.Length() != rhs.Length()) || (memcmp(lhs, rhs, lhs.Length())!=0)); } inline friend bool operator!=(rcSTR_String lhs, rcSTR_String rhs) { return ((lhs.Length() != rhs.Length()) || (memcmp(lhs, rhs, lhs.Length())!=0)); }
inline friend bool operator!=(rcSTR_String lhs, const char *rhs) { return (memcmp(lhs, rhs, lhs.Length()+1)!=0); } inline friend bool operator!=(rcSTR_String lhs, const char *rhs) { return (memcmp(lhs, rhs, lhs.Length() + 1) != 0); }
inline friend bool operator!=(const char *lhs, rcSTR_String rhs) { return (memcmp(lhs, rhs, rhs.Length()+1)!=0); } inline friend bool operator!=(const char *lhs, rcSTR_String rhs) { return (memcmp(lhs, rhs, rhs.Length() + 1) != 0); }
// serializing // serializing
//int Serialize(pCStream stream); //int Serialize(pCStream stream);

View File

@@ -377,7 +377,7 @@ static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float t[4], int cycl)
k1 = k[0] = k[1] = k[2] = k[3] = firstkey; k1 = k[0] = k[1] = k[2] = k[3] = firstkey;
t[0] = t[1] = t[2] = t[3] = k1->pos; t[0] = t[1] = t[2] = t[3] = k1->pos;
/* if (fac<0.0 || fac>1.0) return 1; */ /* if (fac < 0.0 || fac > 1.0) return 1; */
if (k1->next == NULL) return 1; if (k1->next == NULL) return 1;

View File

@@ -717,7 +717,7 @@ void sca_move_sensor(bSensor *sens_to_move, Object *ob, int move_up)
if (!sens) return; if (!sens) return;
/* move up */ /* move up */
if ( val==1 && sens->prev) { if (val == 1 && sens->prev) {
for (tmp=sens->prev; tmp; tmp=tmp->prev) { for (tmp=sens->prev; tmp; tmp=tmp->prev) {
if (tmp->flag & SENS_VISIBLE) if (tmp->flag & SENS_VISIBLE)
break; break;
@@ -728,7 +728,7 @@ void sca_move_sensor(bSensor *sens_to_move, Object *ob, int move_up)
} }
} }
/* move down */ /* move down */
else if ( val==2 && sens->next) { else if (val == 2 && sens->next) {
for (tmp=sens->next; tmp; tmp=tmp->next) { for (tmp=sens->next; tmp; tmp=tmp->next) {
if (tmp->flag & SENS_VISIBLE) if (tmp->flag & SENS_VISIBLE)
break; break;
@@ -756,7 +756,7 @@ void sca_move_controller(bController *cont_to_move, Object *ob, int move_up)
if (!cont) return; if (!cont) return;
/* move up */ /* move up */
if ( val==1 && cont->prev) { if (val == 1 && cont->prev) {
/* locate the controller that has the same state mask but is earlier in the list */ /* locate the controller that has the same state mask but is earlier in the list */
tmp = cont->prev; tmp = cont->prev;
while (tmp) { while (tmp) {
@@ -771,7 +771,7 @@ void sca_move_controller(bController *cont_to_move, Object *ob, int move_up)
} }
/* move down */ /* move down */
else if ( val==2 && cont->next) { else if (val == 2 && cont->next) {
tmp = cont->next; tmp = cont->next;
while (tmp) { while (tmp) {
if (tmp->state_mask & cont->state_mask) if (tmp->state_mask & cont->state_mask)
@@ -799,7 +799,7 @@ void sca_move_actuator(bActuator *act_to_move, Object *ob, int move_up)
if (!act) return; if (!act) return;
/* move up */ /* move up */
if ( val==1 && act->prev) { if (val == 1 && act->prev) {
/* locate the first visible actuators before this one */ /* locate the first visible actuators before this one */
for (tmp = act->prev; tmp; tmp=tmp->prev) { for (tmp = act->prev; tmp; tmp=tmp->prev) {
if (tmp->flag & ACT_VISIBLE) if (tmp->flag & ACT_VISIBLE)
@@ -811,7 +811,7 @@ void sca_move_actuator(bActuator *act_to_move, Object *ob, int move_up)
} }
} }
/* move down */ /* move down */
else if ( val==2 && act->next) { else if (val == 2 && act->next) {
/* locate the first visible actuators after this one */ /* locate the first visible actuators after this one */
for (tmp=act->next; tmp; tmp=tmp->next) { for (tmp=act->next; tmp; tmp=tmp->next) {
if (tmp->flag & ACT_VISIBLE) if (tmp->flag & ACT_VISIBLE)

View File

@@ -2449,7 +2449,7 @@ int BKE_tracking_context_step(MovieTrackingContext *context)
frame_width = destination_ibuf->x; frame_width = destination_ibuf->x;
frame_height = destination_ibuf->y; frame_height = destination_ibuf->y;
#pragma omp parallel for private(a) shared(destination_ibuf, ok) if (map_size>1) #pragma omp parallel for private(a) shared(destination_ibuf, ok) if (map_size > 1)
for (a = 0; a < map_size; a++) { for (a = 0; a < map_size; a++) {
TrackContext *track_context = NULL; TrackContext *track_context = NULL;
MovieTrackingTrack *track; MovieTrackingTrack *track;

View File

@@ -180,13 +180,13 @@ static struct bUnitDef buMetricVolDef[] = {
static struct bUnitCollection buMetricVolCollecton = {buMetricVolDef, 3, 0, sizeof(buMetricVolDef) / sizeof(bUnitDef)}; static struct bUnitCollection buMetricVolCollecton = {buMetricVolDef, 3, 0, sizeof(buMetricVolDef) / sizeof(bUnitDef)};
static struct bUnitDef buImperialVolDef[] = { static struct bUnitDef buImperialVolDef[] = {
{"cubic mile", "cubic miles", "cu mi", "cu m", "Cubic Miles", UN_SC_MI * UN_SC_MI * UN_SC_MI, 0.0, B_UNIT_DEF_NONE}, {"cubic mile", "cubic miles", "cu mi", "cu m", "Cubic Miles", UN_SC_MI * UN_SC_MI * UN_SC_MI, 0.0, B_UNIT_DEF_NONE},
{"cubic furlong", "cubic furlongs", "cu fur", NULL, "Cubic Furlongs", UN_SC_FUR * UN_SC_FUR * UN_SC_FUR, 0.0, B_UNIT_DEF_SUPPRESS}, {"cubic furlong", "cubic furlongs", "cu fur", NULL, "Cubic Furlongs", UN_SC_FUR * UN_SC_FUR * UN_SC_FUR, 0.0, B_UNIT_DEF_SUPPRESS},
{"cubic chain", "cubic chains", "cu ch", NULL, "Cubic Chains", UN_SC_CH * UN_SC_CH * UN_SC_CH, 0.0, B_UNIT_DEF_SUPPRESS}, {"cubic chain", "cubic chains", "cu ch", NULL, "Cubic Chains", UN_SC_CH * UN_SC_CH * UN_SC_CH, 0.0, B_UNIT_DEF_SUPPRESS},
{"cubic yard", "cubic yards", "cu yd", NULL, "Cubic Yards", UN_SC_YD * UN_SC_YD * UN_SC_YD, 0.0, B_UNIT_DEF_NONE}, {"cubic yard", "cubic yards", "cu yd", NULL, "Cubic Yards", UN_SC_YD * UN_SC_YD * UN_SC_YD, 0.0, B_UNIT_DEF_NONE},
{"cubic foot", "cubic feet", "cu ft", NULL, "Cubic Feet", UN_SC_FT * UN_SC_FT * UN_SC_FT, 0.0, B_UNIT_DEF_NONE}, /* base unit */ {"cubic foot", "cubic feet", "cu ft", NULL, "Cubic Feet", UN_SC_FT * UN_SC_FT * UN_SC_FT, 0.0, B_UNIT_DEF_NONE}, /* base unit */
{"cubic inch", "cubic inches", "cu in", NULL , "Cubic Inches", UN_SC_IN * UN_SC_IN * UN_SC_IN, 0.0, B_UNIT_DEF_NONE}, {"cubic inch", "cubic inches", "cu in", NULL, "Cubic Inches", UN_SC_IN * UN_SC_IN * UN_SC_IN, 0.0, B_UNIT_DEF_NONE},
{"cubic thou", "cubic thous", "cu mil", NULL, "Cubic Thous", UN_SC_MIL * UN_SC_MIL * UN_SC_MIL, 0.0, B_UNIT_DEF_NONE}, {"cubic thou", "cubic thous", "cu mil", NULL, "Cubic Thous", UN_SC_MIL * UN_SC_MIL * UN_SC_MIL, 0.0, B_UNIT_DEF_NONE},
{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0} {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
}; };
static struct bUnitCollection buImperialVolCollecton = {buImperialVolDef, 4, 0, sizeof(buImperialVolDef) / sizeof(bUnitDef)}; static struct bUnitCollection buImperialVolCollecton = {buImperialVolDef, 4, 0, sizeof(buImperialVolDef) / sizeof(bUnitDef)};

View File

@@ -46,7 +46,7 @@
* BLI_array_declare(arr); * BLI_array_declare(arr);
* int i; * int i;
* *
* for (i=0; i<10; i++) { * for (i = 0; i < 10; i++) {
* BLI_array_grow_one(arr); * BLI_array_grow_one(arr);
* arr[i] = something; * arr[i] = something;
* } * }

View File

@@ -50,7 +50,7 @@ typedef struct BVHTreeOverlap {
} BVHTreeOverlap; } BVHTreeOverlap;
/* flags */ /* flags */
#define BVH_ONQUAD (1<<0) #define BVH_ONQUAD (1 << 0)
typedef struct BVHTreeNearest { typedef struct BVHTreeNearest {
int index; /* the index of the nearest found (untouched if none is found within a dist radius from the given coordinates) */ int index; /* the index of the nearest found (untouched if none is found within a dist radius from the given coordinates) */

View File

@@ -733,7 +733,7 @@ int isect_ray_tri_v3(const float p1[3], const float d[3],
cross_v3_v3v3(p, d, e2); cross_v3_v3v3(p, d, e2);
a = dot_v3v3(e1, p); a = dot_v3v3(e1, p);
/* note: these values were 0.000001 in 2.4x but for projection snapping on /* note: these values were 0.000001 in 2.4x but for projection snapping on
* a human head (1BU==1m), subsurf level 2, this gave many errors - campbell */ * a human head (1BU == 1m), subsurf level 2, this gave many errors - campbell */
if ((a > -0.00000001f) && (a < 0.00000001f)) return 0; if ((a > -0.00000001f) && (a < 0.00000001f)) return 0;
f = 1.0f / a; f = 1.0f / a;
@@ -772,7 +772,7 @@ int isect_ray_plane_v3(const float p1[3], const float d[3],
cross_v3_v3v3(p, d, e2); cross_v3_v3v3(p, d, e2);
a = dot_v3v3(e1, p); a = dot_v3v3(e1, p);
/* note: these values were 0.000001 in 2.4x but for projection snapping on /* note: these values were 0.000001 in 2.4x but for projection snapping on
* a human head (1BU==1m), subsurf level 2, this gave many errors - campbell */ * a human head (1BU == 1m), subsurf level 2, this gave many errors - campbell */
if ((a > -0.00000001f) && (a < 0.00000001f)) return 0; if ((a > -0.00000001f) && (a < 0.00000001f)) return 0;
f = 1.0f / a; f = 1.0f / a;

View File

@@ -415,7 +415,7 @@ static short boundinsideEV(ScanFillEdge *eed, ScanFillVert *eve)
static void testvertexnearedge(ScanFillContext *sf_ctx) static void testvertexnearedge(ScanFillContext *sf_ctx)
{ {
/* only vertices with ->h==1 are being tested for /* only vertices with (->h == 1) are being tested for
* being close to an edge, if true insert */ * being close to an edge, if true insert */
ScanFillVert *eve; ScanFillVert *eve;
@@ -947,7 +947,7 @@ int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const short do_quad_tri_speedu
return 0; return 0;
} }
/* does it only for vertices with ->h==1 */ /* does it only for vertices with (->h == 1) */
testvertexnearedge(sf_ctx); testvertexnearedge(sf_ctx);
ok = 1; ok = 1;

View File

@@ -234,7 +234,7 @@ size_t BLI_wstrlen_utf8(const wchar_t *src)
// utf8slen // utf8slen
size_t BLI_strlen_utf8(const char *strc) size_t BLI_strlen_utf8(const char *strc)
{ {
int len=0; int len = 0;
while (*strc) { while (*strc) {
if ((*strc & 0xe0) == 0xc0) { if ((*strc & 0xe0) == 0xc0) {
@@ -259,7 +259,7 @@ size_t BLI_strlen_utf8(const char *strc)
size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size_t maxcpy) size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size_t maxcpy)
{ {
int len=0; int len = 0;
if (dst_w == NULL || src_c == NULL) { if (dst_w == NULL || src_c == NULL) {
return 0; return 0;

View File

@@ -364,7 +364,7 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
/* BLI_array_staticdeclare(verts, BM_NGON_STACK_SIZE); */ /* UNUSE */ /* BLI_array_staticdeclare(verts, BM_NGON_STACK_SIZE); */ /* UNUSE */
int i; int i;
#define SIGN(n) ((n)<0.0f) #define SIGN(n) ((n) < 0.0f)
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
BMIter eiter; BMIter eiter;

View File

@@ -189,7 +189,7 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene *sce,
#if 0 #if 0
if (bone->childbase.first == NULL || BLI_countlist(&(bone->childbase)) >= 2) { if (bone->childbase.first == NULL || BLI_countlist(&(bone->childbase)) >= 2) {
add_blender_leaf_bone( bone, ob_arm , node ); add_blender_leaf_bone( bone, ob_arm, node);
} }
else { else {
#endif #endif

View File

@@ -467,12 +467,13 @@ bool MeshImporter::primitive_has_faces(COLLADAFW::MeshPrimitive *mp) {
} }
// ================================================================= // =================================================================
// Return the number of faces by summing up // Return the number of faces by summing up
// the facecounts of the parts. // the facecounts of the parts.
// hint: This is done because mesh->getFacesCount() does // hint: This is done because mesh->getFacesCount() does
// count loose edges as extra faces, which is not what we want here. // count loose edges as extra faces, which is not what we want here.
// ================================================================= // =================================================================
void MeshImporter::allocate_face_data(COLLADAFW::Mesh *mesh, Mesh *me, int new_tris) { void MeshImporter::allocate_face_data(COLLADAFW::Mesh *mesh, Mesh *me, int new_tris)
{
COLLADAFW::MeshPrimitiveArray& prim_arr = mesh->getMeshPrimitives(); COLLADAFW::MeshPrimitiveArray& prim_arr = mesh->getMeshPrimitives();
int total_facecount = 0; int total_facecount = 0;

View File

@@ -72,8 +72,8 @@ static bool g_openclActive = false;
#define MAX_HIGHLIGHT 8 #define MAX_HIGHLIGHT 8
extern "C" { extern "C" {
int g_highlightIndex; int g_highlightIndex;
void ** g_highlightedNodes; void **g_highlightedNodes;
void ** g_highlightedNodesRead; void **g_highlightedNodesRead;
#define HIGHLIGHT(wp) \ #define HIGHLIGHT(wp) \
{ \ { \
@@ -282,7 +282,7 @@ void WorkScheduler::initialize()
cl_platform_id platform = platforms[indexPlatform]; cl_platform_id platform = platforms[indexPlatform];
cl_uint numberOfDevices = 0; cl_uint numberOfDevices = 0;
clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 0, 0, &numberOfDevices); clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 0, 0, &numberOfDevices);
if (numberOfDevices>0) { if (numberOfDevices > 0) {
cl_device_id *cldevices = new cl_device_id[numberOfDevices]; cl_device_id *cldevices = new cl_device_id[numberOfDevices];
clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, numberOfDevices, cldevices, 0); clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, numberOfDevices, cldevices, 0);

View File

@@ -92,7 +92,7 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
int pixelSize = this->m_size * max_dim / 100.0f; int pixelSize = this->m_size * max_dim / 100.0f;
zero_v4(color_accum); zero_v4(color_accum);
if (pixelSize<2) { if (pixelSize < 2) {
this->m_inputProgram->read(color_accum, x, y, COM_PS_NEAREST); this->m_inputProgram->read(color_accum, x, y, COM_PS_NEAREST);
multiplier_accum[0] = 1.0f; multiplier_accum[0] = 1.0f;
multiplier_accum[1] = 1.0f; multiplier_accum[1] = 1.0f;

View File

@@ -103,7 +103,7 @@ void ED_base_object_activate(struct bContext *C, struct Base *base);
void ED_base_object_free_and_unlink(struct Main *bmain, struct Scene *scene, struct Base *base); void ED_base_object_free_and_unlink(struct Main *bmain, struct Scene *scene, struct Base *base);
/* single object duplicate, if dupflag==0, fully linked, else it uses the flags given */ /* single object duplicate, if (dupflag == 0), fully linked, else it uses the flags given */
struct Base *ED_object_add_duplicate(struct Main *bmain, struct Scene *scene, struct Base *base, int dupflag); struct Base *ED_object_add_duplicate(struct Main *bmain, struct Scene *scene, struct Base *base, int dupflag);
void ED_object_parent(struct Object *ob, struct Object *parent, int type, const char *substr); void ED_object_parent(struct Object *ob, struct Object *parent, int type, const char *substr);

View File

@@ -2094,7 +2094,7 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data
} }
/* this makes adjacent blocks auto open from now on */ /* this makes adjacent blocks auto open from now on */
//if (but->block->auto_open==0) but->block->auto_open= 1; //if (but->block->auto_open ==0 ) but->block->auto_open = 1;
} }
static void ui_blockopen_end(bContext *C, uiBut *but, uiHandleButtonData *data) static void ui_blockopen_end(bContext *C, uiBut *but, uiHandleButtonData *data)
@@ -3395,7 +3395,7 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmND
/* Convert current color on hue/sat disc to circular coordinates phi, r */ /* Convert current color on hue/sat disc to circular coordinates phi, r */
phi = fmodf(hsv[0] + 0.25f, 1.0f) * -2.0f * (float)M_PI; phi = fmodf(hsv[0] + 0.25f, 1.0f) * -2.0f * (float)M_PI;
r = hsv[1]; r = hsv[1];
/* sqr= r>0.f?sqrtf(r):1; */ /* UNUSED */ /* sqr = r > 0.0f ? sqrtf(r) : 1; */ /* UNUSED */
/* Convert to 2d vectors */ /* Convert to 2d vectors */
v[0] = r * cosf(phi); v[0] = r * cosf(phi);

View File

@@ -706,7 +706,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
// ask user if thats what he/she wants... // ask user if thats what he/she wants...
selection = pupmenu(dispmsg); selection = pupmenu(dispmsg);
if (selection<1) return 0; // 0 from menu, or -1 aborted if (selection < 1) return 0; // 0 from menu, or -1 aborted
BLI_strncpy(targetDir, newSurfdataPath, sizeof(targetDir)); BLI_strncpy(targetDir, newSurfdataPath, sizeof(targetDir));
strncpy(domainSettings->surfdataPath, newSurfdataPath, FILE_MAXDIR); strncpy(domainSettings->surfdataPath, newSurfdataPath, FILE_MAXDIR);
BLI_path_abs(targetDir, G.main->name); // fixed #frame-no BLI_path_abs(targetDir, G.main->name); // fixed #frame-no

View File

@@ -580,7 +580,7 @@ static int image_view_all_exec(bContext *C, wmOperator *UNUSED(op))
w = width * aspx; w = width * aspx;
h = height * aspy; h = height * aspy;
/* check if the image will fit in the image with zoom==1 */ /* check if the image will fit in the image with (zoom == 1) */
width = ar->winrct.xmax - ar->winrct.xmin + 1; width = ar->winrct.xmax - ar->winrct.xmin + 1;
height = ar->winrct.ymax - ar->winrct.ymin + 1; height = ar->winrct.ymax - ar->winrct.ymin + 1;

View File

@@ -377,7 +377,7 @@ static int node_mouse_select(Main *bmain, SpaceNode *snode, ARegion *ar, const i
} }
} }
} }
else { /* extend==0 */ else { /* extend == 0 */
/* find the closest visible node */ /* find the closest visible node */
node = node_under_mouse_select(snode->edittree, mx, my); node = node_under_mouse_select(snode->edittree, mx, my);

View File

@@ -4,13 +4,13 @@ uniform sampler2D textureSource;
void main() void main()
{ {
vec4 color = vec4(0.0); vec4 color = vec4(0.0);
color += texture2D( textureSource, gl_TexCoord[0].st + vec2( -3.0*ScaleU.x, -3.0*ScaleU.y ) ) * 0.015625; color += texture2D( textureSource, gl_TexCoord[0].st + vec2(-3.0 * ScaleU.x, -3.0 * ScaleU.y ) ) * 0.015625;
color += texture2D( textureSource, gl_TexCoord[0].st + vec2( -2.0*ScaleU.x, -2.0*ScaleU.y ) )*0.09375; color += texture2D( textureSource, gl_TexCoord[0].st + vec2(-2.0 * ScaleU.x, -2.0 * ScaleU.y ) ) * 0.09375;
color += texture2D( textureSource, gl_TexCoord[0].st + vec2( -1.0*ScaleU.x, -1.0*ScaleU.y ) )*0.234375; color += texture2D( textureSource, gl_TexCoord[0].st + vec2(-1.0 * ScaleU.x, -1.0 * ScaleU.y ) ) * 0.234375;
color += texture2D( textureSource, gl_TexCoord[0].st + vec2( 0.0 , 0.0) )*0.3125; color += texture2D( textureSource, gl_TexCoord[0].st + vec2(0.0, 0.0)) * 0.3125;
color += texture2D( textureSource, gl_TexCoord[0].st + vec2( 1.0*ScaleU.x, 1.0*ScaleU.y ) )*0.234375; color += texture2D( textureSource, gl_TexCoord[0].st + vec2(1.0 * ScaleU.x, 1.0 * ScaleU.y ) ) * 0.234375;
color += texture2D( textureSource, gl_TexCoord[0].st + vec2( 2.0*ScaleU.x, 2.0*ScaleU.y ) )*0.09375; color += texture2D( textureSource, gl_TexCoord[0].st + vec2(2.0 * ScaleU.x, 2.0 * ScaleU.y ) ) * 0.09375;
color += texture2D( textureSource, gl_TexCoord[0].st + vec2( 3.0*ScaleU.x, -3.0*ScaleU.y ) ) * 0.015625; color += texture2D( textureSource, gl_TexCoord[0].st + vec2(3.0 * ScaleU.x, -3.0 * ScaleU.y ) ) * 0.015625;
gl_FragColor = color; gl_FragColor = color;
} }

View File

@@ -218,7 +218,7 @@ typedef struct bPoseChannel {
short rotmode; /* eRotationModes - rotation representation to use */ short rotmode; /* eRotationModes - rotation representation to use */
short pad; short pad;
float chan_mat[4][4]; /* matrix result of loc/quat/size , and where we put deform in, see next line */ float chan_mat[4][4]; /* matrix result of loc/quat/size, and where we put deform in, see next line */
float pose_mat[4][4]; /* constraints accumulate here. in the end, pose_mat = bone->arm_mat * chan_mat float pose_mat[4][4]; /* constraints accumulate here. in the end, pose_mat = bone->arm_mat * chan_mat
* this matrix is object space */ * this matrix is object space */
float constinv[4][4]; /* inverse result of constraints. float constinv[4][4]; /* inverse result of constraints.

View File

@@ -332,7 +332,7 @@ typedef struct bTransformConstraint {
struct Object *tar; /* target (i.e. 'driver' object/bone) */ struct Object *tar; /* target (i.e. 'driver' object/bone) */
char subtarget[64]; /* MAX_ID_NAME-2 */ char subtarget[64]; /* MAX_ID_NAME-2 */
short from, to; /* can be loc(0) , rot(1), or size(2) */ short from, to; /* can be loc(0), rot(1) or size(2) */
char map[3]; /* defines which target-axis deform is copied by each owner-axis */ char map[3]; /* defines which target-axis deform is copied by each owner-axis */
char expo; /* extrapolate motion? if 0, confine to ranges */ char expo; /* extrapolate motion? if 0, confine to ranges */

View File

@@ -420,7 +420,7 @@ static PyObject *bpy_bmesh_fmod_getattro(PyObject *UNUSED(self), PyObject *pynam
} }
PyErr_Format(PyExc_AttributeError, PyErr_Format(PyExc_AttributeError,
"BMeshOpsModule: , operator \"%.200s\" doesn't exist", "BMeshOpsModule: operator \"%.200s\" doesn't exist",
name); name);
return NULL; return NULL;
} }

View File

@@ -66,7 +66,7 @@ struct ImBuf;
typedef struct wmJob wmJob; typedef struct wmJob wmJob;
/* general API */ /* general API */
void WM_setprefsize (int stax, int stay, int sizx, int sizy); void WM_init_state_size_set (int stax, int stay, int sizx, int sizy);
void WM_init_state_fullscreen_set(void); void WM_init_state_fullscreen_set(void);
void WM_init_state_normal_set(void); void WM_init_state_normal_set(void);

View File

@@ -196,7 +196,7 @@ void KX_BlenderRenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmat
//page 360/361 3D Game Engine Design, David Eberly for a discussion //page 360/361 3D Game Engine Design, David Eberly for a discussion
// on screen aligned and axis aligned billboards // on screen aligned and axis aligned billboards
// assumed is that the preprocessor transformed all billboard polygons // assumed is that the preprocessor transformed all billboard polygons
// so that their normal points into the positive x direction (1.0 , 0.0 , 0.0) // so that their normal points into the positive x direction (1.0, 0.0, 0.0)
// when new parenting for objects is done, this rotation // when new parenting for objects is done, this rotation
// will be moved into the object // will be moved into the object

View File

@@ -299,16 +299,16 @@ public: \
* Method table macro (with doc) * Method table macro (with doc)
*/ */
#define KX_PYMETHODTABLE(class_name, method_name) \ #define KX_PYMETHODTABLE(class_name, method_name) \
{#method_name , (PyCFunction) class_name::sPy##method_name, METH_VARARGS, (const char *)class_name::method_name##_doc} {#method_name, (PyCFunction) class_name::sPy##method_name, METH_VARARGS, (const char *)class_name::method_name##_doc}
#define KX_PYMETHODTABLE_O(class_name, method_name) \ #define KX_PYMETHODTABLE_O(class_name, method_name) \
{#method_name , (PyCFunction) class_name::sPy##method_name, METH_O, (const char *)class_name::method_name##_doc} {#method_name, (PyCFunction) class_name::sPy##method_name, METH_O, (const char *)class_name::method_name##_doc}
#define KX_PYMETHODTABLE_NOARGS(class_name, method_name) \ #define KX_PYMETHODTABLE_NOARGS(class_name, method_name) \
{#method_name , (PyCFunction) class_name::sPy##method_name, METH_NOARGS, (const char *)class_name::method_name##_doc} {#method_name, (PyCFunction) class_name::sPy##method_name, METH_NOARGS, (const char *)class_name::method_name##_doc}
#define KX_PYMETHODTABLE_KEYWORDS(class_name, method_name) \ #define KX_PYMETHODTABLE_KEYWORDS(class_name, method_name) \
{#method_name , (PyCFunction) class_name::sPy##method_name, METH_VARARGS|METH_KEYWORDS, (const char *)class_name::method_name##_doc} {#method_name, (PyCFunction) class_name::sPy##method_name, METH_VARARGS|METH_KEYWORDS, (const char *)class_name::method_name##_doc}
/** /**
* Function implementation macro * Function implementation macro

View File

@@ -29,7 +29,7 @@ class CStringValue : public CPropValue
public: public:
/// Construction / destruction /// Construction / destruction
CStringValue(); CStringValue();
CStringValue (const char *txt, const char *name , AllocationTYPE alloctype = CValue::HEAPVALUE); CStringValue(const char *txt, const char *name, AllocationTYPE alloctype = CValue::HEAPVALUE);
virtual ~CStringValue() {} virtual ~CStringValue() {}
/// CValue implementation /// CValue implementation

View File

@@ -620,7 +620,7 @@ bool IsPrintable(int keyIndex)
* - numerals: KX_ZEROKEY to KX_NINEKEY * - numerals: KX_ZEROKEY to KX_NINEKEY
* - alphas: KX_AKEY to KX_ZKEY. * - alphas: KX_AKEY to KX_ZKEY.
* - specials: KX_RETKEY, KX_PADASTERKEY, KX_PADCOMMAKEY to KX_PERIODKEY, * - specials: KX_RETKEY, KX_PADASTERKEY, KX_PADCOMMAKEY to KX_PERIODKEY,
* KX_TABKEY , KX_SEMICOLONKEY to KX_RIGHTBRACKETKEY, * KX_TABKEY, KX_SEMICOLONKEY to KX_RIGHTBRACKETKEY,
* KX_PAD2 to KX_PADPLUSKEY * KX_PAD2 to KX_PADPLUSKEY
* - delete and backspace: also printable in the sense that they modify * - delete and backspace: also printable in the sense that they modify
* the string * the string

View File

@@ -205,7 +205,7 @@ void GPC_RenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmatrix,in
//page 360/361 3D Game Engine Design, David Eberly for a discussion //page 360/361 3D Game Engine Design, David Eberly for a discussion
// on screen aligned and axis aligned billboards // on screen aligned and axis aligned billboards
// assumed is that the preprocessor transformed all billboard polygons // assumed is that the preprocessor transformed all billboard polygons
// so that their normal points into the positive x direction (1.0 , 0.0 , 0.0) // so that their normal points into the positive x direction (1.0, 0.0, 0.0)
// when new parenting for objects is done, this rotation // when new parenting for objects is done, this rotation
// will be moved into the object // will be moved into the object

View File

@@ -475,7 +475,7 @@ int main(int argc, char** argv)
{ {
#if defined(DEBUG) #if defined(DEBUG)
printf("argv[%d] = '%s' , %i\n", i, argv[i],argc); printf("argv[%d] = '%s', %i\n", i, argv[i],argc);
#endif #endif
if (argv[i][0] == '-') if (argv[i][0] == '-')
{ {

View File

@@ -2282,15 +2282,15 @@ PyObject* initGameKeys()
KX_MACRO_addTypesToDict(d, PADPLUSKEY, SCA_IInputDevice::KX_PADPLUSKEY); KX_MACRO_addTypesToDict(d, PADPLUSKEY, SCA_IInputDevice::KX_PADPLUSKEY);
KX_MACRO_addTypesToDict(d, F1KEY , SCA_IInputDevice::KX_F1KEY); KX_MACRO_addTypesToDict(d, F1KEY, SCA_IInputDevice::KX_F1KEY);
KX_MACRO_addTypesToDict(d, F2KEY , SCA_IInputDevice::KX_F2KEY); KX_MACRO_addTypesToDict(d, F2KEY, SCA_IInputDevice::KX_F2KEY);
KX_MACRO_addTypesToDict(d, F3KEY , SCA_IInputDevice::KX_F3KEY); KX_MACRO_addTypesToDict(d, F3KEY, SCA_IInputDevice::KX_F3KEY);
KX_MACRO_addTypesToDict(d, F4KEY , SCA_IInputDevice::KX_F4KEY); KX_MACRO_addTypesToDict(d, F4KEY, SCA_IInputDevice::KX_F4KEY);
KX_MACRO_addTypesToDict(d, F5KEY , SCA_IInputDevice::KX_F5KEY); KX_MACRO_addTypesToDict(d, F5KEY, SCA_IInputDevice::KX_F5KEY);
KX_MACRO_addTypesToDict(d, F6KEY , SCA_IInputDevice::KX_F6KEY); KX_MACRO_addTypesToDict(d, F6KEY, SCA_IInputDevice::KX_F6KEY);
KX_MACRO_addTypesToDict(d, F7KEY , SCA_IInputDevice::KX_F7KEY); KX_MACRO_addTypesToDict(d, F7KEY, SCA_IInputDevice::KX_F7KEY);
KX_MACRO_addTypesToDict(d, F8KEY , SCA_IInputDevice::KX_F8KEY); KX_MACRO_addTypesToDict(d, F8KEY, SCA_IInputDevice::KX_F8KEY);
KX_MACRO_addTypesToDict(d, F9KEY , SCA_IInputDevice::KX_F9KEY); KX_MACRO_addTypesToDict(d, F9KEY, SCA_IInputDevice::KX_F9KEY);
KX_MACRO_addTypesToDict(d, F10KEY, SCA_IInputDevice::KX_F10KEY); KX_MACRO_addTypesToDict(d, F10KEY, SCA_IInputDevice::KX_F10KEY);
KX_MACRO_addTypesToDict(d, F11KEY, SCA_IInputDevice::KX_F11KEY); KX_MACRO_addTypesToDict(d, F11KEY, SCA_IInputDevice::KX_F11KEY);
KX_MACRO_addTypesToDict(d, F12KEY, SCA_IInputDevice::KX_F12KEY); KX_MACRO_addTypesToDict(d, F12KEY, SCA_IInputDevice::KX_F12KEY);
@@ -2302,9 +2302,9 @@ PyObject* initGameKeys()
KX_MACRO_addTypesToDict(d, F18KEY, SCA_IInputDevice::KX_F18KEY); KX_MACRO_addTypesToDict(d, F18KEY, SCA_IInputDevice::KX_F18KEY);
KX_MACRO_addTypesToDict(d, F19KEY, SCA_IInputDevice::KX_F19KEY); KX_MACRO_addTypesToDict(d, F19KEY, SCA_IInputDevice::KX_F19KEY);
KX_MACRO_addTypesToDict(d, PAUSEKEY, SCA_IInputDevice::KX_PAUSEKEY); KX_MACRO_addTypesToDict(d, PAUSEKEY, SCA_IInputDevice::KX_PAUSEKEY);
KX_MACRO_addTypesToDict(d, INSERTKEY, SCA_IInputDevice::KX_INSERTKEY); KX_MACRO_addTypesToDict(d, INSERTKEY, SCA_IInputDevice::KX_INSERTKEY);
KX_MACRO_addTypesToDict(d, HOMEKEY , SCA_IInputDevice::KX_HOMEKEY); KX_MACRO_addTypesToDict(d, HOMEKEY, SCA_IInputDevice::KX_HOMEKEY);
KX_MACRO_addTypesToDict(d, PAGEUPKEY, SCA_IInputDevice::KX_PAGEUPKEY); KX_MACRO_addTypesToDict(d, PAGEUPKEY, SCA_IInputDevice::KX_PAGEUPKEY);
KX_MACRO_addTypesToDict(d, PAGEDOWNKEY, SCA_IInputDevice::KX_PAGEDOWNKEY); KX_MACRO_addTypesToDict(d, PAGEDOWNKEY, SCA_IInputDevice::KX_PAGEDOWNKEY);
KX_MACRO_addTypesToDict(d, ENDKEY, SCA_IInputDevice::KX_ENDKEY); KX_MACRO_addTypesToDict(d, ENDKEY, SCA_IInputDevice::KX_ENDKEY);