Skip to content

Commit 788e654

Browse files
author
jef
committedApr 11, 2009
fix various warnings
git-svn-id: http://svn.osgeo.org/qgis/trunk@10535 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 2d76de3 commit 788e654

File tree

9 files changed

+97
-92
lines changed

9 files changed

+97
-92
lines changed
 

‎src/core/pal/feature.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ namespace pal
558558
int it;
559559

560560
double dlx, dly; // delta from label center and bottom-left corner
561-
double alpha; // rotation for the label
561+
double alpha = 0.0; // rotation for the label
562562
double px, py;
563563
double dx;
564564
double dy;

‎src/core/pal/pointset.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ namespace pal
347347
double startX, startY;
348348
double stopX, stopY;
349349

350-
bool seg_complete;
350+
bool seg_complete = false;
351351

352352
Crossing *crossing;
353353
startX = x[0];
@@ -712,7 +712,8 @@ namespace pal
712712
b = tmp;
713713
}
714714
// split shape into two new shape
715-
if (( newShape = shape->extractPath( path_a, nbPtPathA, nbBboxPoint, bbx, bby, b, a, ( b->pt + 1 ) % shape->nbPoints ) ) )
715+
newShape = shape->extractPath( path_a, nbPtPathA, nbBboxPoint, bbx, bby, b, a, ( b->pt + 1 ) % shape->nbPoints );
716+
if ( newShape )
716717
{
717718
if ( path_a == -1 ) // new shape inside => push into shapes_final
718719
{
@@ -724,7 +725,8 @@ namespace pal
724725
}
725726
}
726727

727-
if (( newShape = shape->extractPath( path_b, nbPtPathB, nbBboxPoint, bbx, bby, a, b, ( a->pt + 1 ) % shape->nbPoints ) ) )
728+
newShape = shape->extractPath( path_b, nbPtPathB, nbBboxPoint, bbx, bby, a, b, ( a->pt + 1 ) % shape->nbPoints );
729+
if ( newShape )
728730
{
729731
if ( path_b == -1 )
730732
{
@@ -1052,7 +1054,7 @@ namespace pal
10521054
// retainedPt = deppest point in hole
10531055
// bestArea = area of triangle HoleS->holeE->retainedPoint
10541056
bestArea = sqrt( bestArea );
1055-
double cx, cy, dx, dy, ex, ey, fx, fy, seg_length, ptx, pty, fptx = 0, fpty = 0;
1057+
double cx, cy, dx, dy, ex, ey, fx, fy, seg_length, ptx = 0, pty = 0, fptx = 0, fpty = 0;
10561058
int ps = -1, pe = -1, fps = -1, fpe = -1;
10571059
if ( retainedPt >= 0 && bestArea > labelArea ) // there is a hole so we'll cut the shape in two new shape (only if hole area is bigger than twice labelArea)
10581060
{

‎src/core/pal/problem.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
#include "util.h"
6060
#include "priorityqueue.h"
6161

62-
62+
#define UNUSED(x) (void)x;
6363

6464
namespace pal
6565
{
@@ -720,7 +720,6 @@ namespace pal
720720

721721
bool subPartCallback( LabelPosition *lp, void *ctx )
722722
{
723-
int lpid = lp->id;
724723
int *isIn = (( SubPartContext* ) ctx )->isIn;
725724
LinkedList<int> *queue = (( SubPartContext* ) ctx )->queue;
726725

@@ -1749,7 +1748,7 @@ namespace pal
17491748
#ifdef _DEBUG_FULL_
17501749
std::cout << "catch int " << i << std::endl;
17511750
#else
1752-
i;
1751+
UNUSED(i);
17531752
#endif
17541753
while ( conflicts->size() > 0 )
17551754
conflicts->pop_front();
@@ -2053,7 +2052,7 @@ namespace pal
20532052
#ifdef _DEBUG_FULL_
20542053
std::cout << "catch Cycle in chain" << std::endl;
20552054
#else
2056-
i;
2055+
UNUSED(i);
20572056
#endif
20582057
while ( conflicts->size() > 0 )
20592058
conflicts->pop_front();
@@ -2197,7 +2196,8 @@ namespace pal
21972196
{
21982197
seed = ( it % probSize ) + borderSize;
21992198

2200-
if (( current_chain = chain( part, seed ) ) )
2199+
current_chain = chain( part, seed );
2200+
if ( current_chain )
22012201
{
22022202

22032203
/* we accept a modification only if the seed is not tabu or

‎src/core/pal/rtree.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ namespace pal {
13551355

13561356
// Search in an index tree or subtree for all data retangles that overlap the argument rectangle.
13571357
RTREE_TEMPLATE
1358-
bool RTREE_QUAL::Search (Node* a_node, Rect* a_rect, int& a_foundCount, bool a_resultCallback (DATATYPE a_data, void* a_context), void* a_context) {
1358+
bool RTREE_QUAL::Search (Node* a_node, Rect* a_rect, int& a_foundCount, bool (*a_resultCallback)(DATATYPE a_data, void* a_context), void* a_context) {
13591359
ASSERT (a_node);
13601360
ASSERT (a_node->m_level >= 0);
13611361
ASSERT (a_rect);
@@ -1374,7 +1374,7 @@ namespace pal {
13741374
DATATYPE& id = a_node->m_branch[index].m_data;
13751375

13761376
// NOTE: There are different ways to return results. Here's where to modify
1377-
if (&a_resultCallback) {
1377+
if (a_resultCallback) {
13781378
++a_foundCount;
13791379
if (!a_resultCallback (id, a_context)) {
13801380
return false; // Don't continue searching

‎src/core/pal/util.h

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,13 @@ namespace pal
157157
case pal::FOOT:
158158
return (( x / double( dpi ) )*12 ) * scale;
159159
case pal::DEGREE:
160-
double iw = degree2meter( delta_canvas_width ) * 39.3700787;
161-
return ( x * delta_canvas_width * scale ) / ( iw * dpi );
160+
{
161+
double iw = degree2meter( delta_canvas_width ) * 39.3700787;
162+
return ( x * delta_canvas_width * scale ) / ( iw * dpi );
163+
}
164+
default:
165+
fprintf( stderr, "Target unit undefined\n" );
166+
return 0.0;
162167
}
163168
break;
164169
case pal::METER:
@@ -169,8 +174,13 @@ namespace pal
169174
case pal::FOOT:
170175
return x / 0.3048;
171176
case pal::DEGREE:
172-
double mw = degree2meter( delta_canvas_width );
173-
return ( x * delta_canvas_width ) / mw;
177+
{
178+
double mw = degree2meter( delta_canvas_width );
179+
return ( x * delta_canvas_width ) / mw;
180+
}
181+
default:
182+
fprintf( stderr, "Target unit undefined\n" );
183+
return 0.0;
174184
}
175185
break;
176186
case pal::FOOT:
@@ -181,27 +191,39 @@ namespace pal
181191
case pal::METER:
182192
return x*0.3048;
183193
case pal::DEGREE:
184-
double iw = degree2meter( delta_canvas_width ) * 39.3700787;
185-
return ( x * delta_canvas_width ) / iw;
194+
{
195+
double iw = degree2meter( delta_canvas_width ) * 39.3700787;
196+
return ( x * delta_canvas_width ) / iw;
197+
}
198+
default:
199+
fprintf( stderr, "Target unit undefined\n" );
200+
return 0.0;
186201
}
187202
break;
188203
case pal::DEGREE:
189204
switch ( to )
190205
{
191206
case pal::PIXEL:
192-
fprintf( stderr, "Degree to pixel not yet implemented" );
207+
fprintf( stderr, "Degree to pixel not yet implemented\n" );
193208
break;
194209
case pal::METER:
195-
fprintf( stderr, "Degree to meter not yet implemented" );
210+
fprintf( stderr, "Degree to meter not yet implemented\n" );
196211
break;
197212
case pal::FOOT:
198-
fprintf( stderr, "Degree to foot not yet implemented" );
213+
fprintf( stderr, "Degree to foot not yet implemented\n" );
199214
break;
215+
default:
216+
fprintf( stderr, "Target unit undefined\n" );
217+
return 0.0;
200218
}
201219
break;
220+
default:
221+
fprintf( stderr, "Source unit undefined" );
222+
return 0.0;
223+
202224
}
203225

204-
fprintf( stderr, "Unable to convert. Unknown units" );
226+
fprintf( stderr, "Unable to convert. Unknown units\n" );
205227
return 0.0;
206228
}
207229

‎src/core/qgspalobjectpositionmanager.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ void QgsPALObjectPositionManager::addLayer( QgsVectorLayer* vl, QList<QgsVectorO
6767
}
6868

6969
//register the labeling objects in the layer
70-
QgsVectorOverlay* currentOverlay = 0;
7170
int objectNr = 0;
7271
QList<QgsVectorOverlay*>::const_iterator overlayIt = overlays.begin();
7372
for ( ; overlayIt != overlays.end(); ++overlayIt )
@@ -114,6 +113,8 @@ void QgsPALObjectPositionManager::findObjectPositions( const QgsRenderContext& r
114113
case QGis::Degrees:
115114
mapUnits = pal::DEGREE;
116115
break;
116+
default:
117+
return;
117118
}
118119
mPositionEngine.setMapUnit( mapUnits );
119120
std::list<pal::Label*>* resultLabelList = mPositionEngine.labeller( renderContext.rendererScale(), bbox, &stat, true );

‎src/core/spatialite/spatialite.c

Lines changed: 47 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,13 +1502,11 @@ gaiaConvertCharset (char **buf, const char *fromCs, const char *toCs)
15021502
char utf8buf[65536];
15031503
#if defined(__MINGW32__) || defined(_WIN32)
15041504
const char *pBuf;
1505-
int len;
1506-
int utf8len;
15071505
#else /* not MINGW32 - WIN32 */
15081506
char *pBuf;
1507+
#endif
15091508
size_t len;
15101509
size_t utf8len;
1511-
#endif
15121510
char *pUtf8buf;
15131511
iconv_t cvt = iconv_open (toCs, fromCs);
15141512
if (cvt == (iconv_t) - 1)
@@ -1554,13 +1552,11 @@ gaiaConvertToUTF8 (void *cvtCS, const char *buf, int buflen, int *err)
15541552
char *utf8buf = 0;
15551553
#if defined(__MINGW32__) || defined(_WIN32)
15561554
const char *pBuf;
1557-
int len;
1558-
int utf8len;
15591555
#else
15601556
char *pBuf;
1557+
#endif
15611558
size_t len;
15621559
size_t utf8len;
1563-
#endif
15641560
int maxlen = buflen * 4;
15651561
char *pUtf8buf;
15661562
*err = 0;
@@ -2727,10 +2723,10 @@ exifParseTag (const unsigned char *blob, unsigned int offset, int endian_mode,
27272723
type = exifImportU16 (blob + offset + 2, endian_mode, endian_arch);
27282724
count = exifImportU32 (blob + offset + 4, endian_mode, endian_arch);
27292725
tag = malloc (sizeof (gaiaExifTag));
2730-
tag->Gps = gps;
2726+
tag->Gps = (char) gps;
27312727
tag->TagId = tag_id;
27322728
tag->Type = type;
2733-
tag->Count = count;
2729+
tag->Count = (unsigned short) count;
27342730
memcpy (tag->TagOffset, blob + offset + 8, 4);
27352731
tag->ByteValue = NULL;
27362732
tag->StringValue = NULL;
@@ -4228,22 +4224,18 @@ gaiaMeasureLength (double *coords, int vert)
42284224
double y;
42294225
double dist;
42304226
int ind;
4231-
for (ind = 0; ind < vert; ind++)
4227+
4228+
gaiaGetPoint (coords, 0, &xx1, &yy1);
4229+
4230+
for (ind = 1; ind < vert; ind++)
42324231
{
4233-
if (ind == 0)
4234-
{
4235-
gaiaGetPoint (coords, ind, &xx1, &yy1);
4236-
}
4237-
else
4238-
{
42394232
gaiaGetPoint (coords, ind, &xx2, &yy2);
42404233
x = xx1 - xx2;
42414234
y = yy1 - yy2;
42424235
dist = sqrt ((x * x) + (y * y));
42434236
lung += dist;
42444237
xx1 = xx2;
42454238
yy1 = yy2;
4246-
}
42474239
}
42484240
return lung;
42494241
}
@@ -4371,10 +4363,6 @@ gaiaIsPointOnRingSurface (gaiaRingPtr ring, double pt_x, double pt_y)
43714363
if (y > maxy)
43724364
maxy = y;
43734365
}
4374-
if (x < minx || x > maxx)
4375-
goto end; /* outside the bounding box (x axis) */
4376-
if (y < miny || y > maxy)
4377-
goto end; /* outside the bounding box (y axis) */
43784366
for (i = 0, j = cnt - 1; i < cnt; j = i++)
43794367
{
43804368
/* The definitive reference is "Point in Polyon Strategies" by
@@ -4383,14 +4371,13 @@ gaiaIsPointOnRingSurface (gaiaRingPtr ring, double pt_x, double pt_y)
43834371
/ incorrect.
43844372
*/
43854373
if ((((vert_y[i] <= pt_y) && (pt_y < vert_y[j]))
4386-
|| ((vert_y[j] <= pt_y) && (y < vert_y[i])))
4374+
|| ((vert_y[j] <= pt_y) && (pt_y < vert_y[i])))
43874375
&& (pt_x <
43884376
(vert_x[j] - vert_x[i]) * (pt_y - vert_y[i]) / (vert_y[j] -
43894377
vert_y[i]) +
43904378
vert_x[i]))
43914379
isInternal = !isInternal;
43924380
}
4393-
end:
43944381
free (vert_x);
43954382
free (vert_y);
43964383
return isInternal;
@@ -6277,21 +6264,18 @@ gaiaIsEmpty (gaiaGeomCollPtr geom)
62776264
{
62786265
/* checks for points */
62796266
return 0;
6280-
point = point->Next;
62816267
}
62826268
line = geom->FirstLinestring;
62836269
while (line)
62846270
{
62856271
/* checks for linestrings */
62866272
return 0;
6287-
line = line->Next;
62886273
}
62896274
polyg = geom->FirstPolygon;
62906275
while (polyg)
62916276
{
62926277
/* checks for polygons */
62936278
return 0;
6294-
polyg = polyg->Next;
62956279
}
62966280
return 1;
62976281
}
@@ -9514,8 +9498,8 @@ gaiaFlushShpHeaders (gaiaShapefilePtr shp)
95149498
*(buf_shp + 2) = 1;
95159499
*(buf_shp + 3) = 1;
95169500
gaiaExport32 (buf_shp + 4, dbf_recno, GAIA_LITTLE_ENDIAN, endian_arch); /* exports # records in this DBF */
9517-
gaiaExport16 (buf_shp + 8, dbf_size, GAIA_LITTLE_ENDIAN, endian_arch); /* exports the file header size */
9518-
gaiaExport16 (buf_shp + 10, dbf_reclen, GAIA_LITTLE_ENDIAN, endian_arch); /* exports the record length */
9501+
gaiaExport16 (buf_shp + 8, (short) dbf_size, GAIA_LITTLE_ENDIAN, endian_arch); /* exports the file header size */
9502+
gaiaExport16 (buf_shp + 10, (short) dbf_reclen, GAIA_LITTLE_ENDIAN, endian_arch); /* exports the record length */
95199503
fwrite (buf_shp, 1, 32, fl_dbf);
95209504
}
95219505

@@ -10531,8 +10515,8 @@ gaiaFromSpatiaLiteBlobWkb (const unsigned char *blob, unsigned int size)
1053110515
type = gaiaImport32 (blob + 39, little_endian, endian_arch);
1053210516
geo = gaiaAllocGeomColl ();
1053310517
geo->Srid = gaiaImport32 (blob + 2, little_endian, endian_arch);
10534-
geo->endian_arch = endian_arch;
10535-
geo->endian = little_endian;
10518+
geo->endian_arch = (char) endian_arch;
10519+
geo->endian = (char) little_endian;
1053610520
geo->blob = blob;
1053710521
geo->size = size;
1053810522
geo->offset = 43;
@@ -10956,8 +10940,8 @@ gaiaFromWkb (const unsigned char *blob, unsigned int size)
1095610940
type = gaiaImport32 (blob + 1, little_endian, endian_arch);
1095710941
geo = gaiaAllocGeomColl ();
1095810942
geo->Srid = -1;
10959-
geo->endian_arch = endian_arch;
10960-
geo->endian = little_endian;
10943+
geo->endian_arch = (char) endian_arch;
10944+
geo->endian = (char) little_endian;
1096110945
geo->blob = blob;
1096210946
geo->size = size;
1096310947
geo->offset = 5;
@@ -11360,7 +11344,7 @@ polygonFromFgf (gaiaGeomCollPtr geom, int endian_arch,
1136011344
unsigned int *consumed)
1136111345
{
1136211346
/* decoding a POLYGON Geometry from FGF */
11363-
gaiaPolygonPtr pg;
11347+
gaiaPolygonPtr pg = NULL;
1136411348
gaiaRingPtr rng;
1136511349
int rings;
1136611350
int ir;
@@ -13638,27 +13622,25 @@ SvgPathRelative (int points, double *coords, char **buffer, int *size,
1363813622
char buf[256];
1363913623
double x;
1364013624
double y;
13641-
double lastX;
13642-
double lastY;
13625+
double lastX = 0.0;
13626+
double lastY = 0.0;
1364313627
int iv;
1364413628
for (iv = 0; iv < points; iv++)
1364513629
{
1364613630
gaiaGetPoint (coords, iv, &x, &y);
1364713631
gaiaOutCheckBuffer (buffer, size);
13632+
13633+
sprintf (buf_x, "%.*f", precision, x - lastX);
13634+
gaiaOutClean (buf_x);
13635+
sprintf (buf_y, "%.*f", precision, lastY - y);
13636+
gaiaOutClean (buf_y);
13637+
1364813638
if (iv == 0)
1364913639
{
13650-
sprintf (buf_x, "%.*f", precision, x);
13651-
gaiaOutClean (buf_x);
13652-
sprintf (buf_y, "%.*f", precision, y * -1);
13653-
gaiaOutClean (buf_y);
1365413640
sprintf (buf, "M %s %s l ", buf_x, buf_y);
1365513641
}
1365613642
else
1365713643
{
13658-
sprintf (buf_x, "%.*f", precision, (x - lastX));
13659-
gaiaOutClean (buf_x);
13660-
sprintf (buf_y, "%.*f", precision, (y - lastY) * -1);
13661-
gaiaOutClean (buf_y);
1366213644
sprintf (buf, "%s %s ", buf_x, buf_y);
1366313645
}
1366413646
lastX = x;
@@ -14008,10 +13990,10 @@ fnct_GeometryConstraints (sqlite3_context * context, int argc,
1400813990
unsigned char *p_blob = NULL;
1400913991
int n_bytes = 0;
1401013992
int srid;
14011-
int geom_srid;
13993+
int geom_srid = -1;
1401213994
const unsigned char *type;
1401313995
int xtype;
14014-
int geom_type;
13996+
int geom_type = -1;
1401513997
int ret;
1401613998
if (sqlite3_value_type (argv[0]) == SQLITE_BLOB
1401713999
|| sqlite3_value_type (argv[0]) == SQLITE_NULL)
@@ -14752,8 +14734,8 @@ updateGeometryTriggers (sqlite3 * sqlite, const unsigned char *table,
1475214734
len = strlen ((char *) colname);
1475314735
curr_idx->ColumnName = malloc (len + 1);
1475414736
strcpy (curr_idx->ColumnName, (char *) colname);
14755-
curr_idx->ValidRtree = index;
14756-
curr_idx->ValidCache = cached;
14737+
curr_idx->ValidRtree = (char) index;
14738+
curr_idx->ValidCache = (char) cached;
1475714739
curr_idx->Next = NULL;
1475814740
if (!first_idx)
1475914741
first_idx = curr_idx;
@@ -21133,8 +21115,10 @@ fnct_math_cot (sqlite3_context * context, int argc, sqlite3_value ** argv)
2113321115
int_value = sqlite3_value_int (argv[0]);
2113421116
x = int_value;
2113521117
}
21136-
else
21118+
else {
2113721119
sqlite3_result_null (context);
21120+
return;
21121+
}
2113821122
tang = tan (x);
2113921123
if (tang == 0.0)
2114021124
{
@@ -21164,8 +21148,11 @@ fnct_math_degrees (sqlite3_context * context, int argc, sqlite3_value ** argv)
2116421148
x = int_value;
2116521149
}
2116621150
else
21167-
sqlite3_result_null (context);
21168-
x = x * 57.29577951308232;
21151+
{
21152+
sqlite3_result_null (context);
21153+
return;
21154+
}
21155+
x *= 57.29577951308232;
2116921156
sqlite3_result_double (context, x);
2117021157
}
2117121158

@@ -21267,8 +21254,8 @@ fnct_math_logn2 (sqlite3_context * context, int argc, sqlite3_value ** argv)
2126721254
/ or NULL if any error is encountered
2126821255
*/
2126921256
int int_value;
21270-
double x;
21271-
double b;
21257+
double x = 0.0;
21258+
double b = 1.0;
2127221259
double log1;
2127321260
double log2;
2127421261
errno = 0;
@@ -22373,7 +22360,7 @@ void
2237322360
spatialite_init (int verbose)
2237422361
{
2237522362
/* used when SQLite initializes SpatiaLite via statically linked lib */
22376-
sqlite3_auto_extension ((void *) init_static_spatialite);
22363+
sqlite3_auto_extension ( (void (*)(void)) init_static_spatialite);
2237722364
if (verbose)
2237822365
{
2237922366
printf ("SpatiaLite version ..: %s", spatialite_version ());
@@ -22863,9 +22850,7 @@ SPATIALITE_DECLARE sqlite3_int64
2286322850
math_llabs (sqlite3_int64 value)
2286422851
{
2286522852
/* replacing the C99 llabs() function */
22866-
double dbl = value;
22867-
sqlite3_int64 int_value = fabs (dbl);
22868-
return (int_value);
22853+
return value<0 ? -value : value;
2286922854
}
2287022855

2287122856
SPATIALITE_DECLARE double
@@ -24403,8 +24388,6 @@ vshp_create (sqlite3 * db, void *pAux, int argc, const char *const *argv,
2440324388
}
2440424389
*ppVTab = (sqlite3_vtab *) p_vt;
2440524390
return SQLITE_OK;
24406-
*pzErr = sqlite3_mprintf ("%s", p_vt->Shp->LastError);
24407-
return SQLITE_ERROR;
2440824391
}
2440924392
if (p_vt->Shp->
2441024393
Shape == 3
@@ -25699,7 +25682,7 @@ network_block (NetworkPtr graph, const unsigned char *blob, int size)
2569925682
int ia;
2570025683
int index;
2570125684
char code[256];
25702-
int nodeId;
25685+
int nodeId = -1;
2570325686
int arcs;
2570425687
NetworkNodePtr pN;
2570525688
NetworkArcPtr pA;
@@ -27968,13 +27951,13 @@ text_parse (char *path, char *encoding, char first_line_titles,
2796827951
/* parsing the file, one char at each time */
2796927952
if (c == '\r' && !is_string)
2797027953
{
27971-
last = c;
27954+
last = (char) c;
2797227955
continue;
2797327956
}
2797427957
if (c == field_separator && !is_string)
2797527958
{
2797627959
/* insering a field into the fields tmp array */
27977-
last = c;
27960+
last = (char) c;
2797827961
*p = '\0';
2797927962
len = strlen (buffer);
2798027963
if (len)
@@ -27993,7 +27976,7 @@ text_parse (char *path, char *encoding, char first_line_titles,
2799327976
if (is_string)
2799427977
{
2799527978
is_string = 0;
27996-
last = c;
27979+
last = (char) c;
2799727980
}
2799827981
else
2799927982
{
@@ -28003,7 +27986,7 @@ text_parse (char *path, char *encoding, char first_line_titles,
2800327986
}
2800427987
continue;
2800527988
}
28006-
last = c;
27989+
last = (char) c;
2800727990
if (c == '\n' && !is_string)
2800827991
{
2800927992
/* inserting the row into the text buffer */
@@ -28032,7 +28015,7 @@ text_parse (char *path, char *encoding, char first_line_titles,
2803228015
fld = 0;
2803328016
continue;
2803428017
}
28035-
*p++ = c;
28018+
*p++ = (char) c;
2803628019
}
2803728020
fclose (in);
2803828021
/* checking if the text file really seems to contain a table */
@@ -28207,7 +28190,7 @@ text_parse (char *path, char *encoding, char first_line_titles,
2820728190
return NULL;
2820828191
}
2820928192
/* ok, we can now go to prepare the rows array */
28210-
text->rows = malloc (sizeof (struct text_row *) * text->n_rows);
28193+
text->rows = malloc (sizeof (struct row_buffer *) * text->n_rows);
2821128194
ir = 0;
2821228195
row = text->first;
2821328196
while (row)

‎src/plugins/diagram_overlay/qgsdiagramoverlay.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ void QgsDiagramOverlay::createOverlayObjects( const QgsRenderContext& renderCont
8686
std::list<unsigned char*>::iterator bufferIt;
8787
std::list<int>::iterator sizeIt;
8888

89-
int multifeaturecounter = 0;
90-
9189
while ( theProvider->nextFeature( currentFeature ) )
9290
{
9391
//todo: insert more objects for multipart features
@@ -195,7 +193,7 @@ bool QgsDiagramOverlay::readXML( const QDomNode& overlayNode )
195193
for ( int i = 0; i < classificationFieldList.size(); ++i )
196194
{
197195
bool conversionSuccess = false;
198-
int classificationField = classificationFieldList.at( i ).toElement().text().toInt( &conversionSuccess );
196+
classificationFieldList.at( i ).toElement().text().toInt( &conversionSuccess );
199197
if ( conversionSuccess )
200198
{
201199
classAttrList.push_back( classificationFieldList.at( i ).toElement().text().toInt() );

‎src/providers/spatialite/qgsspatialiteprovider.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const QString SPATIALITE_DESCRIPTION = "SpatiaLite data provider";
4242
QMap < QString, QgsSpatiaLiteProvider::SqliteHandles * >QgsSpatiaLiteProvider::SqliteHandles::handles;
4343

4444
QgsSpatiaLiteProvider::QgsSpatiaLiteProvider( QString const &uri ): QgsVectorDataProvider( uri ),
45-
geomType( QGis::WKBUnknown ), mSrid( -1 ), spatialIndexRTree( false ), spatialIndexMbrCache( false ), sqliteHandle( NULL ), sqliteStatement( NULL )
45+
geomType( QGis::WKBUnknown ), mSrid( -1 ), spatialIndexRTree( false ), sqliteHandle( NULL ), spatialIndexMbrCache( false ), sqliteStatement( NULL )
4646
{
4747
QgsDataSourceURI mUri = QgsDataSourceURI( uri );
4848

@@ -346,7 +346,6 @@ bool QgsSpatiaLiteProvider::featureAtId( int featureId, QgsFeature & feature, bo
346346

347347
bool QgsSpatiaLiteProvider::nextFeature( QgsFeature & feature )
348348
{
349-
char xSql[1024];
350349
char geomName[128];
351350

352351
feature.setValid( false );

0 commit comments

Comments
 (0)
Please sign in to comment.