code cleanup: spelling,

also initialize bmesh-bevel settings struct to zero to avoid possible uninitialized memory later.
This commit is contained in:
Campbell Barton 2012-11-12 07:33:01 +00:00
parent 0bfc92ff8e
commit cf6994b910
27 changed files with 75 additions and 60 deletions

View File

@ -173,14 +173,15 @@ help:
@echo " * test_style_osl_qtc - checks OpenShadingLanguage conforms with blenders style guide: http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
@echo ""
@echo "Static Source Code Checking (not associated with building blender)"
@echo " * check_cppcheck - run blender source through cppcheck (C & C++)"
@echo " * check_clang_array - run blender source through clang array checking script (C & C++)"
@echo " * check_splint - run blenders source through splint (C only)"
@echo " * check_sparse - run blenders source through sparse (C only)"
@echo " * check_smatch - run blenders source through smatch (C only)"
@echo " * check_spelling_c - check for spelling errors (OSL only)"
@echo " * check_spelling_osl - check for spelling errors (C/C++ only)"
@echo " * check_spelling_py - check for spelling errors (Python only)"
@echo " * check_cppcheck - run blender source through cppcheck (C & C++)"
@echo " * check_clang_array - run blender source through clang array checking script (C & C++)"
@echo " * check_splint - run blenders source through splint (C only)"
@echo " * check_sparse - run blenders source through sparse (C only)"
@echo " * check_smatch - run blenders source through smatch (C only)"
@echo " * check_spelling_c - check for spelling errors (OSL only)"
@echo " * check_spelling_c_qtc - same as check_spelling_c but outputs QtCreator tasks format"
@echo " * check_spelling_osl - check for spelling errors (C/C++ only)"
@echo " * check_spelling_py - check for spelling errors (Python only)"
@echo ""
@echo "Utilities (not associated with building blender)"
@echo " * tbz - create a compressed svn export 'blender_archive.tar.bz2'"
@ -270,29 +271,41 @@ project_eclipse:
check_cppcheck:
$(CMAKE_CONFIG)
cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py
cd $(BUILD_DIR) ; \
python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py
check_clang_array:
$(CMAKE_CONFIG)
cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py
cd $(BUILD_DIR) ; \
python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py
check_splint:
$(CMAKE_CONFIG)
cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py
cd $(BUILD_DIR) ; \
python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py
check_sparse:
$(CMAKE_CONFIG)
cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py
cd $(BUILD_DIR) ; \
python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py
check_smatch:
$(CMAKE_CONFIG)
cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py
cd $(BUILD_DIR) ; \
python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py
check_spelling_py:
cd $(BUILD_DIR) ; PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/release/scripts
cd $(BUILD_DIR) ; \
PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/release/scripts
check_spelling_c:
cd $(BUILD_DIR) ; PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/source
cd $(BUILD_DIR) ; \
PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/source
check_spelling_c_qtc:
cd $(BUILD_DIR) ; USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/source > \
$(BLENDER_DIR)/check_spelling_c.tasks
check_spelling_osl:
cd $(BUILD_DIR) ; PYTHONIOENCODING=utf_8 python3 $(BLENDER_DIR)/source/tools/spell_check_source.py $(BLENDER_DIR)/intern/cycles/kernel/osl

View File

@ -64,8 +64,8 @@ public:
* Writes a reader to a writer.
* \param reader The reader to read from.
* \param writer The writer to write to.
* \param length How many samples should be transfered.
* \param buffersize How many samples should be transfered at once.
* \param length How many samples should be transferred.
* \param buffersize How many samples should be transferred at once.
*/
static void writeReader(boost::shared_ptr<AUD_IReader> reader, boost::shared_ptr<AUD_IWriter> writer, unsigned int length, unsigned int buffersize);
@ -73,8 +73,8 @@ public:
* Writes a reader to several writers.
* \param reader The reader to read from.
* \param writers The writers to write to.
* \param length How many samples should be transfered.
* \param buffersize How many samples should be transfered at once.
* \param length How many samples should be transferred.
* \param buffersize How many samples should be transferred at once.
*/
static void writeReader(boost::shared_ptr<AUD_IReader> reader, std::vector<boost::shared_ptr<AUD_IWriter> >& writers, unsigned int length, unsigned int buffersize);
};

View File

@ -170,7 +170,7 @@ public :
}
/**
* Assignment operator - ownership is transfered from rhs to lhs.
* Assignment operator - ownership is transferred from rhs to lhs.
* There is an intenional side-effect of function of transferring
* ownership from the const parameter rhs. This is to insure
* the 1-1 relationship.

View File

@ -248,7 +248,7 @@ void BKE_sequencer_cache_cleanup(void);
struct ImBuf *BKE_sequencer_cache_get(SeqRenderData context, struct Sequence *seq, float cfra, seq_stripelem_ibuf_t type);
/* passed ImBuf is properly refed, so ownership is *not*
* transfered to the cache.
* transferred to the cache.
* you can pass the same ImBuf multiple times to the cache without problems.
*/

View File

@ -1821,7 +1821,7 @@ int BM_vert_splice(BMesh *bm, BMVert *v, BMVert *v_target)
/* we can't modify the vert while iterating so first allocate an array of loops */
loops = BM_iter_as_arrayN(bm, BM_LOOPS_OF_VERT, v, &loops_tot,
(void **)loops_stack, BM_DEFAULT_ITER_STACK_SIZE);
loops_stack, BM_DEFAULT_ITER_STACK_SIZE);
if (LIKELY(loops != NULL)) {
for (i = 0; i < loops_tot; i++) {

View File

@ -117,7 +117,7 @@ int BM_iter_as_array(BMesh *bm, const char itype, void *data, void **array, cons
* Caller needs to free the array.
*/
void *BM_iter_as_arrayN(BMesh *bm, const char itype, void *data, int *r_len,
/* optional static vars to avoid an alloc */
/* optional args to avoid an alloc (normally stack array) */
void **stack_array, int stack_array_size)
{
BMIter iter;

View File

@ -1094,9 +1094,13 @@ static void bevel_vert_construct(BMesh *bm, BevelParams *bp, BMOperator *op, BMV
int nsel = 0;
/* Gather input selected edges.
* Only bevel selected edges that have exactly two incident faces. */
* Only bevel selected edges that have exactly two incident faces.
*
* TODO, optimization - we could tag edges in 'geom'
* and then just iterate edges-of-vert, checking tags.
*/
BMO_ITER (bme, &siter, bm, op, "geom", BM_EDGE) {
if ((bme->v1 == v) || (BM_edge_other_vert(bme, bme->v1) == v)) {
if (BM_vert_in_edge(bme, v)) {
if (BM_edge_is_manifold(bme)) {
BMO_elem_flag_enable(bm, bme, EDGE_SELECTED);
nsel++;
@ -1310,12 +1314,12 @@ static void bevel_build_edge_polygons(BMesh *bm, BevelParams *bp, BMEdge *bme)
BLI_assert(e1 && e2);
/* v4 v3
* \ /
* e->v1 - e->v2
* / \
* v1 v2 */
/* v4 v3
* \ /
* e->v1 - e->v2
* / \
* v1 v2
*/
nseg = e1->seg;
BLI_assert(nseg > 0 && nseg == e2->seg);
@ -1380,15 +1384,13 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op)
BMOIter siter;
BMVert *v;
BMEdge *e;
BevelParams bp;
BevelParams bp = {{NULL}};
bp.offset = BMO_slot_float_get(op, "offset");
bp.op = op;
bp.seg = BMO_slot_int_get(op, "segments");
if (bp.offset > 0) {
bp.vertList.first = bp.vertList.last = NULL;
/* The analysis of the input vertices and execution additional constructions */
BMO_ITER (v, &siter, bm, op, "geom", BM_VERT) {
bevel_vert_construct(bm, &bp, op, v);

View File

@ -165,7 +165,7 @@ static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const SubDPar
}
/* apply the new difference to the rest of the shape keys,
* note that this doent take rotations into account, we _could_ support
* note that this dosn't take rotations into account, we _could_ support
* this by getting the normals and coords for each shape key and
* re-calculate the smooth value for each but this is quite involved.
* for now its ok to simply apply the difference IMHO - campbell */

View File

@ -844,7 +844,7 @@ void AnimationImporter::apply_matrix_curves(Object *ob, std::vector<FCurve *>& a
* This function returns the aspet ration from the Collada camera.
*
* Note:COLLADA allows to specify either XFov, or YFov alone.
* In tghat case the aspect ratio can be determined from
* In that case the aspect ratio can be determined from
* the viewport aspect ratio (which is 1:1 ?)
* XXX: check this: its probably wrong!
* If both values are specified, then the aspect ration is simply xfov/yfov

View File

@ -35,7 +35,7 @@
class PixelateOperation : public NodeOperation {
private:
/**
* @brief cached refeerence to the input operation
* @brief cached reference to the input operation
*/
SocketReader *m_inputOperation;
public:

View File

@ -358,7 +358,7 @@ struct uiBlock {
char color_profile; /* color profile for correcting linear colors for display */
char *display_device; /* display devide name used to display this block,
char *display_device; /* display device name used to display this block,
* used by color widgets to transform colors from/to scene linear
*/
};

View File

@ -157,13 +157,13 @@ BMBVHTree *BMBVH_NewBVH(BMEditMesh *em, int flag, Scene *scene, Object *obedit)
if (flag & BMBVH_RESPECT_SELECT) {
/* note, the arrays wont allign now! take care */
/* note, the arrays wont align now! take care */
if (!BM_elem_flag_test(em->looptris[i][0]->f, BM_ELEM_SELECT)) {
continue;
}
}
else if (flag & BMBVH_RESPECT_HIDDEN) {
/* note, the arrays wont allign now! take care */
/* note, the arrays wont align now! take care */
if (BM_elem_flag_test(em->looptris[i][0]->f, BM_ELEM_HIDDEN)) {
continue;
}

View File

@ -248,7 +248,7 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext *
void buttons_texture_context_compute(const bContext *C, SpaceButs *sbuts)
{
/* gatheravailable texture users in context. runs on every draw of
/* gather available texture users in context. runs on every draw of
* properties editor, before the buttons are created. */
ButsContextTexture *ct = sbuts->texuser;
Scene *scene = CTX_data_scene(C);

View File

@ -1497,7 +1497,7 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d)
if (onlyv2d) {
/* if manual calibration is used then grease pencil data is already
* drawed in draw_distortion */
* drawn in draw_distortion */
if ((sc->flag & SC_MANUAL_CALIBRATION) == 0 || sc->mode != SC_MODE_DISTORTION) {
glPushMatrix();
glMultMatrixf(sc->unistabmat);

View File

@ -1686,7 +1686,7 @@ static int sequencer_delete_invoke(bContext *C, wmOperator *op, wmEvent *event)
if (ar->regiontype == RGN_TYPE_WINDOW) {
/* bounding box of 30 pixels is used for markers shortcuts,
* prevent conflict with markers shortcurts here
* prevent conflict with markers shortcuts here
*/
if (event->mval[1] <= 30)
return OPERATOR_PASS_THROUGH;

View File

@ -164,7 +164,7 @@ typedef struct ColormanageProcessor {
* but they holds indexes of all transformations and color spaces, not
* their names.
*
* This helps avoid extra colorsmace / display / view lookup without
* This helps avoid extra colorspace / display / view lookup without
* requiring to pass all variables which affects on display buffer
* to color management cache system and keeps calls small and nice.
*/

View File

@ -387,8 +387,8 @@ BLI_INLINE int DOWNSAMPLE_FLOAT_TO_16BIT(const float _val)
/*
* 2048x1080 (2K) at 24 fps or 48 fps, or 4096x2160 (4K) at 24 fps; 3x12 bits per pixel, XYZ color space
*
* - In 2K, for Scope (2.39:1) presentation 2048x858 pixels of the imager is used
* - In 2K, for Flat (1.85:1) presentation 1998x1080 pixels of the imager is used
* - In 2K, for Scope (2.39:1) presentation 2048x858 pixels of the image is used
* - In 2K, for Flat (1.85:1) presentation 1998x1080 pixels of the image is used
*/
/* ****************************** COPIED FROM image_to_j2k.c */

View File

@ -1183,7 +1183,7 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, size_t size, int flags, char
frameBuffer.insert(exr_rgba_channelname(file, "B"),
Slice(Imf::FLOAT, (char *) (first + 2), xstride, ystride));
/* 1.0 is fill value, this still neesd to be assigned even when (is_alpha == 0) */
/* 1.0 is fill value, this still needs to be assigned even when (is_alpha == 0) */
frameBuffer.insert(exr_rgba_channelname(file, "A"),
Slice(Imf::FLOAT, (char *) (first + 3), xstride, ystride, 1, 1, 1.0f));

View File

@ -163,7 +163,7 @@ typedef struct MovieTrackingSettings {
/* ** reconstruction settings ** */
int keyframe1 DNA_DEPRECATED,
keyframe2 DNA_DEPRECATED; /* two keyframes for reconstrution initialization
keyframe2 DNA_DEPRECATED; /* two keyframes for reconstruction initialization
* were moved to per-tracking object settings
*/
@ -228,7 +228,7 @@ typedef struct MovieTrackingObject {
MovieTrackingReconstruction reconstruction; /* reconstruction data for this object */
/* reconstruction options */
int keyframe1, keyframe2; /* two keyframes for reconstrution initialization */
int keyframe1, keyframe2; /* two keyframes for reconstruction initialization */
} MovieTrackingObject;
typedef struct MovieTrackingStats {

View File

@ -555,7 +555,7 @@ static void rna_Window_screen_set(PointerRNA *ptr, PointerRNA value)
if (value.data == NULL)
return;
/* exception: can't set screens inside of area/region handers */
/* exception: can't set screens inside of area/region handlers */
win->newscreen = value.data;
}
@ -563,8 +563,8 @@ static void rna_Window_screen_update(bContext *C, PointerRNA *ptr)
{
wmWindow *win = (wmWindow *)ptr->data;
/* exception: can't set screens inside of area/region handers, and must
* use context so notifier gets to the right window */
/* exception: can't set screens inside of area/region handlers,
* and must use context so notifier gets to the right window */
if (win->newscreen) {
WM_event_add_notifier(C, NC_SCREEN | ND_SCREENBROWSE, win->newscreen);
win->newscreen = NULL;

View File

@ -2784,7 +2784,7 @@ static struct PyMethodDef Vector_methods[] = {
/* Note
* Py_TPFLAGS_CHECKTYPES allows us to avoid casting all types to Vector when coercing
* but this means for eg that
* (vec * mat) and (mat * vec) both get sent to Vector_mul and it neesd to sort out the order
* (vec * mat) and (mat * vec) both get sent to Vector_mul and it needs to sort out the order
*/
PyDoc_STRVAR(vector_doc,

View File

@ -92,7 +92,7 @@ int RE_rayobjectcontrol_test_break(RayObjectControl *c);
* eg.: on render code)
*
* 0 means it's reserved and has it own meaning inside each ray acceleration structure
* (this way each structure can use the allign offset to determine if a node represents a
* (this way each structure can use the align offset to determine if a node represents a
* RayObject primitive, which can be used to save memory)
*/

View File

@ -1026,7 +1026,7 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
labdao = ddalabda;
/* traversing ocree nodes need careful detection of smallest values, with proper
/* traversing octree nodes need careful detection of smallest values, with proper
* exceptions for equal labdas */
eqval = (labdax == labday);
if (labday == labdaz) eqval += 2;

View File

@ -435,7 +435,7 @@ int rtbuild_heuristic_object_split(RTBuilder *b, int nchilds)
/*
* Helper code
* PARTITION code / used on mean-split
* basicly this a std::nth_element (like on C++ STL algorithm)
* basically this a std::nth_element (like on C++ STL algorithm)
*/
#if 0
static void split_leafs(RTBuilder *b, int *nth, int partitions, int split_axis)

View File

@ -118,8 +118,8 @@ static void DirectionToThetaPhi(float *toSun, float *theta, float *phi)
/**
* PerezFunction:
* compute perez function value based on input paramters
* */
* compute perez function value based on input parameters
*/
static float PerezFunction(struct SunSky *sunsky, const float *lam, float theta, float gamma, float lvz)
{
float den, num;

View File

@ -545,7 +545,7 @@ static wmKeyMap *wm_keymap_patch_update(ListBase *lb, wmKeyMap *defaultmap, wmKe
/* copy new keymap from an existing one */
if (usermap && !(usermap->flag & KEYMAP_DIFF)) {
/* for compatibiltiy with old user preferences with non-diff
/* for compatibility with old user preferences with non-diff
* keymaps we override the original entirely */
wmKeyMapItem *kmi, *orig_kmi;

View File

@ -624,7 +624,7 @@ void WM_operator_properties_sanitize(PointerRNA *ptr, const short no_context)
/** set all props to their default,
* \param do_update Only update un-initialized props.
*
* \note, theres nothing spesific to operators here.
* \note, theres nothing specific to operators here.
* this could be made a general function.
*/
int WM_operator_properties_default(PointerRNA *ptr, const int do_update)