summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wildemann <gta04@metalstrolche.de>2019-10-30 23:50:41 +0100
committerStefan Wildemann <gta04@metalstrolche.de>2019-10-30 23:50:41 +0100
commitd059ea68263b82892d91b28db0bcaaec26265ade (patch)
treeb3ee9d9db5f1c42cde703af8918fcafebe184d57
parent0a9c9c410381c80703f6faabfbdc7142497cbb46 (diff)
downloadnavit-d059ea68263b82892d91b28db0bcaaec26265ade.tar.gz
fix:core:build without warnings
on my setup navit_core build without non avoidable warnings.
-rw-r--r--navit/roadprofile.c2
-rw-r--r--navit/roadprofile.h10
-rw-r--r--navit/vehicle.c2
-rw-r--r--navit/vehicle.h8
-rw-r--r--navit/vehicleprofile.c7
-rw-r--r--navit/vehicleprofile.h53
6 files changed, 42 insertions, 40 deletions
diff --git a/navit/roadprofile.c b/navit/roadprofile.c
index 81033d46d..96e8361c0 100644
--- a/navit/roadprofile.c
+++ b/navit/roadprofile.c
@@ -74,7 +74,7 @@ int roadprofile_remove_attr(struct roadprofile *this_, struct attr *attr) {
}
struct attr_iter *
-roadprofile_attr_iter_new(void) {
+roadprofile_attr_iter_new(void * unused) {
return (struct attr_iter *)g_new0(void *,1);
}
diff --git a/navit/roadprofile.h b/navit/roadprofile.h
index a4ff65076..69ca6f4bc 100644
--- a/navit/roadprofile.h
+++ b/navit/roadprofile.h
@@ -22,10 +22,10 @@
extern "C" {
#endif
struct roadprofile {
- NAVIT_OBJECT
- int speed;
- int route_weight;
- int maxspeed;
+ NAVIT_OBJECT
+ int speed;
+ int route_weight;
+ int maxspeed;
};
struct roadprofile * roadprofile_new(struct attr *parent, struct attr **attrs);
@@ -33,7 +33,7 @@ int roadprofile_get_attr(struct roadprofile *this_, enum attr_type type, struct
int roadprofile_set_attr(struct roadprofile *this_, struct attr *attr);
int roadprofile_add_attr(struct roadprofile *this_, struct attr *attr);
int roadprofile_remove_attr(struct roadprofile *this_, struct attr *attr);
-struct attr_iter *roadprofile_attr_iter_new(void);
+struct attr_iter *roadprofile_attr_iter_new(void* unused);
void roadprofile_attr_iter_destroy(struct attr_iter *iter);
#ifdef __cplusplus
}
diff --git a/navit/vehicle.c b/navit/vehicle.c
index f0094e804..fee989638 100644
--- a/navit/vehicle.c
+++ b/navit/vehicle.c
@@ -185,7 +185,7 @@ void vehicle_destroy(struct vehicle *this_) {
* Creates an attribute iterator to be used with vehicles
*/
struct attr_iter *
-vehicle_attr_iter_new(void) {
+vehicle_attr_iter_new(void * unused) {
return (struct attr_iter *)g_new0(void *,1);
}
diff --git a/navit/vehicle.h b/navit/vehicle.h
index 54cc15771..15cdf4e3c 100644
--- a/navit/vehicle.h
+++ b/navit/vehicle.h
@@ -28,9 +28,9 @@ struct point;
struct vehicle_priv;
struct vehicle_methods {
- void (*destroy)(struct vehicle_priv *priv);
- int (*position_attr_get)(struct vehicle_priv *priv, enum attr_type type, struct attr *attr);
- int (*set_attr)(struct vehicle_priv *priv, struct attr *attr);
+ void (*destroy)(struct vehicle_priv *priv);
+ int (*position_attr_get)(struct vehicle_priv *priv, enum attr_type type, struct attr *attr);
+ int (*set_attr)(struct vehicle_priv *priv, struct attr *attr);
};
/* prototypes */
@@ -43,7 +43,7 @@ struct point;
struct vehicle;
struct vehicle *vehicle_new(struct attr *parent, struct attr **attrs);
void vehicle_destroy(struct vehicle *this_);
-struct attr_iter *vehicle_attr_iter_new(void);
+struct attr_iter *vehicle_attr_iter_new(void * unused);
void vehicle_attr_iter_destroy(struct attr_iter *iter);
int vehicle_get_attr(struct vehicle *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
int vehicle_set_attr(struct vehicle *this_, struct attr *attr);
diff --git a/navit/vehicleprofile.c b/navit/vehicleprofile.c
index d20603d73..905d2defa 100644
--- a/navit/vehicleprofile.c
+++ b/navit/vehicleprofile.c
@@ -182,7 +182,7 @@ static void vehicleprofile_debug_roadprofile(gpointer key, gpointer value, gpoin
}
static void vehicleprofile_update(struct vehicleprofile *this_) {
- struct attr_iter *iter=vehicleprofile_attr_iter_new();
+ struct attr_iter *iter=vehicleprofile_attr_iter_new(NULL);
struct attr profile_option;
dbg(lvl_debug,"enter");
vehicleprofile_clear(this_);
@@ -227,7 +227,7 @@ vehicleprofile_new(struct attr *parent, struct attr **attrs) {
}
struct attr_iter *
-vehicleprofile_attr_iter_new(void) {
+vehicleprofile_attr_iter_new(void* unused) {
return (struct attr_iter *)g_new0(void *,1);
}
@@ -276,8 +276,9 @@ char *vehicleprofile_get_name(struct vehicleprofile *this_) {
return this_->name;
}
-static void vehicleprofile_init(struct vehicleprofile *this_) {
+static int vehicleprofile_init(struct vehicleprofile *this_) {
vehicleprofile_update(this_);
+ return 0;
}
struct object_func vehicleprofile_func = {
diff --git a/navit/vehicleprofile.h b/navit/vehicleprofile.h
index 4e1b6a340..58ffa1489 100644
--- a/navit/vehicleprofile.h
+++ b/navit/vehicleprofile.h
@@ -24,40 +24,41 @@ extern "C" {
enum maxspeed_handling {
- maxspeed_enforce = 0, /*!< Always enforce maxspeed of segment */
- maxspeed_restrict = 1, /*!< Enforce maxspeed of segment only if it restricts the speed */
- maxspeed_ignore = 2, /*!< Ignore maxspeed of segment, always use {@code route_weight} of road profile */
+ maxspeed_enforce = 0, /*!< Always enforce maxspeed of segment */
+ maxspeed_restrict = 1, /*!< Enforce maxspeed of segment only if it restricts the speed */
+ maxspeed_ignore = 2, /*!< Ignore maxspeed of segment, always use {@code route_weight} of road profile */
};
struct vehicleprofile {
- NAVIT_OBJECT
- int mode; /**< 0 = Auto, 1 = On-Road, 2 = Off-Road */
- int flags_forward_mask; /**< Flags mask for moving in positive direction */
- int flags_reverse_mask; /**< Flags mask for moving in reverse direction */
- int flags; /**< Required flags to move through a segment */
- int maxspeed_handling; /**< How to handle maxspeed of segment, see {@code enum maxspeed_handling} */
- int static_speed; /**< Maximum speed of vehicle to consider it stationary */
- int static_distance; /**< Maximum distance of previous position of vehicle to consider it stationary */
- char *name; /**< the vehicle profile name */
- char *route_depth; /**< the route depth attribute */
- int width; /**< Width of the vehicle in cm */
- int height; /**< Height of the vehicle in cm */
- int length; /**< Length of the vehicle in cm */
- int weight; /**< Weight of the vehicle in kg */
- int axle_weight; /**< Axle Weight of the vehicle in kg */
- int dangerous_goods; /**< Flags of dangerous goods present */
- int through_traffic_penalty; /**< Penalty when driving on a through traffic limited road */
- GHashTable *roadprofile_hash;
- struct attr active_callback;
- int turn_around_penalty; /**< Penalty when turning around */
- int turn_around_penalty2; /**< Penalty when turning around, for planned turn arounds */
+ NAVIT_OBJECT
+ int mode; /**< 0 = Auto, 1 = On-Road, 2 = Off-Road */
+ int flags_forward_mask; /**< Flags mask for moving in positive direction */
+ int flags_reverse_mask; /**< Flags mask for moving in reverse direction */
+ int flags; /**< Required flags to move through a segment */
+ int maxspeed_handling; /**< How to handle maxspeed of segment, see {@code enum maxspeed_handling} */
+ int static_speed; /**< Maximum speed of vehicle to consider it stationary */
+ int static_distance; /**< Maximum distance of previous position of vehicle to consider it stationary */
+ char *name; /**< the vehicle profile name */
+ char *route_depth; /**< the route depth attribute */
+ int width; /**< Width of the vehicle in cm */
+ int height; /**< Height of the vehicle in cm */
+ int length; /**< Length of the vehicle in cm */
+ int weight; /**< Weight of the vehicle in kg */
+ int axle_weight; /**< Axle Weight of the vehicle in kg */
+ int dangerous_goods; /**< Flags of dangerous goods present */
+ int through_traffic_penalty; /**< Penalty when driving on a through traffic limited road */
+ GHashTable *roadprofile_hash;
+ struct attr active_callback;
+ int turn_around_penalty; /**< Penalty when turning around */
+ int turn_around_penalty2; /**< Penalty when turning around, for planned turn arounds */
};
struct vehicleprofile * vehicleprofile_new(struct attr *parent, struct attr **attrs);
-struct attr_iter *vehicleprofile_attr_iter_new(void);
+struct attr_iter *vehicleprofile_attr_iter_new(void * unused);
void vehicleprofile_attr_iter_destroy(struct attr_iter *iter);
-int vehicleprofile_get_attr(struct vehicleprofile *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
+int vehicleprofile_get_attr(struct vehicleprofile *this_, enum attr_type type, struct attr *attr,
+ struct attr_iter *iter);
int vehicleprofile_set_attr(struct vehicleprofile *this_, struct attr *attr);
int vehicleprofile_add_attr(struct vehicleprofile *this_, struct attr *attr);
int vehicleprofile_remove_attr(struct vehicleprofile *this_, struct attr *attr);