style cleanup

This commit is contained in:
2012-11-01 09:54:00 +00:00
parent bd574fe2a2
commit f213ae0b19
31 changed files with 69 additions and 70 deletions

View File

@@ -304,7 +304,7 @@ void BKE_object_free(Object *ob)
if (ob->data) {
ID *id = ob->data;
id->us--;
if (id->us == 0 && id->lib==NULL) {
if (id->us == 0 && id->lib == NULL) {
switch (ob->type) {
case OB_MESH:
BKE_mesh_unlink((Mesh *)id);

View File

@@ -259,7 +259,7 @@ static struct bUnitCollection buNaturalTimeCollecton = {buNaturalTimeDef, 3, 0,
static struct bUnitDef buNaturalRotDef[] = {
{"degree", "degrees", "°", NULL, "Degrees", M_PI/180.0, 0.0, B_UNIT_DEF_NONE},
{"degree", "degrees", "°", NULL, "Degrees", M_PI / 180.0, 0.0, B_UNIT_DEF_NONE},
// {"radian", "radians", "r", NULL, "Radians", 1.0, 0.0, B_UNIT_DEF_NONE},
// {"turn", "turns", "t", NULL, "Turns", 1.0/(M_PI*2.0), 0.0,B_UNIT_DEF_NONE},
{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}

View File

@@ -1104,7 +1104,9 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, unsigned int
if (!tree_overlap(tree1->nodes[tree1->totleaf], tree2->nodes[tree2->totleaf],
min_axis(tree1->start_axis, tree2->start_axis),
min_axis(tree1->stop_axis, tree2->stop_axis)))
{
return NULL;
}
data = MEM_callocN(sizeof(BVHOverlapData *) * tree1->tree_type, "BVHOverlapData_star");

View File

@@ -301,8 +301,8 @@ static float newPerlin(float x, float y, float z)
u = npfade(x); /* COMPUTE FADE CURVES */
v = npfade(y); /* FOR EACH OF X,Y,Z. */
w = npfade(z);
A = hash[X ]+Y; AA = hash[A]+Z; AB = hash[A+1]+Z; /* HASH COORDINATES OF */
B = hash[X+1]+Y; BA = hash[B]+Z; BB = hash[B+1]+Z; /* THE 8 CUBE CORNERS, */
A = hash[X ] + Y; AA = hash[A] + Z; AB = hash[A + 1] + Z; /* HASH COORDINATES OF */
B = hash[X + 1] + Y; BA = hash[B] + Z; BB = hash[B + 1] + Z; /* THE 8 CUBE CORNERS, */
return lerp(w, lerp(v, lerp(u, grad(hash[AA ], x, y, z ), /* AND ADD */
grad(hash[BA ], x - 1, y, z )), /* BLENDED */
lerp(u, grad(hash[AB ], x, y - 1, z ), /* RESULTS */

View File

@@ -20,7 +20,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/bmesh/operators/bmo_select_similar.c
/** \file blender/bmesh/operators/bmo_similar.c
* \ingroup bmesh
*
* bmesh operators to select based on

View File

@@ -204,7 +204,8 @@ static void init_laplacian_matrix(LaplacianSystem * sys)
sys->eweights[i] = w1;
sys->vlengths[idv1] += w1;
sys->vlengths[idv2] += w1;
}else{
}
else {
sys->zerola[idv1] = 1;
sys->zerola[idv2] = 1;
}
@@ -568,16 +569,16 @@ void bmo_smooth_laplacian_vert_exec(BMesh *bm, BMOperator *op)
nlSolverParameteri(NL_NB_ROWS, bm->totvert);
nlSolverParameteri(NL_NB_RIGHT_HAND_SIDES, 3);
nlBegin(NL_SYSTEM);
for (i=0; i < bm->totvert; i++) {
nlBegin(NL_SYSTEM);
for (i = 0; i < bm->totvert; i++) {
nlLockVariable(i);
}
BMO_ITER (v, &siter, bm, op, "verts", BM_VERT) {
m_vertex_id = BM_elem_index_get(v);
nlUnlockVariable(m_vertex_id);
nlSetVariable(0,m_vertex_id, v->co[0]);
nlSetVariable(1,m_vertex_id, v->co[1]);
nlSetVariable(2,m_vertex_id, v->co[2]);
nlSetVariable(0, m_vertex_id, v->co[0]);
nlSetVariable(1, m_vertex_id, v->co[1]);
nlSetVariable(2, m_vertex_id, v->co[2]);
}
nlBegin(NL_MATRIX);

View File

@@ -160,7 +160,7 @@ void MemoryBuffer::writePixel(int x, int y, const float color[4])
if (x >= this->m_rect.xmin && x < this->m_rect.xmax &&
y >= this->m_rect.ymin && y < this->m_rect.ymax)
{
const int offset = (this->m_chunkWidth * (y-this->m_rect.ymin) + x-this->m_rect.xmin) * COM_NUMBER_OF_CHANNELS;
const int offset = (this->m_chunkWidth * (y - this->m_rect.ymin) + x - this->m_rect.xmin) * COM_NUMBER_OF_CHANNELS;
copy_v4_v4(&this->m_buffer[offset], color);
}
}
@@ -170,7 +170,7 @@ void MemoryBuffer::addPixel(int x, int y, const float color[4])
if (x >= this->m_rect.xmin && x < this->m_rect.xmax &&
y >= this->m_rect.ymin && y < this->m_rect.ymax)
{
const int offset = (this->m_chunkWidth * (y-this->m_rect.ymin) + x-this->m_rect.xmin) * COM_NUMBER_OF_CHANNELS;
const int offset = (this->m_chunkWidth * (y - this->m_rect.ymin) + x - this->m_rect.xmin) * COM_NUMBER_OF_CHANNELS;
add_v4_v4(&this->m_buffer[offset], color);
}
}

View File

@@ -163,7 +163,10 @@ public:
* @param clMemToCleanUp all created cl_mem references must be added to this list. Framework will clean this after execution
* @param clKernelsToCleanUp all created cl_kernel references must be added to this list. Framework will clean this after execution
*/
virtual void executeOpenCL(OpenCLDevice *device, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp) {}
virtual void executeOpenCL(OpenCLDevice *device,
MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer,
MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp,
list<cl_kernel> *clKernelsToCleanUp) {}
virtual void deinitExecution();
bool isResolutionSet() {

View File

@@ -106,13 +106,11 @@ void **g_highlightedNodesRead;
void COM_startReadHighlights()
{
if (!g_highlightInitialized)
{
if (!g_highlightInitialized) {
return;
}
if (g_highlightedNodesRead)
{
if (g_highlightedNodesRead) {
MEM_freeN(g_highlightedNodesRead);
}

View File

@@ -52,8 +52,7 @@ void ViewerNode::convertToOperations(ExecutionSystem *graph, CompositorContext *
viewerOperation->setDisplaySettings(context->getDisplaySettings());
viewerOperation->setResolutionInputSocketIndex(0);
if (!imageSocket->isConnected())
{
if (!imageSocket->isConnected()) {
if (alphaSocket->isConnected()) {
viewerOperation->setResolutionInputSocketIndex(1);
}

View File

@@ -59,6 +59,9 @@ public:
void setSize(float size) { this->m_size = size; this->m_sizeavailable = true; }
void executeOpenCL(OpenCLDevice *device, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp);
void executeOpenCL(OpenCLDevice *device,
MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer,
MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp,
list<cl_kernel> *clKernelsToCleanUp);
};
#endif

View File

@@ -236,7 +236,7 @@ void GaussianBlurReferenceOperation::initExecution()
/* horizontal */
m_radx = (float)this->m_data->sizex;
int imgx = getWidth()/2;
int imgx = getWidth() / 2;
if (m_radx > imgx)
m_radx = imgx;
else if (m_radx < 1)
@@ -245,7 +245,7 @@ void GaussianBlurReferenceOperation::initExecution()
/* vertical */
m_rady = (float)this->m_data->sizey;
int imgy = getHeight()/2;
int imgy = getHeight() / 2;
if (m_rady > imgy)
m_rady = imgy;
else if (m_rady < 1)
@@ -344,8 +344,8 @@ bool GaussianBlurReferenceOperation::determineDependingAreaOfInterest(rcti *inpu
return true;
}
else {
int addx = this->m_data->sizex+2;
int addy = this->m_data->sizey+2;
int addx = this->m_data->sizex + 2;
int addy = this->m_data->sizey + 2;
newInput.xmax = input->xmax + addx;
newInput.xmin = input->xmin - addx;
newInput.ymax = input->ymax + addy;

View File

@@ -33,8 +33,7 @@ vector<DistortionCache *> s_cache;
void deintializeDistortionCache(void)
{
while (s_cache.size()>0)
{
while (s_cache.size() > 0) {
DistortionCache * cache = s_cache.back();
s_cache.pop_back();
delete cache;
@@ -61,8 +60,7 @@ void MovieDistortionOperation::initExecution()
BKE_movieclip_user_set_frame(&clipUser, this->m_framenumber);
BKE_movieclip_get_size(this->m_movieClip, &clipUser, &calibration_width, &calibration_height);
for (unsigned int i = 0; i < s_cache.size(); i++)
{
for (unsigned int i = 0; i < s_cache.size(); i++) {
DistortionCache *c = (DistortionCache *)s_cache[i];
if (c->isCacheFor(this->m_movieClip, this->m_width, this->m_height,
calibration_width, calibration_height, this->m_distortion))
@@ -86,15 +84,12 @@ void MovieDistortionOperation::deinitExecution()
{
this->m_inputOperation = NULL;
this->m_movieClip = NULL;
while (s_cache.size() > COM_DISTORTIONCACHE_MAXSIZE)
{
while (s_cache.size() > COM_DISTORTIONCACHE_MAXSIZE) {
double minTime = PIL_check_seconds_timer();
vector<DistortionCache*>::iterator minTimeIterator = s_cache.begin();
for (vector<DistortionCache*>::iterator it = s_cache.begin(); it < s_cache.end(); it ++)
{
for (vector<DistortionCache*>::iterator it = s_cache.begin(); it < s_cache.end(); it ++) {
DistortionCache * cache = *it;
if (cache->getTimeLastUsage()<minTime)
{
if (cache->getTimeLastUsage() < minTime) {
minTime = cache->getTimeLastUsage();
minTimeIterator = it;
}

View File

@@ -81,7 +81,7 @@ bool ProjectorLensDistortionOperation::determineDependingAreaOfInterest(rcti *in
}
else {
rcti dispInput;
BLI_rcti_init(&dispInput, 0,5,0,5);
BLI_rcti_init(&dispInput, 0, 5, 0, 5);
if (this->getInputOperation(1)->determineDependingAreaOfInterest(&dispInput, readOperation, output)) {
return true;
}

View File

@@ -118,7 +118,7 @@ void VariableSizeBokehBlurOperation::executePixel(float output[4], int x, int y,
#ifdef COM_DEFOCUS_SEARCH
float search[4];
this->m_inputSearchProgram->read(search, x/InverseSearchRadiusOperation::DIVIDER, y / InverseSearchRadiusOperation::DIVIDER, NULL);
this->m_inputSearchProgram->read(search, x / InverseSearchRadiusOperation::DIVIDER, y / InverseSearchRadiusOperation::DIVIDER, NULL);
int minx = search[0];
int miny = search[1];
int maxx = search[2];
@@ -298,9 +298,9 @@ voi *InverseSearchRadiusOperation::initializeTileData(rcti *rect)
int rx = x * DIVIDER;
int ry = y * DIVIDER;
buffer[offset] = MAX2(rx - m_maxBlur, 0);
buffer[offset+1] = MAX2(ry- m_maxBlur, 0);
buffer[offset+2] = MIN2(rx+DIVIDER + m_maxBlur, width);
buffer[offset+3] = MIN2(ry+DIVIDER + m_maxBlur, height);
buffer[offset + 1] = MAX2(ry - m_maxBlur, 0);
buffer[offset + 2] = MIN2(rx + DIVIDER + m_maxBlur, width);
buffer[offset + 3] = MIN2(ry + DIVIDER + m_maxBlur, height);
offset += 4;
}
}

View File

@@ -79,8 +79,7 @@ void ViewerBaseOperation::initImage()
BLI_unlock_thread(LOCK_DRAW_IMAGE);
}
if (m_doDepthBuffer)
{
if (m_doDepthBuffer) {
addzbuffloatImBuf(ibuf);
}
BLI_unlock_thread(LOCK_DRAW_IMAGE);
@@ -96,8 +95,7 @@ void ViewerBaseOperation::initImage()
*/
this->m_ibuf = ibuf;
if (m_doDepthBuffer)
{
if (m_doDepthBuffer) {
this->m_depthBuffer = ibuf->zbuf_float;
}

View File

@@ -110,7 +110,8 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int tileNumber)
memoryBuffer->setCreatedState();
}
void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice *device, rcti *rect, unsigned int chunkNumber, MemoryBuffer **inputMemoryBuffers, MemoryBuffer *outputBuffer)
void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice *device, rcti *rect, unsigned int chunkNumber,
MemoryBuffer **inputMemoryBuffers, MemoryBuffer *outputBuffer)
{
float *outputFloatBuffer = outputBuffer->getBuffer();
cl_int error;

View File

@@ -4933,8 +4933,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
if (but->flag & UI_BUT_DISABLED)
return WM_UI_HANDLER_CONTINUE;
if ((data->state == BUTTON_STATE_HIGHLIGHT) || (event->type == EVT_DROP))
{
if ((data->state == BUTTON_STATE_HIGHLIGHT) || (event->type == EVT_DROP)) {
/* handle copy-paste */
if (ELEM(event->type, CKEY, VKEY) && event->val == KM_PRESS && (event->ctrl || event->oskey)) {
@@ -6325,11 +6324,11 @@ static int ui_menu_scroll(ARegion *ar, uiBlock *block, int my, uiBut *to_bt)
if (to_bt) {
/* scroll to activated button */
if (block->flag & UI_BLOCK_CLIPTOP) {
if(to_bt->rect.ymax > block->rect.ymax - UI_MENU_SCROLL_ARROW)
if (to_bt->rect.ymax > block->rect.ymax - UI_MENU_SCROLL_ARROW)
dy = block->rect.ymax - to_bt->rect.ymax - UI_MENU_SCROLL_ARROW;
}
if (block->flag & UI_BLOCK_CLIPBOTTOM) {
if(to_bt->rect.ymin < block->rect.ymin + UI_MENU_SCROLL_ARROW)
if (to_bt->rect.ymin < block->rect.ymin + UI_MENU_SCROLL_ARROW)
dy = block->rect.ymin - to_bt->rect.ymin + UI_MENU_SCROLL_ARROW;
}
}

View File

@@ -2668,7 +2668,7 @@ static void widget_menubut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state),
widgetbase_draw(&wtb, wcol);
/* text space, arrows are about 0.6 height of button */
rect->xmax -= (6*BLI_rcti_size_y(rect))/10;
rect->xmax -= (6 * BLI_rcti_size_y(rect)) / 10;
}
static void widget_menuiconbut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign)

View File

@@ -479,7 +479,7 @@ static void draw_spline_curve(const bContext *C, MaskLayer *masklay, MaskSpline
(void)draw_type;
}
static void draw_masklays(const bContext *C, Mask *mask, const char draw_flag,const char draw_type,
static void draw_masklays(const bContext *C, Mask *mask, const char draw_flag, const char draw_type,
int width, int height)
{
MaskLayer *masklay;

View File

@@ -1218,11 +1218,11 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
hmargin = 0.1 * (x2 - x1);
vmargin = 0.05 * (y2 - y1);
uiDrawBox(GL_LINE_LOOP, x1+hmargin, y1+vmargin, x2-hmargin, y2-vmargin, 2.0);
uiDrawBox(GL_LINE_LOOP, x1 + hmargin, y1+vmargin, x2 - hmargin, y2 - vmargin, 2.0);
hmargin = 0.035 * (x2 - x1);
vmargin = 0.035 * (y2 - y1);
uiDrawBox(GL_LINE_LOOP, x1+hmargin, y1+vmargin, x2-hmargin, y2-vmargin, 2.0);
uiDrawBox(GL_LINE_LOOP, x1 + hmargin, y1+vmargin, x2 - hmargin, y2 - vmargin, 2.0);
}
if (ca && (ca->flag & CAM_SHOWSENSOR)) {
/* determine sensor fit, and get sensor x/y, for auto fit we

View File

@@ -409,7 +409,7 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3
MEM_freeN(quats);
}
if (!*deformmats) {
if (*deformmats == NULL) {
int a, numVerts;
Mesh *me = (Mesh *)ob->data;

View File

@@ -1295,7 +1295,7 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader shader)
return retval;
}
void GPU_shader_free_builtin_shaders()
void GPU_shader_free_builtin_shaders(void)
{
if (GG.shaders.vsm_store) {
MEM_freeN(GG.shaders.vsm_store);

View File

@@ -870,9 +870,9 @@ static void index_rebuild_ffmpeg_proc_decoded_frame(
context->start_pts_set = TRUE;
}
context->frameno = floor((pts - context->start_pts)
* context->pts_time_base
* context->frame_rate + 0.5f);
context->frameno = floor((pts - context->start_pts) *
context->pts_time_base *
context->frame_rate + 0.5f);
/* decoding starts *always* on I-Frames,
* so: P-Frames won't work, even if all the

View File

@@ -51,7 +51,7 @@ static int rna_Main_is_dirty_get(PointerRNA *ptr)
/* XXX, not totally nice to do it this way, should store in main ? */
Main *bmain = (Main *)ptr->data;
wmWindowManager *wm;
for (wm = bmain->wm.first; wm; wm = wm->id.next) {
if ((wm = bmain->wm.first)) {
return !wm->file_saved;
}

View File

@@ -1594,7 +1594,7 @@ void RNA_def_main_masks(BlenderRNA *brna, PropertyRNA *cprop)
/* new func */
func = RNA_def_function(srna, "new", "rna_Main_mask_new");
RNA_def_function_ui_description(func, "Add a new mask with a given name to the main database");
parm = RNA_def_string_file_path(func, "name", "", MAX_ID_NAME - 2, "Mask", "Name of new mask datablock");
RNA_def_string_file_path(func, "name", "", MAX_ID_NAME - 2, "Mask", "Name of new mask datablock");
/* return type */
parm = RNA_def_pointer(func, "mask", "Mask", "", "New mask datablock");
RNA_def_function_return(func, parm);

View File

@@ -78,7 +78,7 @@ void RNA_api_mesh(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
func = RNA_def_function(srna, "unit_test_compare", "rna_Mesh_unit_test_compare");
parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to compare to");
RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to compare to");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
/* return value */
parm = RNA_def_string(func, "result", "nothing", 64, "Return value", "String description of result of comparison");

View File

@@ -613,7 +613,7 @@ void RNA_api_object(StructRNA *srna)
"objects real matrix and layers");
parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate duplis");
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Generate texture coordinates for rendering");
RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Generate texture coordinates for rendering");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
func = RNA_def_function(srna, "dupli_list_clear", "rna_Object_free_duplilist");

View File

@@ -328,7 +328,7 @@ static void rna_def_render_engine(BlenderRNA *brna)
func = RNA_def_function(srna, "end_result", "RE_engine_end_result");
prop = RNA_def_pointer(func, "result", "RenderResult", "Result", "");
RNA_def_property_flag(prop, PROP_REQUIRED);
prop = RNA_def_boolean(func, "cancel", 0, "Cancel", "Don't merge back results");
RNA_def_boolean(func, "cancel", 0, "Cancel", "Don't merge back results");
func = RNA_def_function(srna, "test_break", "RE_engine_test_break");
prop = RNA_def_boolean(func, "do_break", 0, "Break", "");

View File

@@ -568,11 +568,11 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop)
parm = RNA_def_int(func, "start_frame", 0, -MAXFRAME, MAXFRAME, "",
"The start frame for the new sequence", -MAXFRAME, MAXFRAME);
RNA_def_property_flag(parm, PROP_REQUIRED);
parm = RNA_def_int(func, "end_frame", 0, -MAXFRAME, MAXFRAME, "",
"The end frame for the new sequence", -MAXFRAME, MAXFRAME);
parm = RNA_def_pointer(func, "seq1", "Sequence", "", "Sequence 1 for effect");
parm = RNA_def_pointer(func, "seq2", "Sequence", "", "Sequence 2 for effect");
parm = RNA_def_pointer(func, "seq3", "Sequence", "", "Sequence 3 for effect");
RNA_def_int(func, "end_frame", 0, -MAXFRAME, MAXFRAME, "",
"The end frame for the new sequence", -MAXFRAME, MAXFRAME);
RNA_def_pointer(func, "seq1", "Sequence", "", "Sequence 1 for effect");
RNA_def_pointer(func, "seq2", "Sequence", "", "Sequence 2 for effect");
RNA_def_pointer(func, "seq3", "Sequence", "", "Sequence 3 for effect");
/* return type */
parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence");
RNA_def_function_return(func, parm);

View File

@@ -897,8 +897,8 @@ static void rna_def_trackingMarkers(BlenderRNA *brna, PropertyRNA *cprop)
parm = RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame",
"Frame number to find marker for", MINFRAME, MAXFRAME);
RNA_def_property_flag(parm, PROP_REQUIRED);
parm = RNA_def_boolean(func, "exact", TRUE, "Exact",
"Get marker at exact frame number rather than get estimated marker");
RNA_def_boolean(func, "exact", TRUE, "Exact",
"Get marker at exact frame number rather than get estimated marker");
parm = RNA_def_pointer(func, "marker", "MovieTrackingMarker", "", "Marker for specified frame");
RNA_def_function_return(func, parm);