Commit a23f17e1 authored by Paolo Bacchilega's avatar Paolo Bacchilega

Fixed 'may be used uninitialized' warnings

parent 8b70b1f0
......@@ -143,8 +143,8 @@ gth_map_view_get_coordinates (GthMapView *self,
double *out_longitude)
{
int coordinates_available;
double latitude;
double longitude;
double latitude = 0.0;
double longitude = 0.0;
coordinates_available = 0;
......
......@@ -1446,6 +1446,11 @@ _cairo_create_dnd_icon (cairo_surface_t *image,
frame_rect.width = thumbnail_rect.width;
frame_rect.height = icon_size;
break;
default:
icon_rect.width = 0;
icon_rect.height = 0;
break;
}
if (multi_dnd) {
......
......@@ -588,8 +588,8 @@ static double
get_zoom_to_fit (GthImageViewer *self,
GtkAllocation *allocation)
{
int original_width;
int original_height;
int original_width = 0;
int original_height = 0;
int frame_border_2;
double x_level;
double y_level;
......@@ -597,6 +597,9 @@ get_zoom_to_fit (GthImageViewer *self,
gth_image_viewer_get_original_size (self, &original_width, &original_height);
frame_border_2 = _gth_image_viewer_get_frame_border (self) * 2;
if ((original_width == 0) || (original_height == 0))
return 1.0;
x_level = (double) (allocation->width - frame_border_2) / original_width;
y_level = (double) (allocation->height - frame_border_2) / original_height;
......@@ -608,13 +611,16 @@ static double
get_zoom_to_fit_width (GthImageViewer *self,
GtkAllocation *allocation)
{
int original_width;
int original_width = 0;
int frame_border_2;
gth_image_viewer_get_original_size (self, &original_width, NULL);
frame_border_2 = _gth_image_viewer_get_frame_border (self) * 2;
return (double) (allocation->width - frame_border_2) / original_width;
if (original_width > 0)
return (double) (allocation->width - frame_border_2) / original_width;
else
return 0;
}
......@@ -622,13 +628,16 @@ static double
get_zoom_to_fit_height (GthImageViewer *self,
GtkAllocation *allocation)
{
int original_height;
int original_height = 0;
int frame_border_2;
gth_image_viewer_get_original_size (self, NULL, &original_height);
frame_border_2 = _gth_image_viewer_get_frame_border (self) * 2;
return (double) (allocation->height - frame_border_2) / original_height;
if (original_height > 0)
return (double) (allocation->height - frame_border_2) / original_height;
else
return 0;
}
......@@ -2612,7 +2621,7 @@ gth_image_viewer_paint (GthImageViewer *self,
int height,
cairo_filter_t filter)
{
int original_width;
int original_width = 0;
int surface_width;
double zoom_level;
double src_dx;
......
......@@ -1242,7 +1242,7 @@ _gtk_window_get_monitor_info (GtkWindow *window,
if ((number != NULL) || (name != NULL)) {
GdkDisplay *display;
int monitor_num;
const char *monitor_name;
const char *monitor_name = NULL;
int i;
display = gdk_monitor_get_display (monitor);
......
......@@ -77,7 +77,7 @@ _g_uri_parse (const char *uri,
UriState state;
const char *p;
gunichar c;
const char *part_begin;
const char *part_begin = NULL;
if (uri == NULL)
return FALSE;
......@@ -499,8 +499,8 @@ _g_uri_get_part (const char *uri,
UriPart part)
{
UriInfo info;
const char *begin;
gsize size;
const char *begin = NULL;
gsize size = 0;
if (! _g_uri_parse (uri, &info))
return NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment