style cleanup

This commit is contained in:
Campbell Barton
2012-08-04 19:34:38 +00:00
parent 97e9659c53
commit 3d20474414
11 changed files with 61 additions and 49 deletions

View File

@@ -181,7 +181,7 @@ typedef enum {
////////////////////////////////////////////////
// needed for implicit.c
int cloth_bvh_objcollision (struct Object *ob, struct ClothModifierData * clmd, float step, float dt );
int cloth_bvh_objcollision (struct Object *ob, struct ClothModifierData *clmd, float step, float dt );
////////////////////////////////////////////////

View File

@@ -260,7 +260,7 @@ VFont *BKE_vfont_load(Main *bmain, const char *name)
BLI_strncpy(filename, name, sizeof(filename));
pf = get_builtin_packedfile();
is_builtin = 1;
is_builtin = TRUE;
}
else {
char dir[FILE_MAXDIR];
@@ -271,7 +271,7 @@ VFont *BKE_vfont_load(Main *bmain, const char *name)
pf = newPackedFile(NULL, name, bmain->name);
tpf = newPackedFile(NULL, name, bmain->name);
is_builtin = 0;
is_builtin = FALSE;
}
if (pf) {
@@ -398,7 +398,8 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i
}
static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo *info, float ofsx, float ofsy, float rot, int charidx)
static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo *info,
float ofsx, float ofsy, float rot, int charidx)
{
BezTriple *bezt1, *bezt2;
Nurb *nu1 = NULL, *nu2 = NULL;
@@ -424,8 +425,8 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
/* make a copy at distance ofsx, ofsy with shear*/
fsize = cu->fsize;
shear = cu->shear;
si = (float)sin(rot);
co = (float)cos(rot);
si = sinf(rot);
co = cosf(rot);
che = find_vfont_char(vfd, character);
@@ -577,7 +578,7 @@ struct CharTrans *BKE_vfont_to_curve(Main *bmain, Scene *scene, Object *ob, int
short cnr = 0, lnr = 0, wsnr = 0;
wchar_t *mem, *tmp, ascii;
/* renark: do calculations including the trailing '\0' of a string
/* remark: do calculations including the trailing '\0' of a string
* because the cursor can be at that location */
if (ob->type != OB_FONT) return NULL;
@@ -704,7 +705,10 @@ makebreak:
twidth = char_width(cu, che, info);
/* Calculate positions */
if ((tb->w != 0.0f) && (ct->dobreak == 0) && ((xof - (tb->x / cu->fsize) + twidth) * cu->fsize) > tb->w + cu->xof * cu->fsize) {
if ((tb->w != 0.0f) &&
(ct->dobreak == 0) &&
(((xof - (tb->x / cu->fsize) + twidth) * cu->fsize) > tb->w + cu->xof * cu->fsize))
{
// fprintf(stderr, "linewidth exceeded: %c%c%c...\n", mem[i], mem[i+1], mem[i+2]);
for (j = i; j && (mem[j] != '\n') && (mem[j] != '\r') && (chartransdata[j].dobreak == 0); j--) {
if (mem[j] == ' ' || mem[j] == '-') {
@@ -730,6 +734,7 @@ makebreak:
}
}
}
if (ascii == '\n' || ascii == '\r' || ascii == 0 || ct->dobreak) {
ct->xof = xof;
ct->yof = yof;
@@ -799,15 +804,18 @@ makebreak:
wsfac = cu->wordspace;
wsnr++;
}
else wsfac = 1.0f;
else {
wsfac = 1.0f;
}
/* Set the width of the character */
twidth = char_width(cu, che, info);
xof += (twidth * wsfac * (1.0f + (info->kern / 40.0f)) ) + xtrax;
if (sb)
if (sb) {
sb->w = (xof * cu->fsize) - sb->w;
}
}
ct++;
}
@@ -926,11 +934,14 @@ makebreak:
else if (cu->spacemode == CU_MIDDLE) {
timeofs = (1.0f - distfac) / 2.0f;
}
else if (cu->spacemode == CU_FLUSH) distfac = 1.0f;
else if (cu->spacemode == CU_FLUSH) {
distfac = 1.0f;
}
}
else distfac = 1.0;
else {
distfac = 1.0;
}
distfac /= (maxx - minx);
timeofs += distfac * cu->xof; /* not cyclic */
@@ -959,10 +970,10 @@ makebreak:
mul_v3_fl(vec, sizefac);
ct->rot = (float)(M_PI - atan2(rotvec[1], rotvec[0]));
ct->rot = (float)M_PI - atan2f(rotvec[1], rotvec[0]);
si = (float)sin(ct->rot);
co = (float)cos(ct->rot);
si = sinf(ct->rot);
co = cosf(ct->rot);
yof = ct->yof;
@@ -1025,21 +1036,21 @@ makebreak:
f = cu->editfont->textcurs[0];
f[0] = cu->fsize * (-0.1f * co + ct->xof);
f[1] = cu->fsize * (0.1f * si + ct->yof);
f[1] = cu->fsize * ( 0.1f * si + ct->yof);
f[2] = cu->fsize * (0.1f * co + ct->xof);
f[2] = cu->fsize * ( 0.1f * co + ct->xof);
f[3] = cu->fsize * (-0.1f * si + ct->yof);
f[4] = cu->fsize * (0.1f * co + 0.8f * si + ct->xof);
f[4] = cu->fsize * ( 0.1f * co + 0.8f * si + ct->xof);
f[5] = cu->fsize * (-0.1f * si + 0.8f * co + ct->yof);
f[6] = cu->fsize * (-0.1f * co + 0.8f * si + ct->xof);
f[7] = cu->fsize * (0.1f * si + 0.8f * co + ct->yof);
f[7] = cu->fsize * ( 0.1f * si + 0.8f * co + ct->yof);
}
MEM_freeN(linedata);
MEM_freeN(linedata2);
MEM_freeN(linedata2);
MEM_freeN(linedata3);
MEM_freeN(linedata4);
@@ -1070,7 +1081,8 @@ makebreak:
float ulwidth, uloverlap = 0.0f;
if ((i < (slen - 1)) && (mem[i + 1] != '\n') && (mem[i + 1] != '\r') &&
((mem[i + 1] != ' ') || (custrinfo[i + 1].flag & CU_CHINFO_UNDERLINE)) && ((custrinfo[i + 1].flag & CU_CHINFO_WRAP) == 0))
((mem[i + 1] != ' ') || (custrinfo[i + 1].flag & CU_CHINFO_UNDERLINE)) &&
((custrinfo[i + 1].flag & CU_CHINFO_WRAP) == 0))
{
uloverlap = xtrax + 0.1f;
}

View File

@@ -8091,14 +8091,14 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
/* ************* APPEND LIBRARY ************** */
struct bheadsort {
struct BHeadSort {
BHead *bhead;
void *old;
};
static int verg_bheadsort(const void *v1, const void *v2)
{
const struct bheadsort *x1=v1, *x2=v2;
const struct BHeadSort *x1=v1, *x2=v2;
if (x1->old > x2->old) return 1;
else if (x1->old < x2->old) return -1;
@@ -8108,7 +8108,7 @@ static int verg_bheadsort(const void *v1, const void *v2)
static void sort_bhead_old_map(FileData *fd)
{
BHead *bhead;
struct bheadsort *bhs;
struct BHeadSort *bhs;
int tot = 0;
for (bhead = blo_firstbhead(fd); bhead; bhead = blo_nextbhead(fd, bhead))
@@ -8117,14 +8117,14 @@ static void sort_bhead_old_map(FileData *fd)
fd->tot_bheadmap = tot;
if (tot == 0) return;
bhs = fd->bheadmap = MEM_mallocN(tot*sizeof(struct bheadsort), "bheadsort");
bhs = fd->bheadmap = MEM_mallocN(tot*sizeof(struct BHeadSort), STRINGIFY(BHeadSort));
for (bhead = blo_firstbhead(fd); bhead; bhead = blo_nextbhead(fd, bhead), bhs++) {
bhs->bhead = bhead;
bhs->old = bhead->old;
}
qsort(fd->bheadmap, tot, sizeof(struct bheadsort), verg_bheadsort);
qsort(fd->bheadmap, tot, sizeof(struct BHeadSort), verg_bheadsort);
}
static BHead *find_previous_lib(FileData *fd, BHead *bhead)
@@ -8146,7 +8146,7 @@ static BHead *find_bhead(FileData *fd, void *old)
#if 0
BHead *bhead;
#endif
struct bheadsort *bhs, bhs_s;
struct BHeadSort *bhs, bhs_s;
if (!old)
return NULL;
@@ -8155,7 +8155,7 @@ static BHead *find_bhead(FileData *fd, void *old)
sort_bhead_old_map(fd);
bhs_s.old = old;
bhs = bsearch(&bhs_s, fd->bheadmap, fd->tot_bheadmap, sizeof(struct bheadsort), verg_bheadsort);
bhs = bsearch(&bhs_s, fd->bheadmap, fd->tot_bheadmap, sizeof(struct BHeadSort), verg_bheadsort);
if (bhs)
return bhs->bhead;

View File

@@ -84,7 +84,7 @@ typedef struct FileData {
struct OldNewMap *imamap;
struct OldNewMap *movieclipmap;
struct bheadsort *bheadmap;
struct BHeadSort *bheadmap;
int tot_bheadmap;
ListBase *mainlist;

View File

@@ -63,7 +63,7 @@ struct anim_index {
char name[1024];
int num_entries;
struct anim_index_entry * entries;
struct anim_index_entry *entries;
};
struct anim_index_builder;
@@ -77,9 +77,9 @@ typedef struct anim_index_builder {
void (*delete_priv_data)(struct anim_index_builder * idx);
void (*proc_frame)(struct anim_index_builder * idx,
unsigned char * buffer,
unsigned char *buffer,
int data_size,
struct anim_index_entry * entry);
struct anim_index_entry *entry);
} anim_index_builder;
anim_index_builder * IMB_index_builder_create(const char * name);
@@ -99,15 +99,15 @@ void IMB_index_builder_proc_frame(
void IMB_index_builder_finish(anim_index_builder * fp, int rollback);
struct anim_index * IMB_indexer_open(const char * name);
struct anim_index *IMB_indexer_open(const char * name);
unsigned long long IMB_indexer_get_seek_pos(
struct anim_index * idx, int frameno_index);
struct anim_index *idx, int frameno_index);
unsigned long long IMB_indexer_get_seek_pos_dts(
struct anim_index * idx, int frameno_index);
struct anim_index *idx, int frameno_index);
int IMB_indexer_get_frame_index(struct anim_index * idx, int frameno);
unsigned long long IMB_indexer_get_pts(struct anim_index * idx,
int frame_index);
unsigned long long IMB_indexer_get_pts(struct anim_index *idx,
int frame_index);
int IMB_indexer_get_duration(struct anim_index * idx);
int IMB_indexer_can_scan(struct anim_index * idx,
@@ -118,12 +118,12 @@ void IMB_indexer_close(struct anim_index * idx);
void IMB_free_indices(struct anim * anim);
int IMB_anim_index_get_frame_index(
struct anim * anim, IMB_Timecode_Type tc, int position);
struct anim *anim, IMB_Timecode_Type tc, int position);
struct anim * IMB_anim_open_proxy(
struct anim * anim, IMB_Proxy_Size preview_size);
struct anim *IMB_anim_open_proxy(
struct anim *anim, IMB_Proxy_Size preview_size);
struct anim_index * IMB_anim_open_index(
struct anim * anim, IMB_Timecode_Type tc);
struct anim *anim, IMB_Timecode_Type tc);
int IMB_proxy_size_to_array_index(IMB_Proxy_Size pr_size);
int IMB_timecode_to_array_index(IMB_Timecode_Type tc);

View File

@@ -200,7 +200,7 @@ static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, size_t
#define MAKESTMT(stuff) do { stuff } while (0)
#define INPUT_VARS(cinfo) \
struct jpeg_source_mgr * datasrc = (cinfo)->src; \
struct jpeg_source_mgr *datasrc = (cinfo)->src; \
const JOCTET * next_input_byte = datasrc->next_input_byte; \
size_t bytes_in_buffer = datasrc->bytes_in_buffer

View File

@@ -154,7 +154,7 @@ typedef struct Material {
struct bNodeTree *nodetree;
struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
struct Group *group; /* light group */
struct PreviewImage * preview;
struct PreviewImage *preview;
/* dynamic properties */
float friction, fh, reflect;

View File

@@ -244,7 +244,7 @@ typedef struct Tex {
struct Image *ima;
struct ColorBand *coba;
struct EnvMap *env;
struct PreviewImage * preview;
struct PreviewImage *preview;
struct PointDensity *pd;
struct VoxelData *vd;
struct OceanTex *ot;

View File

@@ -45,7 +45,7 @@ typedef struct VFont {
char name[1024]; /* 1024 = FILE_MAX */
struct VFontData *data;
struct PackedFile * packedfile;
struct PackedFile *packedfile;
} VFont;
/* *************** FONT ****************** */

View File

@@ -55,7 +55,7 @@ int testclip(const float v[3]);
void zbuffer_shadow(struct Render *re, float winmat[][4], struct LampRen *lar, int *rectz, int size, float jitx, float jity);
void zbuffer_abuf_shadow(struct Render *re, struct LampRen *lar, float winmat[][4], struct APixstr *APixbuf, struct APixstrand *apixbuf, struct ListBase *apsmbase, int size, int samples, float (*jit)[2]);
void zbuffer_solid(struct RenderPart *pa, struct RenderLayer *rl, void (*fillfunc)(struct RenderPart*, struct ZSpan*, int, void*), void *data);
void zbuffer_solid(struct RenderPart *pa, struct RenderLayer *rl, void (*fillfunc)(struct RenderPart *, struct ZSpan *, int, void*), void *data);
unsigned short *zbuffer_transp_shade(struct RenderPart *pa, struct RenderLayer *rl, float *pass, struct ListBase *psmlist);
void zbuffer_sss(RenderPart *pa, unsigned int lay, void *handle, void (*func)(void*, int, int, int, int, int));

View File

@@ -83,7 +83,7 @@ public:
bool SetActiveAction(class BL_ActionActuator *act, short priority, double curtime);
struct bArmature * GetArmature() { return m_armature; }
struct bArmature *GetArmature() { return m_armature; }
const struct bArmature * GetArmature() const { return m_armature; }
const struct Scene * GetScene() const { return m_scene; }