}
-static guint hash_fct(gconstpointer key)
+static guint process_list_hash_fct(gconstpointer key)
{
- return ((ProcessInfo*)key)->pid;
+ guint pid = ((ProcessInfo*)key)->pid;
+ return ((pid>>8 ^ pid>>4 ^ pid>>2 ^ pid) ^ ((ProcessInfo*)key)->cpu);
}
-static gboolean equ_fct(gconstpointer a, gconstpointer b)
+static gboolean process_list_equ_fct(gconstpointer a, gconstpointer b)
{
const ProcessInfo *pa = (const ProcessInfo*)a;
const ProcessInfo *pb = (const ProcessInfo*)b;
-
+
if(pa->pid != pb->pid)
return 0;
GTK_SORT_ASCENDING);
process_list->process_hash = g_hash_table_new_full(
- hash_fct, equ_fct,
+ process_list_hash_fct, process_list_equ_fct,
destroy_hash_key, destroy_hash_data
);
-__inline gint get_cell_height(ProcessList *process_list, GtkTreeView *tree_view)
+static __inline gint get_cell_height(ProcessList *process_list, GtkTreeView *tree_view)
{
gint height = process_list->cell_height_cache;
if(height != -1) return height;
* overriden by the new state before anything is drawn.
*/
hashed_process_data->x.over = 0;
+ hashed_process_data->x.over_used = FALSE;
hashed_process_data->x.middle = 0;
+ hashed_process_data->x.middle_used = FALSE;
hashed_process_data->x.under = 0;
+ hashed_process_data->x.under_used = FALSE;
/* Add a new row to the model */
gtk_list_store_append ( process_list->list_store,
GtkTreeIter iter;
Process_Info.pid = pid;
- Process_Info.cpu = cpu;
+ if(pid == 0)
+ Process_Info.cpu = cpu;
+ else
+ Process_Info.cpu = 0;
Process_Info.birth = *birth;
Process_Info.trace_num = trace_num;
HashedProcessData *hashed_process_data = NULL;
Process_Info.pid = pid;
- Process_Info.cpu = cpu;
+ if(pid == 0)
+ Process_Info.cpu = cpu;
+ else
+ Process_Info.cpu = 0;
Process_Info.birth = *birth;
Process_Info.trace_num = trace_num;