code cleanup:
- remove unused defines. - quiet some shadow warnings. - bevel, ifdef out some asserts that are too common. - style
This commit is contained in:
@@ -94,8 +94,6 @@ typedef struct {
|
||||
*/
|
||||
|
||||
/* See the python script above to regenerate the 48x48 icon within blender */
|
||||
#define BLENDER_ICON_WIDTH 48
|
||||
#define BLENDER_ICON_HEIGHT 48
|
||||
static long BLENDER_ICON_48x48x32[] = {
|
||||
48,48,
|
||||
4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303,
|
||||
|
||||
@@ -588,7 +588,8 @@ float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br,
|
||||
float BKE_brush_sample_masktex(const Scene *scene, Brush *br,
|
||||
const float point[3],
|
||||
const int thread,
|
||||
struct ImagePool *pool) {
|
||||
struct ImagePool *pool)
|
||||
{
|
||||
UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
|
||||
MTex *mtex = &br->mask_mtex;
|
||||
|
||||
|
||||
@@ -43,11 +43,12 @@
|
||||
#include "bmesh.h"
|
||||
#include "./intern/bmesh_private.h"
|
||||
|
||||
|
||||
|
||||
#define BEVEL_EPSILON_D 1e-6
|
||||
#define BEVEL_EPSILON 1e-6f
|
||||
|
||||
/* happens far too often, uncomment for development */
|
||||
// #define BEVEL_ASSERT_PROJECT
|
||||
|
||||
/* for testing */
|
||||
// #pragma GCC diagnostic error "-Wpadded"
|
||||
|
||||
@@ -369,7 +370,9 @@ static void offset_meet(EdgeHalf *e1, EdgeHalf *e2, BMVert *v, BMFace *f,
|
||||
|
||||
/* intersect the lines; by construction they should be on the same plane and not parallel */
|
||||
if (!isect_line_line_v3(off1a, off1b, off2a, off2b, meetco, isect2)) {
|
||||
#ifdef BEVEL_ASSERT_PROJECT
|
||||
BLI_assert(!"offset_meet failure");
|
||||
#endif
|
||||
copy_v3_v3(meetco, off1a); /* just to do something */
|
||||
}
|
||||
}
|
||||
@@ -485,7 +488,9 @@ static void project_to_edge(BMEdge *e, const float co_a[3], const float co_b[3],
|
||||
float otherco[3];
|
||||
|
||||
if (!isect_line_line_v3(e->v1->co, e->v2->co, co_a, co_b, projco, otherco)) {
|
||||
#ifdef BEVEL_ASSERT_PROJECT
|
||||
BLI_assert(!"project meet failure");
|
||||
#endif
|
||||
copy_v3_v3(projco, e->v1->co);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,8 +327,8 @@ std::string bc_replace_string(std::string data, const std::string& pattern,
|
||||
*/
|
||||
void bc_match_scale(std::vector<Object *> *objects_done,
|
||||
Scene &sce,
|
||||
UnitConverter &bc_unit) {
|
||||
|
||||
UnitConverter &bc_unit)
|
||||
{
|
||||
Object *ob = NULL;
|
||||
|
||||
PointerRNA scene_ptr, unit_settings;
|
||||
|
||||
@@ -191,7 +191,8 @@ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode,
|
||||
if ((brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)) {
|
||||
ups->tex_mouse[0] = BLI_frand() * stroke->vc.ar->sizex;
|
||||
ups->tex_mouse[1] = BLI_frand() * stroke->vc.ar->sizey;;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
copy_v2_v2(ups->tex_mouse, mouse);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1460,7 +1460,6 @@ static int file_delete_poll(bContext *C)
|
||||
{
|
||||
int poll = ED_operator_file_active(C);
|
||||
SpaceFile *sfile = CTX_wm_space_file(C);
|
||||
struct direntry *file;
|
||||
|
||||
if (sfile && sfile->params) {
|
||||
char dir[FILE_MAX], group[FILE_MAX];
|
||||
|
||||
@@ -754,7 +754,8 @@ static void stitch_set_face_preview_buffer_position(BMFace *efa, StitchPreviewer
|
||||
|
||||
/* setup face preview for all coincident uvs and their faces */
|
||||
static void stitch_setup_face_preview_for_uv_group(UvElement *element, StitchState *state, IslandStitchData *island_stitch_data,
|
||||
PreviewPosition *preview_position) {
|
||||
PreviewPosition *preview_position)
|
||||
{
|
||||
StitchPreviewer *preview = state->stitch_preview;
|
||||
|
||||
/* static island does not change so returning immediately */
|
||||
@@ -774,7 +775,8 @@ static void stitch_setup_face_preview_for_uv_group(UvElement *element, StitchSta
|
||||
|
||||
/* checks if uvs are indeed stitchable and registers so that they can be shown in preview */
|
||||
static void stitch_validate_uv_stichability(UvElement *element, StitchState *state, IslandStitchData *island_stitch_data,
|
||||
PreviewPosition *preview_position) {
|
||||
PreviewPosition *preview_position)
|
||||
{
|
||||
UvElement *element_iter;
|
||||
StitchPreviewer *preview = state->stitch_preview;
|
||||
int vert_index;
|
||||
@@ -809,7 +811,8 @@ static void stitch_validate_uv_stichability(UvElement *element, StitchState *sta
|
||||
|
||||
|
||||
static void stitch_validate_edge_stichability(UvEdge *edge, StitchState *state, IslandStitchData *island_stitch_data,
|
||||
PreviewPosition *preview_position) {
|
||||
PreviewPosition *preview_position)
|
||||
{
|
||||
UvEdge *edge_iter = edge->first;
|
||||
StitchPreviewer *preview = state->stitch_preview;
|
||||
|
||||
|
||||
@@ -946,7 +946,8 @@ static int ffmpeg_seek_by_byte(AVFormatContext *pFormatCtx)
|
||||
}
|
||||
|
||||
static ImBuf *ffmpeg_fetchibuf(struct anim *anim, int position,
|
||||
IMB_Timecode_Type tc) {
|
||||
IMB_Timecode_Type tc)
|
||||
{
|
||||
int64_t pts_to_search = 0;
|
||||
double frame_rate;
|
||||
double pts_time_base;
|
||||
@@ -1303,7 +1304,8 @@ struct ImBuf *IMB_anim_previewframe(struct anim *anim)
|
||||
|
||||
struct ImBuf *IMB_anim_absolute(struct anim *anim, int position,
|
||||
IMB_Timecode_Type tc,
|
||||
IMB_Proxy_Size preview_size) {
|
||||
IMB_Proxy_Size preview_size)
|
||||
{
|
||||
struct ImBuf *ibuf = NULL;
|
||||
char head[256], tail[256];
|
||||
unsigned short digits;
|
||||
|
||||
@@ -2401,15 +2401,15 @@ void IMB_colormanagement_colorspace_items_add(EnumPropertyItem **items, int *tot
|
||||
static void partial_buffer_update_rect(ImBuf *ibuf, unsigned char *display_buffer, const float *linear_buffer,
|
||||
const unsigned char *byte_buffer, int display_stride, int linear_stride,
|
||||
int linear_offset_x, int linear_offset_y, ColormanageProcessor *cm_processor,
|
||||
int xmin, int ymin, int xmax, int ymax)
|
||||
const int xmin, const int ymin, const int xmax, const int ymax)
|
||||
{
|
||||
int x, y;
|
||||
int channels = ibuf->channels;
|
||||
float dither = ibuf->dither;
|
||||
ColorSpace *rect_colorspace = ibuf->rect_colorspace;
|
||||
float *display_buffer_float = NULL;
|
||||
int width = xmax - xmin;
|
||||
int height = ymax - ymin;
|
||||
const int width = xmax - xmin;
|
||||
const int height = ymax - ymin;
|
||||
int is_data = ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA;
|
||||
|
||||
if (dither != 0.0f) {
|
||||
@@ -2467,7 +2467,7 @@ static void partial_buffer_update_rect(ImBuf *ibuf, unsigned char *display_buffe
|
||||
width, height, width, display_stride);
|
||||
}
|
||||
else {
|
||||
int i, width = xmax - xmin;
|
||||
int i;
|
||||
|
||||
for (i = ymin; i < ymax; i++) {
|
||||
int byte_offset = (linear_stride * i + xmin) * 4;
|
||||
|
||||
@@ -81,8 +81,10 @@ static PyObject *make_ffmpeg_info(void)
|
||||
#define SetIntItem(flag) \
|
||||
PyStructSequence_SET_ITEM(ffmpeg_info, pos++, PyLong_FromLong(flag))
|
||||
#endif
|
||||
#ifndef WITH_FFMPEG
|
||||
#define SetStrItem(str) \
|
||||
PyStructSequence_SET_ITEM(ffmpeg_info, pos++, PyUnicode_FromString(str))
|
||||
#endif
|
||||
#define SetObjItem(obj) \
|
||||
PyStructSequence_SET_ITEM(ffmpeg_info, pos++, obj)
|
||||
|
||||
|
||||
@@ -330,10 +330,10 @@ static PyObject *bpy_lib_exit(BPy_Library *self, PyObject *UNUSED(args))
|
||||
mainl = BLO_library_append_begin(bmain, &(self->blo_handle), self->relpath);
|
||||
|
||||
{
|
||||
int i = 0, code;
|
||||
while ((code = BKE_idcode_iter_step(&i))) {
|
||||
if (BKE_idcode_is_linkable(code)) {
|
||||
const char *name_plural = BKE_idcode_to_name_plural(code);
|
||||
int idcode_step = 0, idcode;
|
||||
while ((idcode = BKE_idcode_iter_step(&idcode_step))) {
|
||||
if (BKE_idcode_is_linkable(idcode)) {
|
||||
const char *name_plural = BKE_idcode_to_name_plural(idcode);
|
||||
PyObject *ls = PyDict_GetItemString(self->dict, name_plural);
|
||||
// printf("lib: %s\n", name_plural);
|
||||
if (ls && PyList_Check(ls)) {
|
||||
@@ -350,7 +350,7 @@ static PyObject *bpy_lib_exit(BPy_Library *self, PyObject *UNUSED(args))
|
||||
// printf(" %s\n", item_str);
|
||||
|
||||
if (item_str) {
|
||||
ID *id = BLO_library_append_named_part(mainl, &(self->blo_handle), item_str, code);
|
||||
ID *id = BLO_library_append_named_part(mainl, &(self->blo_handle), item_str, idcode);
|
||||
if (id) {
|
||||
#ifdef USE_RNA_DATABLOCKS
|
||||
PointerRNA id_ptr;
|
||||
|
||||
Reference in New Issue
Block a user