Patch to fix few 64bit issues

Tue Aug 28 18:29:28 2001  George Lebl <jirka@5z.com>

	Patch to fix few 64bit issues

	* gal/e-table/e-table-header-item.c (ethi_draw) (ethi_start_drag)
	  gal/widgets/e-categories.c (e_categories_value_at)
	  (e_categories_value_to_string):
	  Use GINT_TO_POINTER and GPOINTER_TO_INT to cast between pointers
	  and ints to fix 64bit issues connected with that.

	* gal/e-table/e-table-sorting-utils.c
	  (e_table_sorting_utils_tree_check_position)
	  gal/util/e-sorter-array.c (e_sorter_array_append):
	  Use size_t for size not ints to fix crashes

	* gal/e-text/e-completion-match.c, gal/e-text/e-completion.c:
	  Include <string.h>

svn path=/trunk/; revision=12507
This commit is contained in:
George Lebl
2001-08-29 01:30:26 +00:00
committed by George Lebl
parent 5248c1282c
commit 87b3e9277f
5 changed files with 23 additions and 21 deletions

View File

@ -195,7 +195,7 @@ e_sorter_array_append (ESorterArray *esa, int count)
esa->sorted = g_renew(int, esa->sorted, esa->rows + count);
for (i = 0; i < count; i++) {
int value = esa->rows;
int pos;
size_t pos;
e_bsearch (&value, esa->sorted, esa->rows, sizeof (int), esort_callback, esa, &pos, NULL);
memmove (esa->sorted + pos + 1, esa->sorted + pos, sizeof (int) * (esa->rows - pos));
esa->sorted[pos] = value;

View File

@ -795,19 +795,19 @@ ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width
for (i = 0; i < length; i++) {
ETableSortColumn column = e_table_sort_info_grouping_get_nth(ethi->sort_info, i);
g_hash_table_insert (arrows,
(gpointer) column.column,
(gpointer) (column.ascending ?
E_TABLE_COL_ARROW_UP :
E_TABLE_COL_ARROW_DOWN));
GINT_TO_POINTER (column.column),
GINT_TO_POINTER (column.ascending ?
E_TABLE_COL_ARROW_UP :
E_TABLE_COL_ARROW_DOWN));
}
length = e_table_sort_info_sorting_get_count(ethi->sort_info);
for (i = 0; i < length; i++) {
ETableSortColumn column = e_table_sort_info_sorting_get_nth(ethi->sort_info, i);
g_hash_table_insert (arrows,
(gpointer) column.column,
(gpointer) (column.ascending ?
E_TABLE_COL_ARROW_UP :
E_TABLE_COL_ARROW_DOWN));
GINT_TO_POINTER (column.column),
GINT_TO_POINTER (column.ascending ?
E_TABLE_COL_ARROW_UP :
E_TABLE_COL_ARROW_DOWN));
}
}
@ -839,7 +839,7 @@ ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width
width, height,
x2 - x1, ethi->height,
(ETableColArrow) g_hash_table_lookup (
arrows, (gpointer) ecol->col_idx));
arrows, GINT_TO_POINTER (ecol->col_idx)));
}
g_hash_table_destroy (arrows);
@ -991,10 +991,10 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event)
group_indent ++;
g_hash_table_insert (
arrows,
(gpointer) column.column,
(gpointer) (column.ascending ?
E_TABLE_COL_ARROW_UP :
E_TABLE_COL_ARROW_DOWN));
GINT_TO_POINTER (column.column),
GINT_TO_POINTER (column.ascending ?
E_TABLE_COL_ARROW_UP :
E_TABLE_COL_ARROW_DOWN));
}
length = e_table_sort_info_sorting_get_count(ethi->sort_info);
for (i = 0; i < length; i++) {
@ -1004,10 +1004,10 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event)
g_hash_table_insert (
arrows,
(gpointer) column.column,
(gpointer) (column.ascending ?
E_TABLE_COL_ARROW_UP :
E_TABLE_COL_ARROW_DOWN));
GINT_TO_POINTER (column.column),
GINT_TO_POINTER (column.ascending ?
E_TABLE_COL_ARROW_UP :
E_TABLE_COL_ARROW_DOWN));
}
}
@ -1031,7 +1031,7 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event)
col_width, ethi->height,
col_width, ethi->height,
(ETableColArrow) g_hash_table_lookup (
arrows, (gpointer) ecol->col_idx));
arrows, GINT_TO_POINTER (ecol->col_idx)));
gtk_drag_set_icon_pixmap (
context,
gdk_window_get_colormap (widget->window),

View File

@ -315,8 +315,8 @@ e_table_sorting_utils_tree_check_position (ETreeModel *source, ETableSortInfo *s
int
e_table_sorting_utils_tree_insert(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, int count, ETreePath path)
{
int start;
int end;
size_t start;
size_t end;
ETreeSortClosure closure;
closure.tree = source;

View File

@ -26,6 +26,7 @@
*/
#include <config.h>
#include <string.h>
#include <gal/unicode/gunicode.h>
#include <gal/widgets/e-unicode.h>
#include "e-completion-match.h"

View File

@ -27,6 +27,7 @@
#include <config.h>
#include <string.h>
#include <stdio.h>
#include <gtk/gtk.h>
#include "e-completion.h"