summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xCMakeLists.txt6
-rw-r--r--navit/command.c2
-rw-r--r--navit/geom.c2
-rw-r--r--navit/graphics/opengl/graphics_opengl.c4
-rw-r--r--navit/gui/internal/gui_internal_poi.c2
-rw-r--r--navit/layout.c12
-rw-r--r--navit/maptool/google/protobuf-c/protobuf-c.c2
-rw-r--r--navit/maptool/osm.c2
-rw-r--r--navit/maptool/osm_relations.c2
-rw-r--r--navit/navit_nls.c1
-rw-r--r--navit/navit_nls.h2
-rw-r--r--navit/osd.c2
-rw-r--r--navit/osd/core/osd_core.c4
-rw-r--r--navit/profile_option.c4
-rw-r--r--navit/roadprofile.c4
-rw-r--r--navit/script.c4
-rw-r--r--navit/vehicleprofile.c2
17 files changed, 26 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 569ffa81..dbf976fd 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -634,7 +634,11 @@ CHECK_FUNCTION_EXISTS (_atoi64 HAVE__ATOI64)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
-add_definitions("-Wall")
+if(CMAKE_COMPILER_IS_GNUCC OR CCMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wcast-align -Wpointer-arith -Wmissing-prototypes ")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wcast-align -Wpointer-arith ")
+endif()
+
if (EXTRA_DEFINES)
add_definitions("${EXTRA_DEFINES}")
endif(EXTRA_DEFINES)
diff --git a/navit/command.c b/navit/command.c
index c39aff5b..9e53e3cf 100644
--- a/navit/command.c
+++ b/navit/command.c
@@ -1191,7 +1191,7 @@ command_evaluate_to_length(const char *expr, int *error)
return 0;
}
-int
+static int
command_evaluate_single(struct context *ctx)
{
struct result res={{0,},},tmp={{0,},};
diff --git a/navit/geom.c b/navit/geom.c
index 876d13b9..65ea4986 100644
--- a/navit/geom.c
+++ b/navit/geom.c
@@ -400,7 +400,7 @@ geom_poly_segments_point_inside(GList *in, struct coord *c)
return 0;
}
-int
+static int
clipcode(struct coord *p, struct rect *r)
{
int code=0;
diff --git a/navit/graphics/opengl/graphics_opengl.c b/navit/graphics/opengl/graphics_opengl.c
index 5a5aeb12..2069ff6e 100644
--- a/navit/graphics/opengl/graphics_opengl.c
+++ b/navit/graphics/opengl/graphics_opengl.c
@@ -195,7 +195,7 @@ static GHashTable *hImageData;
#else
/* prototypes */
void APIENTRY tessBeginCB(GLenum which);
-void APIENTRY tessEndCB();
+void APIENTRY tessEndCB(void);
void APIENTRY tessErrorCB(GLenum errorCode);
void APIENTRY tessVertexCB(const GLvoid * data);
void APIENTRY tessVertexCB2(const GLvoid * data);
@@ -756,7 +756,7 @@ tessBeginCB(GLenum which)
void APIENTRY
-tessEndCB()
+tessEndCB(void)
{
dbg(1, "glEnd();\n");
draw_array(graphics_priv_root, tess_array, tess_count, tess_type);
diff --git a/navit/gui/internal/gui_internal_poi.c b/navit/gui/internal/gui_internal_poi.c
index f4ae2e1c..f2ec9228 100644
--- a/navit/gui/internal/gui_internal_poi.c
+++ b/navit/gui/internal/gui_internal_poi.c
@@ -291,7 +291,7 @@ gui_internal_cmd_pois_selector(struct gui_priv *this, struct pcoord *c, int page
* @return Pointer to new widget.
*/
-void
+static void
format_dist(int dist, char *distbuf)
{
if (dist > 10000)
diff --git a/navit/layout.c b/navit/layout.c
index 573746b6..ef686245 100644
--- a/navit/layout.c
+++ b/navit/layout.c
@@ -60,16 +60,6 @@ struct layout * layout_new(struct attr *parent, struct attr **attrs)
return l;
}
-void
-layout_destroy(struct layout *layout)
-{
- attr_list_free(layout->attrs);
- g_free(layout->font);
- g_free(layout->dayname);
- g_free(layout->nightname);
- g_free(layout);
-}
-
struct attr_iter {
GList *last;
};
@@ -327,7 +317,7 @@ layer_set_attr(struct layer *layer, struct attr *attr)
return layer_set_attr_do(layer, attr, 0);
}
-void
+static void
layer_destroy(struct layer *layer)
{
attr_list_free(layer->attrs);
diff --git a/navit/maptool/google/protobuf-c/protobuf-c.c b/navit/maptool/google/protobuf-c/protobuf-c.c
index 4b0c68a5..7d16f7da 100644
--- a/navit/maptool/google/protobuf-c/protobuf-c.c
+++ b/navit/maptool/google/protobuf-c/protobuf-c.c
@@ -2016,7 +2016,7 @@ parse_member (ScannedMember *scanned_member,
/* TODO: expose/use this function if desc->message_init==NULL
(which occurs for old code, and may be useful for certain
programatic techniques for generating descriptors). */
-void
+static void
protobuf_c_message_init_generic (const ProtobufCMessageDescriptor *desc,
ProtobufCMessage *message)
{
diff --git a/navit/maptool/osm.c b/navit/maptool/osm.c
index 3948fd86..5035b0ba 100644
--- a/navit/maptool/osm.c
+++ b/navit/maptool/osm.c
@@ -91,7 +91,7 @@ static struct attr_mapping **attr_mapping_rel2poly_place;
static int attr_mapping_rel2poly_place_count;
static int attr_longest_match(struct attr_mapping **mapping, int mapping_count, enum item_type *types, int types_count);
-static void attr_longest_match_clear();
+static void attr_longest_match_clear(void);
enum attr_strings {
diff --git a/navit/maptool/osm_relations.c b/navit/maptool/osm_relations.c
index 62963f32..7e627e29 100644
--- a/navit/maptool/osm_relations.c
+++ b/navit/maptool/osm_relations.c
@@ -152,7 +152,7 @@ relations_process(struct relations *rel, FILE *nodes, FILE *ways, FILE *relation
}
}
-void
+static void
relations_destroy_func(void *key, GList *l, void *data)
{
GList *ll=l;
diff --git a/navit/navit_nls.c b/navit/navit_nls.c
index 622f88a1..a4b32a45 100644
--- a/navit/navit_nls.c
+++ b/navit/navit_nls.c
@@ -1,6 +1,7 @@
#include "config.h"
#include "debug.h"
#include <glib.h>
+#include <navit_nls.h>
#include <stdlib.h>
#ifdef HAVE_API_WIN32_CE
#include "libc.h"
diff --git a/navit/navit_nls.h b/navit/navit_nls.h
index 3f9c6947..e0fe2efe 100644
--- a/navit/navit_nls.h
+++ b/navit/navit_nls.h
@@ -1,7 +1,7 @@
#ifndef __NAVIT_NLS_H__
char *navit_nls_add_textdomain(const char *package, const char *dir);
-char *navit_nls_remove_textdomain(const char *package);
+void navit_nls_remove_textdomain(const char *package);
const char *navit_nls_gettext(const char *msgid);
const char *navit_nls_ngettext(const char *msgid, const char *msgid_plural, unsigned long int n);
void navit_nls_main_init(void);
diff --git a/navit/osd.c b/navit/osd.c
index c02b3fbd..bec0b416 100644
--- a/navit/osd.c
+++ b/navit/osd.c
@@ -102,7 +102,7 @@ osd_set_attr(struct osd *osd, struct attr* attr)
return navit_object_set_attr((struct navit_object *)osd, attr);
}
-void
+static void
osd_destroy(struct osd *osd)
{
if (osd && osd->meth.destroy) {
diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c
index 1b477aa4..de53e7fb 100644
--- a/navit/osd/core/osd_core.c
+++ b/navit/osd/core/osd_core.c
@@ -1481,7 +1481,7 @@ osd_button_init(struct osd_priv_common *opc, struct navit *nav)
osd_button_draw(opc,nav);
}
-char *
+static char *
osd_button_icon_path(struct osd_button *this_, char *src)
{
if (!this_->src_dir)
@@ -3058,7 +3058,7 @@ osd_text_init(struct osd_priv_common *opc, struct navit *nav)
}
-int
+static int
osd_text_set_attr(struct osd_priv_common *opc, struct attr* attr)
{
struct osd_text *this_ = (struct osd_text *)opc->data;
diff --git a/navit/profile_option.c b/navit/profile_option.c
index 0f76cda1..b9cffefa 100644
--- a/navit/profile_option.c
+++ b/navit/profile_option.c
@@ -27,7 +27,7 @@ struct profile_option
NAVIT_OBJECT
};
-struct profile_option *
+static struct profile_option *
profile_option_new(struct attr *parent, struct attr **attrs)
{
struct profile_option *po=g_new0(struct profile_option, 1);
@@ -38,7 +38,7 @@ profile_option_new(struct attr *parent, struct attr **attrs)
return po;
}
-void
+static void
profile_option_destroy(struct profile_option *po)
{
attr_list_free(po->attrs);
diff --git a/navit/roadprofile.c b/navit/roadprofile.c
index 0c70eb48..1cda1613 100644
--- a/navit/roadprofile.c
+++ b/navit/roadprofile.c
@@ -96,7 +96,7 @@ roadprofile_attr_iter_destroy(struct attr_iter *iter)
g_free(iter);
}
-struct roadprofile *
+static struct roadprofile *
roadprofile_dup(struct roadprofile *this_)
{
struct roadprofile *ret=g_new(struct roadprofile, 1);
@@ -106,7 +106,7 @@ roadprofile_dup(struct roadprofile *this_)
return ret;
}
-void
+static void
roadprofile_destroy(struct roadprofile *this_)
{
attr_list_free(this_->attrs);
diff --git a/navit/script.c b/navit/script.c
index 5419aee3..841ec6fc 100644
--- a/navit/script.c
+++ b/navit/script.c
@@ -67,7 +67,7 @@ script_set_attr_int(struct script *scr, struct attr *attr)
}
}
-struct script *
+static struct script *
script_new(struct attr *parent, struct attr **attrs)
{
struct script *scr=g_new0(struct script, 1);
@@ -83,7 +83,7 @@ script_new(struct attr *parent, struct attr **attrs)
return scr;
}
-void
+static void
script_destroy(struct script *scr)
{
dbg(0,"enter %p\n",scr);
diff --git a/navit/vehicleprofile.c b/navit/vehicleprofile.c
index 34eec076..2ce3ad1f 100644
--- a/navit/vehicleprofile.c
+++ b/navit/vehicleprofile.c
@@ -295,7 +295,7 @@ vehicleprofile_get_name(struct vehicleprofile *this_)
return this_->name;
}
-void
+static void
vehicleprofile_init(struct vehicleprofile *this_)
{
vehicleprofile_update(this_);