Cleanup: style

This commit is contained in:
2015-01-24 03:10:23 +11:00
parent ae213d740d
commit fcda27cdae
11 changed files with 47 additions and 29 deletions

View File

@@ -161,21 +161,24 @@ static AdrBit2Path ma_mode_bits[] = {
{ \
*tot = sizeof(items) / sizeof(AdrBit2Path); \
return items; \
}
} (void)0
/* This function checks if a Blocktype+Adrcode combo, returning a mapping table */
static AdrBit2Path *adrcode_bitmaps_to_paths(int blocktype, int adrcode, int *tot)
{
/* Object layers */
if ((blocktype == ID_OB) && (adrcode == OB_LAY))
RET_ABP(ob_layer_bits)
else if ((blocktype == ID_MA) && (adrcode == MA_MODE))
RET_ABP(ma_mode_bits)
if ((blocktype == ID_OB) && (adrcode == OB_LAY)) {
RET_ABP(ob_layer_bits);
}
else if ((blocktype == ID_MA) && (adrcode == MA_MODE)) {
RET_ABP(ma_mode_bits);
}
// XXX TODO: add other types...
/* Normal curve */
return NULL;
}
#undef RET_ABP
/* *************************************************** */
/* ADRCODE to RNA-Path Conversion Code - Standard */

View File

@@ -913,7 +913,11 @@ static void docube(PROCESS *process, CUBE *cube, MetaBall *mb)
CORNER *c1, *c2;
int i, index = 0, count, indexar[8];
for (i = 0; i < 8; i++) if (cube->corners[i]->value > 0.0f) index += (1 << i);
for (i = 0; i < 8; i++) {
if (cube->corners[i]->value > 0.0f) {
index += (1 << i);
}
}
for (polys = cubetable[index]; polys; polys = polys->next) {
INTLIST *edges;

View File

@@ -651,8 +651,11 @@ static void distribute_children_exec(ParticleTask *thread, ChildParticle *cpa, i
cpa->w[i]=0.0f;
}
if (totw>0.0f) for (w=0; w<4; w++)
cpa->w[w]/=totw;
if (totw > 0.0f) {
for (w = 0; w < 4; w++) {
cpa->w[w] /= totw;
}
}
cpa->parent=cpa->pa[0];
}

View File

@@ -687,8 +687,7 @@ void sound_free_waveform(bSound *sound)
void sound_read_waveform(bSound *sound, short *stop)
{
AUD_SoundInfo info = AUD_getInfo(sound->playback_handle);
SoundWaveform *waveform = MEM_mallocN(sizeof(SoundWaveform),
"SoundWaveform");
SoundWaveform *waveform = MEM_mallocN(sizeof(SoundWaveform), "SoundWaveform");
if (info.length > 0) {
int length = info.length * SOUND_WAVE_SAMPLES_PER_SECOND;

View File

@@ -349,7 +349,11 @@ bool do_colorband(const ColorBand *coba, float in, float out[4])
CBData left, right;
/* we're looking for first pos > in */
for (a = 0; a < coba->tot; a++, cbd1++) if (cbd1->pos > in) break;
for (a = 0; a < coba->tot; a++, cbd1++) {
if (cbd1->pos > in) {
break;
}
}
if (a == coba->tot) {
cbd2 = cbd1 - 1;

View File

@@ -1883,7 +1883,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
SEQ_END
if (scene->r.bake_samples == 0)
scene->r.bake_samples = 256;
scene->r.bake_samples = 256;
if (scene->world) {
World *world = blo_do_versions_newlibadr(fd, scene->id.lib, scene->world);

View File

@@ -652,16 +652,12 @@ static void paint_draw_tex_overlay(UnifiedPaintSettings *ups, Brush *brush,
}
/* set quad color. Colored overlay does not get blending */
if (col)
glColor4f(1.0,
1.0,
1.0,
overlay_alpha / 100.0f);
else
glColor4f(U.sculpt_paint_overlay_col[0],
U.sculpt_paint_overlay_col[1],
U.sculpt_paint_overlay_col[2],
overlay_alpha / 100.0f);
if (col) {
glColor4f(1.0, 1.0, 1.0, overlay_alpha / 100.0f);
}
else {
glColor4f(UNPACK3(U.sculpt_paint_overlay_col), overlay_alpha / 100.0f);
}
/* draw textured quad */
glBegin(GL_QUADS);

View File

@@ -158,9 +158,10 @@ static void undo_copy_tile(UndoImageTile *tile, ImBuf *tmpibuf, ImBuf *ibuf, Cop
}
}
else {
if (mode == RESTORE_COPY)
if (mode == RESTORE_COPY) {
IMB_rectcpy(tmpibuf, ibuf, 0, 0, tile->x * IMAPAINT_TILE_SIZE,
tile->y * IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
tile->y * IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
}
/* swap to the tmpbuf for easy copying */
if (ibuf->rect_float) {
SWAP(float *, tmpibuf->rect_float, tile->rect.fp);

View File

@@ -2537,10 +2537,14 @@ static void text_cursor_set_to_pos(SpaceText *st, ARegion *ar, int x, int y, con
y -= txt_get_span(text->lines.first, *linep) - st->top;
if (y > 0) {
while (y-- != 0) if ((*linep)->next) *linep = (*linep)->next;
while (y-- != 0) {
if ((*linep)->next) *linep = (*linep)->next;
}
}
else if (y < 0) {
while (y++ != 0) if ((*linep)->prev) *linep = (*linep)->prev;
while (y++ != 0) {
if ((*linep)->prev) *linep = (*linep)->prev;
}
}

View File

@@ -298,7 +298,9 @@ int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags)
if (putc(data[ptr], ofile) == EOF) return 0;
}
/* add padding here */
for (t = 0; t < extrabytes; t++) if (putc(0, ofile) == EOF) return 0;
for (t = 0; t < extrabytes; t++) {
if (putc(0, ofile) == EOF) return 0;
}
}
if (ofile) {
fflush(ofile);

View File

@@ -183,8 +183,10 @@ LogImageFile *dpxOpen(const unsigned char *byteStuff, int fromMemory, size_t buf
if (verbose) printf("DPX: File is LSB.\n");
}
else {
if (verbose) printf("DPX: Bad magic number %lu in \"%s\".\n",
(uintptr_t)header.fileHeader.magic_num, byteStuff);
if (verbose) {
printf("DPX: Bad magic number %lu in \"%s\".\n",
(uintptr_t)header.fileHeader.magic_num, byteStuff);
}
logImageClose(dpx);
return NULL;
}