summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-08-11 20:24:38 +0000
committersleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-08-11 20:24:38 +0000
commit69c069069addb50f8fad2a388095b02ee8b34a68 (patch)
tree59ed13811aaef196aa8649fedf0a41e138516388
parent413c26cb56e84969988cd0a96f52fd9dabded3f5 (diff)
downloadnavit-69c069069addb50f8fad2a388095b02ee8b34a68.tar.gz
Fix:core:Fix warnings from unused variables.|Part of #1154.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5564 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r--navit/cache.c2
-rw-r--r--navit/command.c7
-rw-r--r--navit/geom.c2
-rw-r--r--navit/graphics.c1
-rw-r--r--navit/graphics/opengl/graphics_opengl.c16
-rw-r--r--navit/graphics/sdl/raster.c17
-rw-r--r--navit/gui/gtk/destination.c3
-rw-r--r--navit/map/csv/csv.c2
-rw-r--r--navit/map/shapefile/shapefile.c7
-rw-r--r--navit/maptool/buffer.c2
-rw-r--r--navit/maptool/osm.c2
-rw-r--r--navit/maptool/osm_protobuf.c5
-rw-r--r--navit/maptool/osm_xml.c4
-rw-r--r--navit/navigation.c3
-rw-r--r--navit/navit_nls.c2
-rw-r--r--navit/osd/core/osd_core.c1
-rw-r--r--navit/popup.c3
-rw-r--r--navit/sunriset.c4
18 files changed, 14 insertions, 69 deletions
diff --git a/navit/cache.c b/navit/cache.c
index e3f2f29d3..0596a65f6 100644
--- a/navit/cache.c
+++ b/navit/cache.c
@@ -391,8 +391,6 @@ cache_stats(struct cache *cache)
void
cache_dump(struct cache *cache)
{
- struct cache_entry *first;
- first=cache->t1.first;
cache_stats(cache);
cache_list_dump("T1", cache, &cache->t1);
cache_list_dump("B1", cache, &cache->b1);
diff --git a/navit/command.c b/navit/command.c
index d15ef4ae8..c39aff5b0 100644
--- a/navit/command.c
+++ b/navit/command.c
@@ -1195,7 +1195,7 @@ int
command_evaluate_single(struct context *ctx)
{
struct result res={{0,},},tmp={{0,},};
- const char *op,*a1,*a2,*a3,*f,*end;
+ const char *op,*a,*f,*end;
enum attr_type attr_type;
void *obj;
struct object_func *obj_func;
@@ -1220,7 +1220,7 @@ command_evaluate_single(struct context *ctx)
return 0;
}
ctx->skip=1;
- a1=ctx->expr;
+ a=ctx->expr;
eval_conditional(ctx, &res);
resolve_object(ctx, &res);
ctx->skip=skip;
@@ -1228,7 +1228,6 @@ command_evaluate_single(struct context *ctx)
ctx->error=missing_semicolon;
return 0;
}
- a2=ctx->expr;
eval_comma(ctx,&res);
attr_type=command_attr_type(&res);
obj=res.attr.u.data;
@@ -1263,7 +1262,7 @@ command_evaluate_single(struct context *ctx)
}
iter = obj_func->iter_new(NULL);
while (obj_func->get_attr(obj, attr_type, &attr, iter)) {
- ctx->expr=a1;
+ ctx->expr=a;
eval_conditional(ctx, &res);
resolve_object(ctx, &res);
tmp.attr=attr;
diff --git a/navit/geom.c b/navit/geom.c
index ba6074f63..876d13b94 100644
--- a/navit/geom.c
+++ b/navit/geom.c
@@ -361,13 +361,11 @@ int
geom_poly_segments_point_inside(GList *in, struct coord *c)
{
int open_matches=0,closed_matches=0;
- struct coord *cp;
#if 0
fprintf(stderr,"try 0x%x,0x%x:",c->x,c->y);
#endif
while (in) {
struct geom_poly_segment *seg=in->data;
- cp=seg->first;
if (geom_poly_point_inside(seg->first, seg->last-seg->first+1, c)) {
#if 0
fprintf(stderr," inside");
diff --git a/navit/graphics.c b/navit/graphics.c
index 47871fdbb..2b1671b53 100644
--- a/navit/graphics.c
+++ b/navit/graphics.c
@@ -1606,7 +1606,6 @@ graphics_draw_polyline_as_polygon(struct graphics_priv *gra_priv, struct graphic
for (i = 1 ; i < count -1 ; i++) {
draw_shape(&ctx, pnt+i, *width++);
if (ctx.npos < max_circle_points || ctx.ppos >= maxpoints-max_circle_points || !draw_middle(&ctx,&pnt[i])) {
- struct draw_polyline_shape shape=ctx.shape;
draw_end(&ctx,&pnt[i]);
ctx.res[ctx.npos]=ctx.res[ctx.ppos-1];
draw(gra_priv, gc_priv, ctx.res+ctx.npos, ctx.ppos-ctx.npos);
diff --git a/navit/graphics/opengl/graphics_opengl.c b/navit/graphics/opengl/graphics_opengl.c
index 7b368d068..204fab967 100644
--- a/navit/graphics/opengl/graphics_opengl.c
+++ b/navit/graphics/opengl/graphics_opengl.c
@@ -1155,7 +1155,6 @@ redraw_screen(struct graphics_priv *gr)
{
#ifdef USE_OPENGLES
#else
- time_t curr_time = time(0);
graphics_priv_root->dirty = 0;
glCallList(gr->DLid);
@@ -1462,27 +1461,12 @@ static struct graphics_priv *
overlay_new(struct graphics_priv *gr, struct graphics_methods *meth,
struct point *p, int w, int h, int alpha, int wraparound)
{
- int w2, h2;
struct graphics_priv *this = graphics_opengl_new_helper(meth);
this->p = *p;
this->width = w;
this->height = h;
this->parent = gr;
- /* If either height or width is 0, we set it to 1 to avoid warnings, and
- * disable the overlay. */
- if (h == 0) {
- h2 = 1;
- } else {
- h2 = h;
- }
-
- if (w == 0) {
- w2 = 1;
- } else {
- w2 = w;
- }
-
if ((w == 0) || (h == 0)) {
this->overlay_autodisabled = 1;
} else {
diff --git a/navit/graphics/sdl/raster.c b/navit/graphics/sdl/raster.c
index d0c0432c2..d7c5f8f24 100644
--- a/navit/graphics/sdl/raster.c
+++ b/navit/graphics/sdl/raster.c
@@ -950,9 +950,8 @@ void raster_line(SDL_Surface *dst, int16_t x1, int16_t y1, int16_t x2, int16_t y
static void raster_aalineColorInt(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color, int draw_endpoint)
{
Sint32 xx0, yy0, xx1, yy1;
- int result;
Uint32 intshift, erracc, erradj;
- Uint32 erracctmp, wgt, wgtcompmask;
+ Uint32 erracctmp, wgt;
int dx, dy, tmp, xdir, y0p1, x0pxdir;
/*
@@ -1029,11 +1028,6 @@ static void raster_aalineColorInt(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint1
}
/*
- * Line is not horizontal, vertical or diagonal
- */
- result = 0;
-
- /*
* Zero accumulator
*/
erracc = 0;
@@ -1042,10 +1036,6 @@ static void raster_aalineColorInt(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint1
* # of bits by which to shift erracc to get intensity level
*/
intshift = 32 - AAbits;
- /*
- * Mask used to flip all bits in an intensity weighting
- */
- wgtcompmask = AAlevels - 1;
/* Lock surface */
if (SDL_MUSTLOCK(dst)) {
@@ -1169,7 +1159,6 @@ void raster_circle(SDL_Surface *dst, int16_t x, int16_t y, int16_t r, uint32_t c
{
/* sdl-gfx */
Sint16 left, right, top, bottom;
- int result;
Sint16 x1, y1, x2, y2;
Sint16 cx = 0;
Sint16 cy = r;
@@ -1230,7 +1219,6 @@ void raster_circle(SDL_Surface *dst, int16_t x, int16_t y, int16_t r, uint32_t c
/*
* Draw
*/
- result = 0;
do {
xpcx = x + cx;
xmcx = x - cx;
@@ -1825,7 +1813,6 @@ void raster_aapolygon(SDL_Surface *dst, int16_t n, int16_t *vx, int16_t *vy, uin
the output is not perfect yet but usually looks better than aliasing
*/
- int result;
int i;
int y, xa, xb;
int miny, maxy;
@@ -1868,7 +1855,6 @@ void raster_aapolygon(SDL_Surface *dst, int16_t n, int16_t *vx, int16_t *vy, uin
/*
* Draw
*/
- result = 0;
for (i = 1; i < n; i++) {
raster_aalineColorInt(dst, *px1, *py1, *px2, *py2, color, 0);
px1 = px2;
@@ -1945,7 +1931,6 @@ void raster_aapolygon(SDL_Surface *dst, int16_t n, int16_t *vx, int16_t *vy, uin
/*
* Draw, scanning y
*/
- result = 0;
for (y = miny; (y <= maxy); y++) {
ints = 0;
for (i = 0; (i < n); i++) {
diff --git a/navit/gui/gtk/destination.c b/navit/gui/gtk/destination.c
index 92236fc3e..4cac3bf65 100644
--- a/navit/gui/gtk/destination.c
+++ b/navit/gui/gtk/destination.c
@@ -453,7 +453,6 @@ int destination_address(struct navit *nav)
GtkWidget *label_country;
GtkWidget *label_postal, *label_city, *label_district;
GtkWidget *label_street, *label_number;
- GtkWidget *hseparator1,*hseparator2;
GtkWidget *button1,*button2,*button3;
int i;
struct search_param *search=&search_param;
@@ -485,7 +484,6 @@ int destination_address(struct navit *nav)
search->entry_district = gtk_entry_new();
gtk_widget_set_sensitive(GTK_WIDGET(search->entry_district), FALSE);
label_district = gtk_label_new(_("District/Township"));
- hseparator1 = gtk_vseparator_new();
search->entry_street = gtk_entry_new();
gtk_widget_set_sensitive(GTK_WIDGET(search->entry_street), FALSE);
label_street = gtk_label_new(_("Street"));
@@ -513,7 +511,6 @@ int destination_address(struct navit *nav)
- hseparator2 = gtk_vseparator_new();
button1 = gtk_button_new_with_label(_("Map"));
button2 = gtk_button_new_with_label(_("Bookmark"));
button3 = gtk_button_new_with_label(_("Destination"));
diff --git a/navit/map/csv/csv.c b/navit/map/csv/csv.c
index f60f99563..9aedd0029 100644
--- a/navit/map/csv/csv.c
+++ b/navit/map/csv/csv.c
@@ -672,7 +672,6 @@ static struct map_priv *
map_new_csv(struct map_methods *meth, struct attr **attrs, struct callback_list *cbl)
{
struct map_priv *m = NULL;
- struct attr *item_type;
struct attr *attr_types;
struct attr *item_type_attr;
struct attr *data;
@@ -688,7 +687,6 @@ map_new_csv(struct map_methods *meth, struct attr **attrs, struct callback_list
m->qitem_hash = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, quadtree_item_free_do);
m->tree_root = tree_root;
- item_type = attr_search(attrs, NULL, attr_item_type);
attr_types = attr_search(attrs, NULL, attr_attr_types);
if(attr_types) {
enum attr_type* at = attr_types->u.attr_types;
diff --git a/navit/map/shapefile/shapefile.c b/navit/map/shapefile/shapefile.c
index 03f223cd4..7f4872d62 100644
--- a/navit/map/shapefile/shapefile.c
+++ b/navit/map/shapefile/shapefile.c
@@ -367,30 +367,25 @@ static void
process_fields(struct map_priv *m, int id)
{
int i;
- char szTitle[12],*pszTypeName,*str;
+ char szTitle[12],*str;
int nWidth, nDecimals;
for (i = 0 ; i < m->nFields ; i++) {
switch (DBFGetFieldInfo(m->hDBF, i, szTitle, &nWidth, &nDecimals )) {
case FTString:
- pszTypeName = "String";
str=g_strdup(DBFReadStringAttribute( m->hDBF, id, i ));
break;
case FTInteger:
- pszTypeName = "Integer";
str=g_strdup_printf("%d",DBFReadIntegerAttribute( m->hDBF, id, i ));
break;
case FTDouble:
- pszTypeName = "Double";
str=g_strdup_printf("%lf",DBFReadDoubleAttribute( m->hDBF, id, i ));
break;
case FTInvalid:
- pszTypeName = "Invalid";
str=NULL;
break;
default:
- pszTypeName = "Unknown";
str=NULL;
}
longest_match_add_key_value(m->lm, szTitle, str);
diff --git a/navit/maptool/buffer.c b/navit/maptool/buffer.c
index 5f7c39505..e8cd3a191 100644
--- a/navit/maptool/buffer.c
+++ b/navit/maptool/buffer.c
@@ -39,7 +39,6 @@ load_buffer(char *filename, struct buffer *b, long long offset, long long size)
{
FILE *f;
long long len;
- int ret;
if (b->base)
free(b->base);
b->malloced=0;
@@ -48,7 +47,6 @@ load_buffer(char *filename, struct buffer *b, long long offset, long long size)
len=ftell(f);
if (offset+size > len) {
size=len-offset;
- ret=1;
}
b->size=b->malloced=size;
#if 0
diff --git a/navit/maptool/osm.c b/navit/maptool/osm.c
index 45af7032b..2d1446c7e 100644
--- a/navit/maptool/osm.c
+++ b/navit/maptool/osm.c
@@ -1830,7 +1830,6 @@ osm_process_town_by_is_in(struct item_bin *ib,char *is_in, struct attr *attrs, G
{
struct country_table *result=NULL, *lookup;
char *tok,*dup=g_strdup(is_in),*buf=dup;
- int conflict;
int find_town_name = 0;
@@ -1850,7 +1849,6 @@ osm_process_town_by_is_in(struct item_bin *ib,char *is_in, struct attr *attrs, G
if (result && result->countryid != lookup->countryid) {
char *label=item_bin_get_attr(ib, attr_town_name, NULL);
osm_warning("node",item_bin_get_nodeid(ib),0,"conflict for %s is_in=%s country %d vs %d\n", label, is_in, lookup->countryid, result->countryid);
- conflict=1;
}
result=lookup;
}
diff --git a/navit/maptool/osm_protobuf.c b/navit/maptool/osm_protobuf.c
index 30d34bb98..1f93e02ac 100644
--- a/navit/maptool/osm_protobuf.c
+++ b/navit/maptool/osm_protobuf.c
@@ -203,7 +203,7 @@ process_dense(OSMPBF__PrimitiveBlock *primitive_block, OSMPBF__DenseNodes *dense
{
int i,j=0,has_tags;
long long id=0,lat=0,lon=0,changeset=0,timestamp=0;
- int version,user_sid=0,uid=0;
+ int user_sid=0,uid=0;
if (!dense)
return;
@@ -212,7 +212,6 @@ process_dense(OSMPBF__PrimitiveBlock *primitive_block, OSMPBF__DenseNodes *dense
id+=dense->id[i];
lat+=dense->lat[i];
lon+=dense->lon[i];
- version=dense->denseinfo->version[i];
changeset+=dense->denseinfo->changeset[i];
user_sid+=dense->denseinfo->user_sid[i];
uid+=dense->denseinfo->uid[i];
@@ -220,7 +219,7 @@ process_dense(OSMPBF__PrimitiveBlock *primitive_block, OSMPBF__DenseNodes *dense
has_tags=dense->keys_vals && dense->keys_vals[j];
osm_add_node(id, lat/latlon_scale,lon/latlon_scale);
#if 0
- printf("\t<node id=\"%Ld\" lat=\"%.7f\" lon=\"%.7f\" version=\"%d\" changeset=\"%Ld\"",id,lat/latlon_scale,lon/latlon_scale,version,changeset);
+ printf("\t<node id=\"%Ld\" lat=\"%.7f\" lon=\"%.7f\" version=\"%d\" changeset=\"%Ld\"",id,lat/latlon_scale,lon/latlon_scale,dense->denseinfo->version[i],changeset);
process_user(primitive_block, user_sid, uid, 0);
process_timestamp(timestamp);
#endif
diff --git a/navit/maptool/osm_xml.c b/navit/maptool/osm_xml.c
index 3bc5a70d8..0dab5a43d 100644
--- a/navit/maptool/osm_xml.c
+++ b/navit/maptool/osm_xml.c
@@ -75,16 +75,14 @@ void
osm_xml_decode_entities(char *buffer)
{
char *pos=buffer;
- int i,len,found;
+ int i,len;
while ((pos=strchr(pos, '&'))) {
- found=0;
for (i = 0 ; i < sizeof(entities)/sizeof(struct entity); i++) {
len=strlen(entities[i].entity);
if (!strncmp(pos, entities[i].entity, len)) {
*pos=entities[i].c;
memmove(pos+1, pos+len, strlen(pos+len)+1);
- found=1;
break;
}
}
diff --git a/navit/navigation.c b/navit/navigation.c
index da6b1ab6e..769708766 100644
--- a/navit/navigation.c
+++ b/navit/navigation.c
@@ -1730,7 +1730,7 @@ show_next_maneuvers(struct navigation *nav, struct navigation_itm *itm, struct n
{
struct navigation_command *cur,*prev;
int distance=itm->dest_length-cmd->itm->dest_length;
- int level, dist, i, time;
+ int level, i, time;
int speech_time,time2nav;
char *ret,*old,*buf,*next;
@@ -1772,7 +1772,6 @@ show_next_maneuvers(struct navigation *nav, struct navigation_itm *itm, struct n
speech_time = 30; // assume 3 seconds
}
- dist = prev->itm->dest_length - cur->itm->dest_length;
time = navigation_time(prev->itm,cur->itm->prev);
if (time >= (speech_time + 30)) { // 3 seconds for understanding what has been said
diff --git a/navit/navit_nls.c b/navit/navit_nls.c
index 5d4ccfbc4..aba4b97a3 100644
--- a/navit/navit_nls.c
+++ b/navit/navit_nls.c
@@ -7,7 +7,9 @@
#else
#include <libintl.h>
#endif
+#ifdef USE_NATIVE_LANGUAGE_SUPPORT
static GList *textdomains;
+#endif
char *
navit_nls_add_textdomain(const char *package, const char *dir)
diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c
index 0bed1bdd8..1b477aa48 100644
--- a/navit/osd/core/osd_core.c
+++ b/navit/osd/core/osd_core.c
@@ -1484,7 +1484,6 @@ osd_button_init(struct osd_priv_common *opc, struct navit *nav)
char *
osd_button_icon_path(struct osd_button *this_, char *src)
{
- char *s,*ret;
if (!this_->src_dir)
return graphics_icon_path(src);
return g_strdup_printf("%s%s%s",this_->src_dir, G_DIR_SEPARATOR_S, src);
diff --git a/navit/popup.c b/navit/popup.c
index dc9ee62b0..9a12e6a50 100644
--- a/navit/popup.c
+++ b/navit/popup.c
@@ -320,7 +320,7 @@ static void
popup_show_item(struct navit *nav, void *popup, struct displayitem *di)
{
struct map_rect *mr;
- void *menu, *menu_map, *menu_item, *menu_dist;
+ void *menu, *menu_item, *menu_dist;
char *label;
struct item *item,*diitem;
int count;
@@ -368,7 +368,6 @@ popup_show_item(struct navit *nav, void *popup, struct displayitem *di)
}
}
map_rect_destroy(mr);
- menu_map=popup_printf(menu, menu_type_submenu, "Map");
} else {
popup_printf(menu, menu_type_menu, "(No map)");
}
diff --git a/navit/sunriset.c b/navit/sunriset.c
index 9c92898ec..122d14b32 100644
--- a/navit/sunriset.c
+++ b/navit/sunriset.c
@@ -209,7 +209,7 @@ void sunpos( double d, double *lon, double *r )
void sun_RA_dec( double d, double *RA, double *dec, double *r )
{
double lon, obl_ecl;
- double xs, ys, zs;
+ double xs, ys;
double xe, ye, ze;
/* Compute Sun's ecliptical coordinates */
@@ -218,7 +218,7 @@ void sun_RA_dec( double d, double *RA, double *dec, double *r )
/* Compute ecliptic rectangular coordinates */
xs = *r * cosd(lon);
ys = *r * sind(lon);
- zs = 0; /* because the Sun is always in the ecliptic plane! */
+ /* No zs, because the Sun is always in the ecliptic plane! */
/* Compute obliquity of ecliptic (inclination of Earth's axis) */
obl_ecl = 23.4393 - 3.563E-7 * d;