~indicator-applet-developers/indicator-power/trunk.16.10

« back to all changes in this revision

Viewing changes to src/device-provider-upower.c

  • Committer: Charles Kerr
  • Date: 2014-07-14 04:33:16 UTC
  • mto: This revision was merged to the branch mainline in revision 250.
  • Revision ID: charles.kerr@canonical.com-20140714043316-4qmk8taexrg1ls39
fix some compiler warnings generated by clang static analyzer

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
22
20
#include "dbus-upower.h"
23
21
#include "device.h"
24
22
#include "device-provider.h"
60
58
  indicator_power_device_provider_upower,
61
59
  G_TYPE_OBJECT,
62
60
  G_IMPLEMENT_INTERFACE (INDICATOR_TYPE_POWER_DEVICE_PROVIDER,
63
 
                         indicator_power_device_provider_interface_init));
 
61
                         indicator_power_device_provider_interface_init))
64
62
 
65
63
/***
66
64
****  UPOWER DBUS
102
100
      gdouble percentage = 0;
103
101
      gint64 time_to_empty = 0;
104
102
      gint64 time_to_full = 0;
105
 
      time_t time;
 
103
      gint64 time;
106
104
      IndicatorPowerDevice * device;
107
105
      IndicatorPowerDeviceProviderUPowerPriv * p = data->self->priv;
108
106
      GVariant * dict = g_variant_get_child_value (response, 0);
120
118
                                INDICATOR_POWER_DEVICE_STATE, (gint)state,
121
119
                                INDICATOR_POWER_DEVICE_OBJECT_PATH, data->path,
122
120
                                INDICATOR_POWER_DEVICE_PERCENTAGE, percentage,
123
 
                                INDICATOR_POWER_DEVICE_TIME, (guint64)time,
 
121
                                INDICATOR_POWER_DEVICE_TIME, time,
124
122
                                NULL);
125
123
        }
126
124
      else
129
127
                                               kind,
130
128
                                               percentage,
131
129
                                               state,
132
 
                                               time);
 
130
                                               (time_t)time);
133
131
 
134
132
          g_hash_table_insert (p->devices,
135
133
                               g_strdup (data->path),