code cleanup: unused defines, shadowing and unintended enum-as-variable.

This commit is contained in:
Campbell Barton 2013-03-22 14:31:03 +00:00
parent 1d68c28541
commit 9379dcb507
9 changed files with 15 additions and 17 deletions

@ -26,15 +26,14 @@
* \ingroup audaspaceintern
*/
// needed for INT64_C
#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
#endif
#ifdef WITH_PYTHON
#include "AUD_PyInit.h"
#include "AUD_PyAPI.h"
# include "AUD_PyInit.h"
# include "AUD_PyAPI.h"
#endif
#include <set>

@ -207,8 +207,10 @@ void BLF_lang_free(void)
#endif
}
#define ULANGUAGE ((U.language >= 0 && U.language < num_locales) ? U.language : 0)
#define LOCALE(_id) (locales ? locales[(_id)] : "")
#ifdef WITH_INTERNATIONAL
# define ULANGUAGE ((U.language >= 0 && U.language < num_locales) ? U.language : 0)
# define LOCALE(_id) (locales ? locales[(_id)] : "")
#endif
void BLF_lang_set(const char *str)
{

@ -1132,7 +1132,6 @@ static void node_draw(const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTre
void node_draw_nodetree(const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree, bNodeInstanceKey parent_key)
{
bNode *node;
bNodeInstanceKey key;
bNodeLink *link;
int a;
@ -1146,6 +1145,7 @@ void node_draw_nodetree(const bContext *C, ARegion *ar, SpaceNode *snode, bNodeT
/* draw background nodes, last nodes in front */
for (a = 0, node = ntree->nodes.first; node; node = node->next, a++) {
bNodeInstanceKey key;
#ifdef USE_DRAW_TOT_UPDATE
/* unrelated to background nodes, update the v2d->tot,

@ -5742,10 +5742,10 @@ static void createTransNodeData(bContext *UNUSED(C), TransInfo *t)
/* * motion tracking * */
enum {
enum transDataTracking_Mode {
transDataTracking_ModeTracks = 0,
transDataTracking_ModeCurves = 1,
} transDataTracking_Mode;
transDataTracking_ModeCurves = 1
};
typedef struct TransDataTracking {
int mode, flag;

@ -56,7 +56,7 @@
/* State */
#define NUM_OPENGL_LIGHTS 8
// #define NUM_OPENGL_LIGHTS 8
static struct {
GPUShader *cached_shaders[GPU_SHADER_OPTION_COMBINATIONS];

@ -27,8 +27,6 @@
* to access C defined builtin functions.
* A script writer should never directly access this module.
*/
#define WITH_PYTHON /* for AUD_PyInit.h, possibly others */
#include <Python.h>

@ -107,9 +107,10 @@ static PyObject *make_app_info(void)
if (app_info == NULL) {
return NULL;
}
#if 0
#define SetIntItem(flag) \
PyStructSequence_SET_ITEM(app_info, pos++, PyLong_FromLong(flag))
#endif
#define SetStrItem(str) \
PyStructSequence_SET_ITEM(app_info, pos++, PyUnicode_FromString(str))
#define SetBytesItem(str) \

@ -131,6 +131,7 @@ static PyObject *PyInit_gpu(void)
PyDict_SetItemString(d, # f, val); \
Py_DECREF(val)
#if 0 /* UNUSED */
#define PY_OBJ_ADD_ID(d, s, f) \
val = PyUnicode_FromString(&s->f->id.name[2]); \
PyObject_SetAttrString(d, # f, val); \
@ -145,6 +146,7 @@ static PyObject *PyInit_gpu(void)
val = PyUnicode_FromString(s->f); \
PyObject_SetAttrString(d, # f, val); \
Py_DECREF(val)
#endif
PyDoc_STRVAR(GPU_export_shader_doc,
"export_shader(scene, material)\n"

@ -67,10 +67,6 @@ extern "C"{
#include "BLI_blenlib.h"
#include "BLI_math.h"
#define __NLA_DEFNORMALS
//#undef __NLA_DEFNORMALS
BL_ModifierDeformer::~BL_ModifierDeformer()
{
if (m_dm) {