Fix compiler warnings (original patches from Enrico Tröger)

Add missing include for geteuid() missing declaration
xtm_process_window_show_swap_usage() in process-window.
Fix various compiler warnings from main.c task-manager.c and
app-manager.c.
This commit is contained in:
Mike Massonnet
2010-06-06 14:00:54 +02:00
parent bdeff4e269
commit 81bdc6d2ba
5 changed files with 25 additions and 20 deletions

View File

@@ -56,8 +56,6 @@ xtm_app_manager_init (XtmAppManager *manager)
{
WnckScreen *screen = wnck_screen_get_default ();
GList *windows, *l;
gint i;
App app;
/* Retrieve initial applications */
while (gtk_events_pending ())
@@ -123,9 +121,8 @@ apps_add_application (GArray *apps, WnckApplication *application)
static void
apps_remove_application (GArray *apps, WnckApplication *application)
{
App *app;
gint pid;
gint i;
App *app = NULL;
guint i;
for (i = 0; i < apps->len; i++)
{
@@ -134,20 +131,23 @@ apps_remove_application (GArray *apps, WnckApplication *application)
break;
}
g_object_unref (app->icon);
g_array_remove_index (apps, i);
if (app != NULL)
{
g_object_unref (app->icon);
g_array_remove_index (apps, i);
}
}
static App *
apps_lookup_pid (GArray *apps, gint pid)
{
App *app;
gint i;
guint i;
for (app = NULL, i = 0; i < apps->len; i++)
{
app = &g_array_index (apps, App, i);
if (app->pid == pid)
if (app->pid == (guint)pid)
break;
app = NULL;
}
@@ -176,7 +176,7 @@ application_closed (WnckScreen *screen, WnckApplication *application, XtmAppMana
XtmAppManager *
xtm_app_manager_new ()
xtm_app_manager_new (void)
{
return g_object_new (XTM_TYPE_APP_MANAGER, NULL);
}

View File

@@ -26,7 +26,7 @@ static XtmTaskManager *task_manager;
static gboolean timeout = 0;
static void
status_icon_activated ()
status_icon_activated (void)
{
if (!(GTK_WIDGET_VISIBLE (window)))
gtk_widget_show (window);
@@ -35,7 +35,7 @@ status_icon_activated ()
}
static void
show_hide_status_icon ()
show_hide_status_icon (void)
{
gboolean show_status_icon;
g_object_get (settings, "show-status-icon", &show_status_icon, NULL);
@@ -96,7 +96,7 @@ force_timeout_update (void)
}
static void
refresh_rate_changed (XtmSettings *settings)
refresh_rate_changed (void)
{
if (!g_source_remove (timeout))
{

View File

@@ -11,6 +11,10 @@
#include <config.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <glib-object.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>

View File

@@ -30,5 +30,6 @@ GType xtm_process_window_get_type (void);
GtkWidget * xtm_process_window_new ();
GtkTreeModel * xtm_process_window_get_model (XtmProcessWindow *window);
void xtm_process_window_set_system_info (XtmProcessWindow *window, guint num_processes, gfloat cpu, gfloat memory, gfloat swap);
void xtm_process_window_show_swap_usage (XtmProcessWindow *window, gboolean show_swap_usage);
#endif /* !PROCESS_WINDOW_H */

View File

@@ -364,11 +364,11 @@ model_find_tree_iter_for_pid (GtkTreeModel *model, guint pid, GtkTreeIter *iter)
}
static glong
__current_timestamp ()
__current_timestamp (void)
{
GTimeVal time;
g_get_current_time (&time);
return time.tv_sec;
GTimeVal current_time;
g_get_current_time (&current_time);
return current_time.tv_sec;
}
@@ -609,9 +609,6 @@ xtm_task_manager_update_model (XtmTaskManager *manager)
if (found == FALSE)
{
#if DEBUG
g_debug ("Add new task %d %s", tasktmp->pid, tasktmp->name);
#endif
#ifdef HAVE_WNCK
App *app = xtm_app_manager_get_app_from_pid (manager->app_manager, tasktmp->pid);
model_add_task (manager->model, tasktmp, app, __current_timestamp ());
@@ -619,6 +616,9 @@ xtm_task_manager_update_model (XtmTaskManager *manager)
model_add_task (manager->model, tasktmp, __current_timestamp ());
#endif
g_array_append_val (manager->tasks, *tasktmp);
#if DEBUG
g_debug ("Add new task %d %s", tasktmp->pid, tasktmp->name);
#endif
}
}