g_autofree will automatically free variables when they go out of
scope. g_autoptr will do the same, but using the appropriate freefunc
for the given type, e.g. GDateTime -> g_date_time_unref() or
GObject -> g_object_unref().
This automatic cleanup reduces the risk of memory leaks
and allows getting rid of some lines of code.
g_autofree will automatically free variables when they go out of
scope. g_autoptr will do the same, but using the appropriate freefunc
for the given type, e.g. GDateTime -> g_date_time_unref() or
GObject -> g_object_unref().
This automatic cleanup reduces the risk of memory leaks
and allows getting rid of some lines of code.
g_autofree will automatically free variables when they go out of
scope. g_autoptr will do the same, but using the appropriate freefunc
for the given type, e.g. GDateTime -> g_date_time_unref() or
GObject -> g_object_unref().
This automatic cleanup reduces the risk of memory leaks
and allows getting rid of some lines of code.
g_autofree will automatically free variables when they go out of
scope. g_autoptr will do the same, but using the appropriate freefunc
for the given type, e.g. GDateTime -> g_date_time_unref() or
GObject -> g_object_unref().
This automatic cleanup reduces the risk of memory leaks
and allows getting rid of some lines of code.
g_autofree will automatically free variables when they go out of
scope. g_autoptr will do the same, but using the appropriate freefunc
for the given type, e.g. GDateTime -> g_date_time_unref() or
GObject -> g_object_unref().
This automatic cleanup reduces the risk of memory leaks
and allows getting rid of some lines of code.
g_autofree will automatically free variables when they go out of
scope. g_autoptr will do the same, but using the appropriate freefunc
for the given type, e.g. GDateTime -> g_date_time_unref() or
GObject -> g_object_unref().
This automatic cleanup reduces the risk of memory leaks
and allows getting rid of some lines of code.
g_autofree will automatically free variables when they go out of
scope. g_autoptr will do the same, but using the appropriate freefunc
for the given type, e.g. GDateTime -> g_date_time_unref() or
GObject -> g_object_unref().
This automatic cleanup reduces the risk of memory leaks
and allows getting rid of some lines of code.
g_autofree will automatically free variables when they go out of
scope. g_autoptr will do the same, but using the appropriate freefunc
for the given type, e.g. GDateTime -> g_date_time_unref() or
GObject -> g_object_unref().
This automatic cleanup reduces the risk of memory leaks
and allows getting rid of some lines of code.
g_autofree will automatically free variables when they go out of
scope. g_autoptr will do the same, but using the appropriate freefunc
for the given type, e.g. GDateTime -> g_date_time_unref() or
GObject -> g_object_unref().
This automatic cleanup reduces the risk of memory leaks
and allows getting rid of some lines of code.
g_autofree will automatically free variables when they go out of
scope. g_autoptr will do the same, but using the appropriate freefunc
for the given type, e.g. GDateTime -> g_date_time_unref() or
GObject -> g_object_unref().
This automatic cleanup reduces the risk of memory leaks
and allows getting rid of some lines of code.
Fixes the following error
../src/window/picplanner-window.c:247:1: error: no previous declaration for ‘picplanner_update_date_time’ [-Werror=missing-declarations]
247 | picplanner_update_date_time (PicplannerWindow *window)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
This simplifies the code and also avoid the equality check for
floating numbers.
../src/calculations/calculations_transformations.c: In function ‘picplanner_transform_rotational_to_horizontal’:
../src/calculations/calculations_transformations.c:202:14: warning: comparing floating-point with ‘==’ or ‘!=’ is unsafe [-Wfloat-equal]
202 | else if (x == 0 && y < 0)
| ^~
../src/calculations/calculations_transformations.c:204:14: warning: comparing floating-point with ‘==’ or ‘!=’ is unsafe [-Wfloat-equal]
204 | else if (x == 0 && y > 0)
| ^~
-Wstrict-prototypes disallows empty function prototypes and
prefers specifying (void) instead.
Fixes the following type of warning
In file included from ../src/window/sun-page/sun-view.c:20:
../src/window/sun-page/sun-view.h:52:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
52 | PicplannerSun *picplanner_sun_new ();
| ^~~~~~~~~~~~~
The .c files also now include (void) to fix old-style definitions warnings
../src/time-picker/time-picker.c: In function ‘time_picker_new’:
../src/time-picker/time-picker.c:236:1: warning: old-style function definition [-Wold-style-definition]
236 | time_picker_new ()
| ^~~~~~~~~~~~~~~
Fixes the warnings raised by -Wdeclaration-after-statement
../src/window/picplanner-window.c: In function ‘picplanner_update_date_time’:
../src/window/picplanner-window.c:290:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
290 | double time_zone = (double) g_date_time_get_utc_offset (window->date_time)/3600/1000/1000;
| ^~~~~~