style cleanup

This commit is contained in:
2012-10-20 18:46:57 +00:00
parent 3da4b08110
commit bc8f602601
24 changed files with 69 additions and 78 deletions

View File

@@ -1015,7 +1015,7 @@ bool rcBuildPolyMeshDetail(rcContext* ctx, const rcPolyMesh& mesh, const rcCompa
maxhh = rcMax(maxhh, ymax-ymin);
}
hp.data = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxhw*maxhh, RC_ALLOC_TEMP);
hp.data = (unsigned short *)rcAlloc(sizeof(unsigned short)*maxhw*maxhh, RC_ALLOC_TEMP);
if (!hp.data)
{
ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'hp.data' (%d).", maxhw*maxhh);

View File

@@ -385,7 +385,7 @@ static void lms_to_xyz(double l, double m, double s, double* x, double *y, doubl
*z = s;
}
void spectrum(double t1, double t2, int N, unsigned char* d)
void spectrum(double t1, double t2, int N, unsigned char *d)
{
int i,j,dj;
double X,Y,Z,R,G,B,L,M,S, Lw, Mw, Sw;

View File

@@ -1,6 +1,6 @@
#ifndef __SPECTRUM_H
#define __SPECTRUM_H
void spectrum(double t1, double t2, int n, unsigned char* d);
void spectrum(double t1, double t2, int n, unsigned char *d);
#endif

View File

@@ -382,7 +382,7 @@ HRESULT __stdcall VF_ReadDataFunc_Blen(
my_gets(s_in, buf, 256); /* 255 */
framebuf = (unsigned char*) v->lpData;
framebuf = (unsigned char *) v->lpData;
for (y = 0; y < height; y++) {
unsigned char *p = framebuf + v->lPitch * y;

View File

@@ -973,8 +973,8 @@ static void *distribute_threads_exec_cb(void *data)
static int *COMPARE_ORIG_INDEX = NULL;
static int distribute_compare_orig_index(const void *p1, const void *p2)
{
int index1 = COMPARE_ORIG_INDEX[*(const int*)p1];
int index2 = COMPARE_ORIG_INDEX[*(const int*)p2];
int index1 = COMPARE_ORIG_INDEX[*(const int *)p1];
int index2 = COMPARE_ORIG_INDEX[*(const int *)p2];
if (index1 < index2)
return -1;

View File

@@ -705,25 +705,25 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
smoke_export(sds->fluid, &dt, &dx, &dens, &react, &flame, &fuel, &heat, &heatold, &vx, &vy, &vz, &r, &g, &b, &obstacles);
ptcache_file_compressed_read(pf, (unsigned char *)sds->shadow, out_len);
ptcache_file_compressed_read(pf, (unsigned char*)dens, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)dens, out_len);
if (cache_fields & SM_ACTIVE_HEAT) {
ptcache_file_compressed_read(pf, (unsigned char*)heat, out_len);
ptcache_file_compressed_read(pf, (unsigned char*)heatold, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)heat, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)heatold, out_len);
}
if (cache_fields & SM_ACTIVE_FIRE) {
ptcache_file_compressed_read(pf, (unsigned char*)flame, out_len);
ptcache_file_compressed_read(pf, (unsigned char*)fuel, out_len);
ptcache_file_compressed_read(pf, (unsigned char*)react, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)flame, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)fuel, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)react, out_len);
}
if (cache_fields & SM_ACTIVE_COLORS) {
ptcache_file_compressed_read(pf, (unsigned char*)r, out_len);
ptcache_file_compressed_read(pf, (unsigned char*)g, out_len);
ptcache_file_compressed_read(pf, (unsigned char*)b, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)r, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)g, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)b, out_len);
}
ptcache_file_compressed_read(pf, (unsigned char*)vx, out_len);
ptcache_file_compressed_read(pf, (unsigned char*)vy, out_len);
ptcache_file_compressed_read(pf, (unsigned char*)vz, out_len);
ptcache_file_compressed_read(pf, (unsigned char*)obstacles, (unsigned int)res);
ptcache_file_compressed_read(pf, (unsigned char *)vx, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)vy, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)vz, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)obstacles, (unsigned int)res);
ptcache_file_read(pf, &dt, 1, sizeof(float));
ptcache_file_read(pf, &dx, 1, sizeof(float));
ptcache_file_read(pf, &sds->p0, 3, sizeof(float));
@@ -751,20 +751,20 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
smoke_turbulence_export(sds->wt, &dens, &react, &flame, &fuel, &r, &g, &b, &tcu, &tcv, &tcw);
ptcache_file_compressed_read(pf, (unsigned char*)dens, out_len_big);
ptcache_file_compressed_read(pf, (unsigned char *)dens, out_len_big);
if (cache_fields & SM_ACTIVE_FIRE) {
ptcache_file_compressed_read(pf, (unsigned char*)flame, out_len_big);
ptcache_file_compressed_read(pf, (unsigned char*)fuel, out_len_big);
ptcache_file_compressed_read(pf, (unsigned char *)flame, out_len_big);
ptcache_file_compressed_read(pf, (unsigned char *)fuel, out_len_big);
}
if (cache_fields & SM_ACTIVE_COLORS) {
ptcache_file_compressed_read(pf, (unsigned char*)r, out_len_big);
ptcache_file_compressed_read(pf, (unsigned char*)g, out_len_big);
ptcache_file_compressed_read(pf, (unsigned char*)b, out_len_big);
ptcache_file_compressed_read(pf, (unsigned char *)r, out_len_big);
ptcache_file_compressed_read(pf, (unsigned char *)g, out_len_big);
ptcache_file_compressed_read(pf, (unsigned char *)b, out_len_big);
}
ptcache_file_compressed_read(pf, (unsigned char*)tcu, out_len);
ptcache_file_compressed_read(pf, (unsigned char*)tcv, out_len);
ptcache_file_compressed_read(pf, (unsigned char*)tcw, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)tcu, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)tcv, out_len);
ptcache_file_compressed_read(pf, (unsigned char *)tcw, out_len);
}
return 1;
@@ -859,7 +859,7 @@ static int ptcache_dynamicpaint_read(PTCacheFile *pf, void *dp_v)
return 0;
}
ptcache_file_compressed_read(pf, (unsigned char*)surface->data->type_data, data_len*surface->data->total_points);
ptcache_file_compressed_read(pf, (unsigned char *)surface->data->type_data, data_len*surface->data->total_points);
}
return 1;
@@ -1699,7 +1699,7 @@ static PTCacheMem *ptcache_disk_frame_to_mem(PTCacheID *pid, int cfra)
for (i=0; i<BPHYS_TOT_DATA; i++) {
unsigned int out_len = pm->totpoint*ptcache_data_size[i];
if (pf->data_types & (1<<i))
ptcache_file_compressed_read(pf, (unsigned char*)(pm->data[i]), out_len);
ptcache_file_compressed_read(pf, (unsigned char *)(pm->data[i]), out_len);
}
}
else {
@@ -1730,7 +1730,7 @@ static PTCacheMem *ptcache_disk_frame_to_mem(PTCacheID *pid, int cfra)
extra->data = MEM_callocN(extra->totdata * ptcache_extra_datasize[extra->type], "Pointcache extradata->data");
if (pf->flag & PTCACHE_TYPEFLAG_COMPRESS)
ptcache_file_compressed_read(pf, (unsigned char*)(extra->data), extra->totdata*ptcache_extra_datasize[extra->type]);
ptcache_file_compressed_read(pf, (unsigned char *)(extra->data), extra->totdata*ptcache_extra_datasize[extra->type]);
else
ptcache_file_read(pf, extra->data, extra->totdata, ptcache_extra_datasize[extra->type]);
@@ -1787,7 +1787,7 @@ static int ptcache_mem_frame_to_disk(PTCacheID *pid, PTCacheMem *pm)
if (pm->data[i]) {
unsigned int in_len = pm->totpoint*ptcache_data_size[i];
unsigned char *out = (unsigned char *)MEM_callocN(LZO_OUT_LEN(in_len)*4, "pointcache_lzo_buffer");
ptcache_file_compressed_write(pf, (unsigned char*)(pm->data[i]), in_len, out, pid->cache->compression);
ptcache_file_compressed_write(pf, (unsigned char *)(pm->data[i]), in_len, out, pid->cache->compression);
MEM_freeN(out);
}
}
@@ -1820,7 +1820,7 @@ static int ptcache_mem_frame_to_disk(PTCacheID *pid, PTCacheMem *pm)
if (pid->cache->compression) {
unsigned int in_len = extra->totdata * ptcache_extra_datasize[extra->type];
unsigned char *out = (unsigned char *)MEM_callocN(LZO_OUT_LEN(in_len)*4, "pointcache_lzo_buffer");
ptcache_file_compressed_write(pf, (unsigned char*)(extra->data), in_len, out, pid->cache->compression);
ptcache_file_compressed_write(pf, (unsigned char *)(extra->data), in_len, out, pid->cache->compression);
MEM_freeN(out);
}
else {

View File

@@ -62,14 +62,14 @@ static void slice_get_byte_buffers(const SeqRenderData *context, const ImBuf *ib
{
int offset = 4 * start_line * context->rectx;
*rect1 = (unsigned char*) ibuf1->rect + offset;
*rect_out = (unsigned char*) out->rect + offset;
*rect1 = (unsigned char *)ibuf1->rect + offset;
*rect_out = (unsigned char *)out->rect + offset;
if (ibuf2)
*rect2 = (unsigned char*) ibuf2->rect + offset;
*rect2 = (unsigned char *)ibuf2->rect + offset;
if (ibuf3)
*rect3 = (unsigned char*) ibuf3->rect + offset;
*rect3 = (unsigned char *)ibuf3->rect + offset;
}
static void slice_get_float_buffers(const SeqRenderData *context, const ImBuf *ibuf1, const ImBuf *ibuf2,

View File

@@ -103,7 +103,7 @@ void BLI_scanfill_end(ScanFillContext *sf_ctx);
/* These callbacks are needed to make the lib finction properly */
/**
* Set a function taking a char* as argument to flag errors. If the
* Set a function taking a (char *) as argument to flag errors. If the
* callback is not set, the error is discarded.
* \param f The function to use as callback
* \attention used in creator.c

View File

@@ -521,13 +521,13 @@ int BLI_vfontchar_from_freetypefont(VFont *vfont, unsigned long character)
// Freetype2 Outline struct
typedef struct FT_Outline_
{
{
short n_contours; /* number of contours in glyph */
short n_points; /* number of points in the glyph */
FT_Vector* points; /* the outline's points */
char* tags; /* the points flags */
short* contours; /* the contour end points */
FT_Vector *points; /* the outline's points */
char *tags; /* the points flags */
short *contours; /* the contour end points */
int flags; /* outline masks */
} FT_Outline;

View File

@@ -818,7 +818,7 @@ static void decode_blender_header(FileData *fd)
/* is the file saved in a different endian
* than we need ?
*/
if (((((char*)&remove_this_endian_test)[0]==1)?L_ENDIAN:B_ENDIAN) != ((header[8]=='v')?L_ENDIAN:B_ENDIAN)) {
if (((((char *)&remove_this_endian_test)[0] == 1) ? L_ENDIAN : B_ENDIAN) != ((header[8] == 'v') ? L_ENDIAN : B_ENDIAN)) {
fd->flags |= FD_FLAGS_SWITCH_ENDIAN;
}
@@ -940,7 +940,7 @@ static int fd_read_from_memfile(FileData *filedata, void *buffer, unsigned int s
if (chunkoffset+readsize > chunk->size)
readsize= chunk->size-chunkoffset;
memcpy((char*)buffer + totread, chunk->buf + chunkoffset, readsize);
memcpy((char *)buffer + totread, chunk->buf + chunkoffset, readsize);
totread += readsize;
filedata->seek += readsize;
seek += readsize;

View File

@@ -1237,7 +1237,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
TFace *tf = &((TFace*) me->tface)[i];
for (j = 0; j < 4; j++) {
char *col = (char*) &tf->col[j];
char *col = (char *) &tf->col[j];
col[0] = 255;
}

View File

@@ -1241,7 +1241,7 @@ static void write_constraints(WriteData *wd, ListBase *conlist)
break;
case CONSTRAINT_TYPE_SPLINEIK:
{
bSplineIKConstraint *data= (bSplineIKConstraint*)con->data;
bSplineIKConstraint *data = (bSplineIKConstraint *)con->data;
/* write points array */
writedata(wd, DATA, sizeof(float)*(data->numpoints), data->points);

View File

@@ -401,8 +401,8 @@ static void bm_edge_collapse_loop_customdata(BMesh *bm, BMLoop *l, BMVert *v_cle
/* ok. we have a loop. now be smart with it! */
for (i = 0; i < bm->ldata.totlayer; i++) {
if (CustomData_layer_has_math(&bm->ldata, i)) {
int offset = bm->ldata.layers[i].offset;
int type = bm->ldata.layers[i].type;
const int offset = bm->ldata.layers[i].offset;
const int type = bm->ldata.layers[i].type;
void *cd_src, *cd_iter;
/* todo, make nicer macros for this */
@@ -423,14 +423,6 @@ static void bm_edge_collapse_loop_customdata(BMesh *bm, BMLoop *l, BMVert *v_cle
}
}
}
/* first walk around the fan until we hit a seam */
/* last, interpolate ourselves */
}
#endif /* USE_CUSTOMDATA */
@@ -661,7 +653,6 @@ static void bm_decim_edge_collapse(BMesh *bm, BMEdge *e,
bm_decim_build_edge_cost_single(e_iter, vquadrics, eheap, eheap_table);
} while ((e_iter = bmesh_disk_edge_next(e_iter, v)) != e_first);
}
}
}

View File

@@ -169,7 +169,7 @@ public:
int setAnimType ( const COLLADAFW::Animatable * prop, int type, int addition);
void modify_fcurve(std::vector<FCurve*>* curves, const char* rna_path, int array_index );
void modify_fcurve(std::vector<FCurve*>* curves, const char *rna_path, int array_index );
void unused_fcurve(std::vector<FCurve*>* curves );
// prerequisites:
// animlist_map - map animlist id -> animlist

View File

@@ -40,7 +40,7 @@ class DocumentExporter
public:
DocumentExporter(const ExportSettings *export_settings);
void exportCurrentScene(Scene *sce);
void exportScenes(const char* filename);
void exportScenes(const char *filename);
private:
const ExportSettings *export_settings;
};

View File

@@ -212,7 +212,7 @@ static NSString *stringWithCodecType(int codecType)
{
char str[5];
*((int*)str) = EndianU32_NtoB(codecType);
*((int *)str) = EndianU32_NtoB(codecType);
str[4] = 0;
return [NSString stringWithCString:str encoding:NSASCIIStringEncoding];
@@ -624,8 +624,8 @@ int append_qt(struct RenderData *rd, int start_frame, int frame, int *pixels, in
return 0;
}
from_Ptr = (unsigned char*)pixels;
to_Ptr = (unsigned char*)[blBitmapFormatImage bitmapData];
from_Ptr = (unsigned char *)pixels;
to_Ptr = (unsigned char *)[blBitmapFormatImage bitmapData];
for (y = 0; y < recty; y++) {
to_i = (recty-y-1)*rectx;
from_i = y*rectx;

View File

@@ -172,8 +172,8 @@ static ImBuf * nsImageToiBuf(NSImage *sourceImage, int width, int height)
if (([bitmapImage bitsPerPixel] == 32) && (([bitmapImage bitmapFormat] & 0x5) == 0)
&& ![bitmapImage isPlanar]) {
/* Try a fast copy if the image is a meshed RGBA 32bit bitmap*/
toIBuf = (uchar*)ibuf->rect;
rasterRGB = (uchar*)[bitmapImage bitmapData];
toIBuf = (uchar *)ibuf->rect;
rasterRGB = (uchar *)[bitmapImage bitmapData];
for (y = 0; y < height; y++) {
to_i = (height-y-1)*width;
from_i = y*width;
@@ -207,7 +207,7 @@ static ImBuf * nsImageToiBuf(NSImage *sourceImage, int width, int height)
[bitmapImage draw];
[NSGraphicsContext restoreGraphicsState];
rasterRGB = (uchar*)[blBitmapFormatImageRGB bitmapData];
rasterRGB = (uchar *)[blBitmapFormatImageRGB bitmapData];
if (rasterRGB == NULL) {
[blBitmapFormatImageRGB release];
return NULL;
@@ -228,7 +228,7 @@ static ImBuf * nsImageToiBuf(NSImage *sourceImage, int width, int height)
[bitmapImage draw];
[NSGraphicsContext restoreGraphicsState];
rasterRGBA = (uchar*)[blBitmapFormatImageRGBA bitmapData];
rasterRGBA = (uchar *)[blBitmapFormatImageRGBA bitmapData];
if (rasterRGBA == NULL) {
[blBitmapFormatImageRGB release];
[blBitmapFormatImageRGBA release];
@@ -236,7 +236,7 @@ static ImBuf * nsImageToiBuf(NSImage *sourceImage, int width, int height)
}
/*Copy the image to ibuf, flipping it vertically*/
toIBuf = (uchar*)ibuf->rect;
toIBuf = (uchar *)ibuf->rect;
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
to_i = (height-y-1)*width + x;
@@ -486,7 +486,7 @@ ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags)
[bitmapImage draw];
[NSGraphicsContext restoreGraphicsState];
rasterRGB = (uchar*)[blBitmapFormatImageRGB bitmapData];
rasterRGB = (uchar *)[blBitmapFormatImageRGB bitmapData];
if (rasterRGB == NULL) {
[bitmapImage release];
[blBitmapFormatImageRGB release];
@@ -509,7 +509,7 @@ ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags)
[bitmapImage draw];
[NSGraphicsContext restoreGraphicsState];
rasterRGBA = (uchar*)[blBitmapFormatImageRGBA bitmapData];
rasterRGBA = (uchar *)[blBitmapFormatImageRGBA bitmapData];
if (rasterRGBA == NULL) {
[bitmapImage release];
[blBitmapFormatImageRGB release];
@@ -519,7 +519,7 @@ ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags)
}
/*Copy the image to ibuf, flipping it vertically*/
toIBuf = (uchar*)ibuf->rect;
toIBuf = (uchar *)ibuf->rect;
for (x = 0; x < bitmapSize.width; x++) {
for (y = 0; y < bitmapSize.height; y++) {
to_i = (bitmapSize.height-y-1)*bitmapSize.width + x;

View File

@@ -235,7 +235,7 @@ void RE_MergeFullSample(struct Render *re, struct Main *bmain, struct Scene *sce
/* ancient stars function... go away! */
void RE_make_stars(struct Render *re, struct Scene *scenev3d, void (*initfunc)(void),
void (*vertexfunc)(float*), void (*termfunc)(void));
void (*vertexfunc)(float *), void (*termfunc)(void));
/* display and event callbacks */
void RE_display_init_cb (struct Render *re, void *handle, void (*f)(void *handle, RenderResult *rr));

View File

@@ -156,7 +156,7 @@ static HaloRen *initstar(Render *re, ObjectRen *obr, const float vec[3], float h
*/
void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
void (*vertexfunc)(float*), void (*termfunc)(void))
void (*vertexfunc)(float*), void (*termfunc)(void))
{
extern unsigned char hash[512];
ObjectRen *obr= NULL;
@@ -5336,7 +5336,7 @@ static float *calculate_strandsurface_speedvectors(Render *re, ObjectInstanceRen
calculate_speedvector(vec, 1, winsq, winroot, mesh->co[a], ho, winspeed[a]);
}
return (float*)winspeed;
return (float *)winspeed;
}
return NULL;

View File

@@ -693,7 +693,7 @@ static int ibuf_get_color_clip(float col[4], ImBuf *ibuf, int x, int y, int extf
}
}
else {
char* rect = (char*)(ibuf->rect + x + y*ibuf->x);
char *rect = (char *)(ibuf->rect + x + y*ibuf->x);
col[0] = rect[0]*(1.f/255.f);
col[1] = rect[1]*(1.f/255.f);
col[2] = rect[2]*(1.f/255.f);

View File

@@ -46,7 +46,7 @@ m_frame_rect(rect)
m_area_left = ar->winrct.xmin;
m_area_top = ar->winrct.ymax;
glGetIntegerv(GL_VIEWPORT, (GLint*)m_viewport);
glGetIntegerv(GL_VIEWPORT, (GLint *)m_viewport);
}
KX_BlenderCanvas::~KX_BlenderCanvas()

View File

@@ -58,7 +58,7 @@ unsigned int KX_BlenderRenderTools::m_numgllights;
KX_BlenderRenderTools::KX_BlenderRenderTools()
{
glGetIntegerv(GL_MAX_LIGHTS, (GLint*) &m_numgllights);
glGetIntegerv(GL_MAX_LIGHTS, (GLint *) &m_numgllights);
if (m_numgllights < 8)
m_numgllights = 8;
}

View File

@@ -249,7 +249,7 @@ bool KX_NavMeshObject::BuildVertIndArrays(float *&vertices, int& nverts,
}
//create tris
polys = (unsigned short*)MEM_callocN(sizeof(unsigned short)*3*2*npolys, "BuildVertIndArrays polys");
polys = (unsigned short *)MEM_callocN(sizeof(unsigned short)*3*2*npolys, "BuildVertIndArrays polys");
memset(polys, 0xff, sizeof(unsigned short)*3*2*npolys);
unsigned short *poly = polys;
RAS_Polygon* raspoly;

View File

@@ -1078,7 +1078,7 @@ static bool GetHitTriangle(btCollisionShape* shape, CcdShapeConstructionInfo* sh
const btVector3& meshScaling = shape->getLocalScaling();
for (int j=2;j>=0;j--)
{
int graphicsindex = indicestype==PHY_SHORT?((unsigned short*)gfxbase)[j]:gfxbase[j];
int graphicsindex = (indicestype == PHY_SHORT) ? ((unsigned short *)gfxbase)[j] : gfxbase[j];
btScalar* graphicsbase = (btScalar*)(vertexbase+graphicsindex*stride);