Activate -Wall compile flag, Fix code not to throw warnings

This commit is contained in:
Mario Hüttel 2018-06-05 22:51:50 +02:00
parent 3ed83c1146
commit da19037211
4 changed files with 15 additions and 13 deletions

View File

@ -27,6 +27,7 @@ set(SOURCE
${LATEX_SOURCES} ${LATEX_SOURCES}
) )
add_compile_options(-Wall)
add_executable(${PROJECT_NAME} ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/glade/resources.c) add_executable(${PROJECT_NAME} ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/glade/resources.c)
add_dependencies(${PROJECT_NAME} glib-resources) add_dependencies(${PROJECT_NAME} glib-resources)

View File

@ -610,6 +610,19 @@ int parse_gds_from_file(const char *filename, GList **library_list)
} }
switch (rec_type) { switch (rec_type) {
case HEADER:
case UNITS:
case ENDLIB:
case ENDSTR:
case BOUNDARY:
case PATH:
case SREF:
case ENDEL:
case BOX:
case INVALID:
break;
case BGNLIB: case BGNLIB:
/* Parse date record */ /* Parse date record */
gds_parse_date(workbuff, read, &current_lib->mod_time, &current_lib->access_time); gds_parse_date(workbuff, read, &current_lib->mod_time, &current_lib->access_time);

View File

@ -29,13 +29,6 @@ static GtkWidget *global_load_button;
static GtkWidget *global_save_button; static GtkWidget *global_save_button;
static GtkListBox *global_list_box; static GtkListBox *global_list_box;
static void delete_layer_widget(GtkWidget *widget)
{
gtk_widget_destroy(widget);
}
void delete_layer_info_struct(struct layer_info *info) void delete_layer_info_struct(struct layer_info *info)
{ {
if (info) if (info)
@ -271,7 +264,6 @@ static void load_layer_mapping_from_file(gchar *file_name)
char *name; char *name;
gboolean export; gboolean export;
int layer; int layer;
int target_layer;
GdkRGBA color; GdkRGBA color;
int result; int result;
GList *rows; GList *rows;
@ -295,15 +287,13 @@ static void load_layer_mapping_from_file(gchar *file_name)
gtk_container_remove(GTK_CONTAINER(global_list_box), GTK_WIDGET(le)); gtk_container_remove(GTK_CONTAINER(global_list_box), GTK_WIDGET(le));
} }
target_layer = 0;
while((result = load_csv_line(dstream, &export, &name, &layer, &color)) >= 0) { while((result = load_csv_line(dstream, &export, &name, &layer, &color)) >= 0) {
/* skip broken line */ /* skip broken line */
if (result == 1) if (result == 1)
continue; continue;
/* Add rows in the same order as in file */ /* Add rows in the same order as in file */
if (le = find_layer_element_in_list(rows, layer)) { if ((le = find_layer_element_in_list(rows, layer))) {
gtk_list_box_insert(global_list_box, GTK_WIDGET(le), -1); gtk_list_box_insert(global_list_box, GTK_WIDGET(le), -1);
layer_element_set_color(le, &color); layer_element_set_color(le, &color);

View File

@ -8,10 +8,8 @@ static gboolean tree_sel_func(GtkTreeSelection *selection,
gboolean path_currently_selected, gboolean path_currently_selected,
gpointer data) gpointer data)
{ {
static int cnt = 0;
GtkTreeIter iter; GtkTreeIter iter;
struct gds_cell *cell; struct gds_cell *cell;
gchar *p;
gtk_tree_model_get_iter(model, &iter, path); gtk_tree_model_get_iter(model, &iter, path);
gtk_tree_model_get(model, &iter, CELL_SEL_CELL, &cell, -1); gtk_tree_model_get(model, &iter, CELL_SEL_CELL, &cell, -1);