widgets/battery: fix errors when compiling with optimizations enabled
widgets/weather: fix errors when compiling with optimizations enabled