style cleanup: comments & spelling

This commit is contained in:
Campbell Barton 2012-11-18 01:22:31 +00:00
parent 8b57f7502b
commit b867f9f17e
25 changed files with 61 additions and 47 deletions

@ -232,7 +232,6 @@ def enable(module_name, default_set=True, persistent=False):
import os
import sys
import imp
def handle_error():
import traceback
@ -246,6 +245,7 @@ def enable(module_name, default_set=True, persistent=False):
mtime_orig = getattr(mod, "__time__", 0)
mtime_new = os.path.getmtime(mod.__file__)
if mtime_orig != mtime_new:
import imp
print("module changed on disk:", mod.__file__, "reloading...")
try:

@ -2568,10 +2568,12 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
sbFreeSimulation(pid->calldata);
else if (pid->type == PTCACHE_TYPE_PARTICLES)
psys_reset(pid->calldata, PSYS_RESET_DEPSGRAPH);
/*else if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
#if 0
else if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
smokeModifier_reset(pid->calldata);
else if (pid->type == PTCACHE_TYPE_SMOKE_HIGHRES)
smokeModifier_reset_turbulence(pid->calldata);*/
smokeModifier_reset_turbulence(pid->calldata);
#endif
else if (pid->type == PTCACHE_TYPE_DYNAMICPAINT)
dynamicPaint_clearSurface((DynamicPaintSurface*)pid->calldata);
}

@ -1045,7 +1045,7 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen
/* always update layer, so that animating layers works (joshua july 2010) */
/* XXX commented out, this has depsgraph issues anyway - and this breaks setting scenes
(on scene-set, the base-lay is copied to ob-lay (ton nov 2012) */
* (on scene-set, the base-lay is copied to ob-lay (ton nov 2012) */
// base->lay = ob->lay;
}

@ -1410,7 +1410,7 @@ static float ray_nearest_hit(BVHRayCastData *data, const float bv[6])
* Based on Tactical Optimization of Ray/Box Intersection, by Graham Fyffe
* [http://tog.acm.org/resources/RTNews/html/rtnv21n1.html#art9]
*
* TODO this doens't has data->ray.radius in consideration */
* TODO this doesn't take data->ray.radius into consideration */
static float fast_ray_nearest_hit(const BVHRayCastData *data, const BVHNode *node)
{
const float *bv = node->bv;

@ -84,7 +84,7 @@ void mul_qt_qtqt(float q[4], const float q1[4], const float q2[4])
* \note:
* Assumes a unit quaternion?
*
* in fact not, but you may wan't to use a unit quat, read on...
* in fact not, but you may want to use a unit quat, read on...
*
* Shortcut for 'q v q*' when \a v is actually a quaternion.
* This removes the need for converting a vector to a quaternion,

@ -985,7 +985,7 @@ int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const short do_quad_tri_speedu
/* CURRENT STATUS:
* - eve->f :1 = availalble in edges
* - eve->f :1 = available in edges
* - eve->xs :polynumber
* - eve->h :amount of edges connected to vertex
* - eve->tmp.v :store! original vertex number

@ -107,14 +107,14 @@ typedef struct BMIter {
BMesh *bm;
void (*begin)(struct BMIter *iter);
void *(*step)(struct BMIter *iter);
/*
#if 0
union {
void *p;
int i;
long l;
float f;
} filter;
*/
#endif
int count; /* note, only some iterators set this, don't rely on it */
char itype;
} BMIter;

@ -81,7 +81,7 @@ public:
/**
* This method will be called if an error in the loading process occurred and the loader cannot
* continue to load. The writer should undo all operations that have been performed.
\param errorMessage A message containing informations about the error that occurred.
* \param errorMessage A message containing informations about the error that occurred.
*/
void cancel(const COLLADAFW::String& errorMessage);

@ -1471,9 +1471,10 @@ static void node_shader_buts_script_details(uiLayout *layout, bContext *C, Point
node_shader_buts_script(layout, C, ptr);
/* not implemented yet
#if 0 /* not implemented yet */
if (RNA_enum_get(ptr, "mode") == NODE_SCRIPT_EXTERNAL)
uiItemR(layout, ptr, "use_auto_update", 0, NULL, ICON_NONE);*/
uiItemR(layout, ptr, "use_auto_update", 0, NULL, ICON_NONE);
#endif
}
/* only once called */

@ -457,7 +457,7 @@ LogImageFile *dpxCreate(const char *filename, int width, int height, int bitsPer
}
/* Header should be rounded to next 8k block
6044 = 8092 - sizeof(DpxMainHeader) */
* 6044 = 8092 - sizeof(DpxMainHeader) */
memset(&pad, 0, 6044);
if (fwrite(&pad, 6044, 1, dpx->file) == 0) {
if (verbose) printf("DPX: Couldn't write image header\n");

@ -147,7 +147,7 @@ struct BlockDXT3
struct AlphaBlockDXT5
{
// uint64 unions do not compile on all platforms
/*
#if 0
union {
struct {
uint64 alpha0 : 8; // 8
@ -171,7 +171,7 @@ struct AlphaBlockDXT5
};
uint64 u;
};
*/
#endif
uint64 u;
uint8 alpha0() const { return u & 0xffLL; }
uint8 alpha1() const { return (u >> 8) & 0xffLL; }

@ -49,14 +49,14 @@ static bNodeSocketTemplate cmp_node_colorbalance_out[] = {
#ifdef WITH_COMPOSITOR_LEGACY
/* this function implements ASC-CDL according to the spec at http://www.asctech.org/
Slope
S = in * slope
Offset
O = S + offset
= (in * slope) + offset
Power
out = Clamp(O) ^ power
= Clamp((in * slope) + offset) ^ power
* Slope
* S = in * slope
* Offset
* O = S + offset
* = (in * slope) + offset
* Power
* out = Clamp(O) ^ power
* = Clamp((in * slope) + offset) ^ power
*/
DO_INLINE float colorbalance_cdl(float in, float offset, float power, float slope)
{

@ -59,6 +59,19 @@ static PyMethodDef bpy_reload_meth;
static PyObject *imp_reload_orig = NULL;
/* 'builtins' is most likely PyEval_GetBuiltins() */
/**
* \note to the discerning developer, yes - this is nasty
* monkey-patching our own import into Python's builtin 'imp' module.
*
* However Python's alternative is to use import hooks,
* which are implemented in a way that we can't use our own importer as a
* fall-back (instead we must try and fail - raise an exception evert time).
* Since importing from blenders text-blocks is not the common case
* I prefer to use Pythons import by default and fall-back to
* Blenders - which we can only do by intercepting import calls I'm afraid.
* - Campbell
*/
void bpy_import_init(PyObject *builtins)
{
PyObject *item;

@ -711,14 +711,14 @@ static int wm_automatic_draw_method(wmWindow *win)
if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE))
return USER_DRAW_OVERLAP;
/* also Intel drivers are slow */
/* 2.64 BCon3 period, let's try if intel now works...
#if 0 /* 2.64 BCon3 period, let's try if intel now works... */
else if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_UNIX, GPU_DRIVER_ANY))
return USER_DRAW_OVERLAP;
else if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_WIN, GPU_DRIVER_ANY))
return USER_DRAW_OVERLAP_FLIP;
else if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_MAC, GPU_DRIVER_ANY))
return USER_DRAW_OVERLAP_FLIP;
*/
#endif
/* Windows software driver darkens color on each redraw */
else if (GPU_type_matches(GPU_DEVICE_SOFTWARE, GPU_OS_WIN, GPU_DRIVER_SOFTWARE))
return USER_DRAW_OVERLAP_FLIP;

@ -340,7 +340,7 @@ static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, wmEvent *eve
int retval;
/* UI code doesn't handle return values - it just always returns break.
to make the DBL_CLICK conversion work, we just don't send this to UI */
* to make the DBL_CLICK conversion work, we just don't send this to UI */
if (event->val == KM_DBL_CLICK)
return WM_HANDLER_CONTINUE;
@ -1288,9 +1288,9 @@ static int wm_eventmatch(wmEvent *winevent, wmKeyMapItem *kmi)
/* the matching rules */
if (kmitype == KM_TEXTINPUT)
if (winevent->val == KM_PRESS) { // prevent double clicks
if (winevent->val == KM_PRESS) { /* prevent double clicks */
/* NOT using ISTEXTINPUT anymore because (at least on Windows) some key codes above 255
could have printable ascii keys - BUG [#30479] */
* could have printable ascii keys - BUG [#30479] */
if (ISKEYBOARD(winevent->type) && (winevent->ascii || winevent->utf8_buf[0])) return 1;
}

@ -1228,7 +1228,7 @@ static int wm_operator_props_popup_ex(bContext *C, wmOperator *op, const int do_
}
/* Same as WM_operator_props_popup but call the operator first,
* This way - the button values corraspond to the result of the operator.
* This way - the button values correspond to the result of the operator.
* Without this, first access to a button will make the result jump,
* see [#32452] */
int WM_operator_props_popup_call(bContext *C, wmOperator *op, wmEvent *UNUSED(event))

@ -88,7 +88,6 @@ typedef struct PlayState {
short pingpong;
short noskip;
short sstep;
short pause;
short wait2;
short stopped;
short go;
@ -748,7 +747,6 @@ void WM_main_playanim(int argc, const char **argv)
ps.pingpong = FALSE;
ps.noskip = FALSE;
ps.sstep = FALSE;
ps.pause = FALSE;
ps.wait2 = FALSE;
ps.stopped = FALSE;
ps.picture = NULL;

@ -337,7 +337,7 @@ static void wm_window_add_ghostwindow(const char *title, wmWindow *win)
int scr_w, scr_h, posy;
/* force setting multisamples only once, it requires restart - and you cannot
mix it, either all windows have it, or none (tested in OSX opengl) */
* mix it, either all windows have it, or none (tested in OSX opengl) */
if (multisamples == -1)
multisamples = U.ogl_multisamples;

@ -285,9 +285,9 @@ enum {
/* for event checks */
/* only used for KM_TEXTINPUT, so assume that we want all user-inputtable ascii codes included */
/* UNUSED - see wm_eventmatch - BUG [#30479]
#define ISTEXTINPUT(event) (event >= ' ' && event <= 255)
*/
/* UNUSED - see wm_eventmatch - BUG [#30479] */
// #define ISTEXTINPUT(event) (event >= ' ' && event <= 255)
/* test whether the event is a key on the keyboard */
#define ISKEYBOARD(event) (event >= ' ' && event <= 320)

@ -526,7 +526,7 @@ typedef struct KX_PYATTRIBUTE_DEF {
/*------------------------------
* PyObjectPlus
------------------------------*/
*------------------------------ */
typedef PyTypeObject *PyParentObject; /* Define the PyParent Object */
#else // WITH_PYTHON

@ -152,7 +152,7 @@ struct SG_Callbacks
};
/**
base object that can be part of the scenegraph.
* base object that can be part of the scenegraph.
*/
class SG_IObject : public SG_QList
{