code cleanup: warnings
This commit is contained in:
@@ -983,8 +983,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
|
|||||||
|
|
||||||
default: {
|
default: {
|
||||||
#ifdef WITH_X11_XINPUT
|
#ifdef WITH_X11_XINPUT
|
||||||
if (xe->type == window->GetXTablet().MotionEvent)
|
if (xe->type == window->GetXTablet().MotionEvent) {
|
||||||
{
|
|
||||||
XDeviceMotionEvent *data = (XDeviceMotionEvent *)xe;
|
XDeviceMotionEvent *data = (XDeviceMotionEvent *)xe;
|
||||||
|
|
||||||
/* stroke might begin without leading ProxyIn event,
|
/* stroke might begin without leading ProxyIn event,
|
||||||
@@ -993,23 +992,23 @@ GHOST_SystemX11::processEvent(XEvent *xe)
|
|||||||
setTabletMode(window, data->deviceid);
|
setTabletMode(window, data->deviceid);
|
||||||
|
|
||||||
window->GetXTablet().CommonData.Pressure =
|
window->GetXTablet().CommonData.Pressure =
|
||||||
data->axis_data[2] / ((float)window->GetXTablet().PressureLevels);
|
data->axis_data[2] / ((float)window->GetXTablet().PressureLevels);
|
||||||
|
|
||||||
/* the (short) cast and the &0xffff is bizarre and unexplained anywhere,
|
/* the (short) cast and the &0xffff is bizarre and unexplained anywhere,
|
||||||
* but I got garbage data without it. Found it in the xidump.c source --matt */
|
* but I got garbage data without it. Found it in the xidump.c source --matt */
|
||||||
window->GetXTablet().CommonData.Xtilt =
|
window->GetXTablet().CommonData.Xtilt =
|
||||||
(short)(data->axis_data[3] & 0xffff) / ((float)window->GetXTablet().XtiltLevels);
|
(short)(data->axis_data[3] & 0xffff) / ((float)window->GetXTablet().XtiltLevels);
|
||||||
window->GetXTablet().CommonData.Ytilt =
|
window->GetXTablet().CommonData.Ytilt =
|
||||||
(short)(data->axis_data[4] & 0xffff) / ((float)window->GetXTablet().YtiltLevels);
|
(short)(data->axis_data[4] & 0xffff) / ((float)window->GetXTablet().YtiltLevels);
|
||||||
}
|
}
|
||||||
else if (xe->type == window->GetXTablet().ProxInEvent)
|
else if (xe->type == window->GetXTablet().ProxInEvent) {
|
||||||
{
|
|
||||||
XProximityNotifyEvent *data = (XProximityNotifyEvent *)xe;
|
XProximityNotifyEvent *data = (XProximityNotifyEvent *)xe;
|
||||||
|
|
||||||
setTabletMode(window, data->deviceid);
|
setTabletMode(window, data->deviceid);
|
||||||
}
|
}
|
||||||
else if (xe->type == window->GetXTablet().ProxOutEvent)
|
else if (xe->type == window->GetXTablet().ProxOutEvent) {
|
||||||
window->GetXTablet().CommonData.Active = GHOST_kTabletModeNone;
|
window->GetXTablet().CommonData.Active = GHOST_kTabletModeNone;
|
||||||
|
}
|
||||||
#endif // WITH_X11_XINPUT
|
#endif // WITH_X11_XINPUT
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -210,8 +210,8 @@ public:
|
|||||||
|
|
||||||
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
|
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
|
||||||
XIM
|
XIM
|
||||||
getX11_XIM(
|
getX11_XIM()
|
||||||
) {
|
{
|
||||||
return m_xim;
|
return m_xim;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -235,7 +235,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
|
void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
|
||||||
|
|
||||||
#if WITH_XDND
|
#ifdef WITH_XDND
|
||||||
/**
|
/**
|
||||||
* Creates a drag'n'drop event and pushes it immediately onto the event queue.
|
* Creates a drag'n'drop event and pushes it immediately onto the event queue.
|
||||||
* Called by GHOST_DropTargetX11 class.
|
* Called by GHOST_DropTargetX11 class.
|
||||||
|
@@ -1772,7 +1772,6 @@ static void give_parvert(Object *par, int nr, float vec[3])
|
|||||||
if (par->type == OB_MESH) {
|
if (par->type == OB_MESH) {
|
||||||
Mesh *me = par->data;
|
Mesh *me = par->data;
|
||||||
DerivedMesh *dm;
|
DerivedMesh *dm;
|
||||||
int count;
|
|
||||||
|
|
||||||
em = me->edit_btmesh;
|
em = me->edit_btmesh;
|
||||||
|
|
||||||
@@ -1795,6 +1794,7 @@ static void give_parvert(Object *par, int nr, float vec[3])
|
|||||||
dm = (em) ? em->derivedFinal : par->derivedFinal;
|
dm = (em) ? em->derivedFinal : par->derivedFinal;
|
||||||
|
|
||||||
if (dm) {
|
if (dm) {
|
||||||
|
int count = 0;
|
||||||
int numVerts = dm->getNumVerts(dm);
|
int numVerts = dm->getNumVerts(dm);
|
||||||
|
|
||||||
if (nr < numVerts) {
|
if (nr < numVerts) {
|
||||||
@@ -1803,7 +1803,6 @@ static void give_parvert(Object *par, int nr, float vec[3])
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* get the average of all verts with (original index == nr) */
|
/* get the average of all verts with (original index == nr) */
|
||||||
count = 0;
|
|
||||||
if (index) {
|
if (index) {
|
||||||
for (i = 0; i < numVerts; i++) {
|
for (i = 0; i < numVerts; i++) {
|
||||||
if (index[i] == nr) {
|
if (index[i] == nr) {
|
||||||
|
@@ -4539,8 +4539,8 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3]
|
|||||||
/* can happen with bad pointcache or physics calculation
|
/* can happen with bad pointcache or physics calculation
|
||||||
* since this becomes geometry, nan's and inf's crash raytrace code.
|
* since this becomes geometry, nan's and inf's crash raytrace code.
|
||||||
* better not allow this. */
|
* better not allow this. */
|
||||||
if (!finite(bb->vec[0]) || !finite(bb->vec[1]) || !finite(bb->vec[2]) ||
|
if ((!finite(bb->vec[0])) || (!finite(bb->vec[1])) || (!finite(bb->vec[2])) ||
|
||||||
!finite(bb->vel[0]) || !finite(bb->vel[1]) || !finite(bb->vel[2]) )
|
(!finite(bb->vel[0])) || (!finite(bb->vel[1])) || (!finite(bb->vel[2])) )
|
||||||
{
|
{
|
||||||
zero_v3(bb->vec);
|
zero_v3(bb->vec);
|
||||||
zero_v3(bb->vel);
|
zero_v3(bb->vel);
|
||||||
|
@@ -64,7 +64,7 @@ static int find_nearest_diff_point(const bContext *C, Mask *mask, const float no
|
|||||||
MaskLayer *masklay, *point_masklay;
|
MaskLayer *masklay, *point_masklay;
|
||||||
MaskSpline *point_spline;
|
MaskSpline *point_spline;
|
||||||
MaskSplinePoint *point = NULL;
|
MaskSplinePoint *point = NULL;
|
||||||
float dist, co[2];
|
float dist = FLT_MAX, co[2];
|
||||||
int width, height;
|
int width, height;
|
||||||
float u;
|
float u;
|
||||||
float scalex, scaley;
|
float scalex, scaley;
|
||||||
@@ -125,7 +125,7 @@ static int find_nearest_diff_point(const bContext *C, Mask *mask, const float no
|
|||||||
|
|
||||||
cur_dist = dist_to_line_segment_v2(co, a, b);
|
cur_dist = dist_to_line_segment_v2(co, a, b);
|
||||||
|
|
||||||
if (point == NULL || cur_dist < dist) {
|
if (cur_dist < dist) {
|
||||||
if (tangent)
|
if (tangent)
|
||||||
sub_v2_v2v2(tangent, &diff_points[2 * i + 2], &diff_points[2 * i]);
|
sub_v2_v2v2(tangent, &diff_points[2 * i + 2], &diff_points[2 * i]);
|
||||||
|
|
||||||
|
@@ -709,9 +709,9 @@ static void mesh_octree_add_nodes(MocNode **basetable, const float co[3], const
|
|||||||
float fx, fy, fz;
|
float fx, fy, fz;
|
||||||
int vx, vy, vz;
|
int vx, vy, vz;
|
||||||
|
|
||||||
if (!finite(co[0]) ||
|
if ((finite(co[0]) == FALSE) ||
|
||||||
!finite(co[1]) ||
|
(finite(co[1]) == FALSE) ||
|
||||||
!finite(co[2]))
|
(finite(co[2]) == FALSE))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -940,9 +940,9 @@ static BMVert *editbmesh_get_x_mirror_vert_spatial(Object *ob, BMEditMesh *em, c
|
|||||||
intptr_t poinval;
|
intptr_t poinval;
|
||||||
|
|
||||||
/* ignore nan verts */
|
/* ignore nan verts */
|
||||||
if (!finite(co[0]) ||
|
if ((finite(co[0]) == FALSE) ||
|
||||||
!finite(co[1]) ||
|
(finite(co[1]) == FALSE) ||
|
||||||
!finite(co[2]))
|
(finite(co[2]) == FALSE))
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@@ -152,6 +152,7 @@ void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(m
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
static void bfree(VBVHTree *tree)
|
static void bfree(VBVHTree *tree)
|
||||||
{
|
{
|
||||||
if (tot_pushup + tot_pushdown + tot_hints + tot_moves) {
|
if (tot_pushup + tot_pushdown + tot_hints + tot_moves) {
|
||||||
@@ -169,6 +170,7 @@ static void bfree(VBVHTree *tree)
|
|||||||
}
|
}
|
||||||
bvh_free(tree);
|
bvh_free(tree);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* the cast to pointer function is needed to workarround gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11407 */
|
/* the cast to pointer function is needed to workarround gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11407 */
|
||||||
template<class Tree, int STACK_SIZE>
|
template<class Tree, int STACK_SIZE>
|
||||||
|
Reference in New Issue
Block a user