Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.

Wed Jun 20 12:00:54 2001  Owen Taylor  <otaylor@redhat.com>

        Changes for 64-bit cleanliness, loosely based on patch
	from Mark Murnane.

	* gconvert.c (g_convert/g_convert_with_fallback): Remove
	workarounds for since-fixed GNU libc bugs. Minor
	doc fix.

	* gconvert.[ch]: Change gint to gsize/gssize as
	appropriate.

	* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
	computation of bytes_read / bytes_written.

	* gfileutils.[ch] (g_file_get_contents): Make length
	out parameter 'gsize *len'.

	* ghook.c (g_hook_compare_ids): Don't compare a
	and b as 'a - b'.

	* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
	GSIZE_TO_POINTER.

	* gmain.c (g_timeout_prepare): Rewrite to avoid
	overflows. (Fixes bug when system clock skews
	backwards more than 24 days.)

	* gmarkup.[ch]: Make lengths passed to callbacks
	gsize, length for g_markup_parse-context_parse(),
	g_markup_escape_text() gssize.

	* gmessages.[ch] (g_printf_string_upper_bound): Change
	return value to gsize.

	* gmessages.c (printf_string_upper_bound): Remove
	a ridiculous use of 'inline' on a 300 line function.

	* gstring.[ch]: Represent size of string as a gsize,
	not gint. Make parameters to functions take gsize,
	or gssize where -1 is allowed.

	* gstring.c (g_string_erase): Make
	g_string_erase (string, pos, -1) a synonym for
	g_string_truncate for consistency with other G*
	APIs.

	* gstrfuncs.[ch]: Make all functions taking a string
	length, take a gsize, or gssize if -1 is allowed.
	(g_strstr_len, g_strrstr_len). Also fix some boundary
	conditions in g_str[r]str[_len].

	* gutf8.c tests/unicode-encoding.c: Make parameters that
	are byte lengths gsize, gssize as appropriate. Make
	character offsets, other counts, glong.

	* gasyncqueue.c gcompletion.c
          timeloop.c timeloop-basic.c gutils.c gspawn.c.
	Small 64 bit cleanliness fixups.

	* glist.c (g_list_sort2, g_list_sort_real): Fix functions
	that should have been static.

	* gdate.c (g_date_fill_parse_tokens): Fix extra
	declaration that was shadowing another.

	* tests/module-test.c: Include string.h

Mon Jun 18 15:43:29 2001  Owen Taylor  <otaylor@redhat.com>

	* gutf8.c (g_get_charset): Make argument
	G_CONST_RETURN char **.
This commit is contained in:
Owen Taylor
2001-06-23 13:55:09 +00:00
committed by Owen Taylor
parent a7bd3d0d5e
commit f5c28ce4ab
70 changed files with 1453 additions and 807 deletions

View File

@@ -109,7 +109,7 @@ typedef enum
* in case the locale's charset will be changed later using setlocale()
* or in some other way.
*/
gboolean g_get_charset (char **charset);
gboolean g_get_charset (G_CONST_RETURN char **charset);
/* These are all analogs of the <ctype.h> functions.
*/
@@ -169,8 +169,8 @@ GLIB_VAR char g_utf8_skip[256];
gunichar g_utf8_get_char (const gchar *p);
gchar* g_utf8_offset_to_pointer (const gchar *str,
gint offset);
gint g_utf8_pointer_to_offset (const gchar *str,
glong offset);
glong g_utf8_pointer_to_offset (const gchar *str,
const gchar *pos);
gchar* g_utf8_prev_char (const gchar *p);
gchar* g_utf8_find_next_char (const gchar *p,
@@ -178,8 +178,8 @@ gchar* g_utf8_find_next_char (const gchar *p,
gchar* g_utf8_find_prev_char (const gchar *str,
const gchar *p);
gint g_utf8_strlen (const gchar *p,
gint max);
glong g_utf8_strlen (const gchar *p,
gssize max);
/* Copies n characters from src to dest */
gchar* g_utf8_strncpy (gchar *dest,
@@ -189,44 +189,44 @@ gchar* g_utf8_strncpy (gchar *dest,
/* Find the UTF-8 character corresponding to ch, in string p. These
functions are equivalants to strchr and strrchr */
gchar* g_utf8_strchr (const gchar *p,
gint len,
gssize len,
gunichar c);
gchar* g_utf8_strrchr (const gchar *p,
gint len,
gssize len,
gunichar c);
gunichar2 *g_utf8_to_utf16 (const gchar *str,
gint len,
gint *items_read,
gint *items_written,
glong len,
glong *items_read,
glong *items_written,
GError **error);
gunichar * g_utf8_to_ucs4 (const gchar *str,
gint len,
gint *items_read,
gint *items_written,
glong len,
glong *items_read,
glong *items_written,
GError **error);
gunichar * g_utf8_to_ucs4_fast (const gchar *str,
gint len,
gint *items_written);
glong len,
glong *items_written);
gunichar * g_utf16_to_ucs4 (const gunichar2 *str,
gint len,
gint *items_read,
gint *items_written,
glong len,
glong *items_read,
glong *items_written,
GError **error);
gchar* g_utf16_to_utf8 (const gunichar2 *str,
gint len,
gint *items_read,
gint *items_written,
glong len,
glong *items_read,
glong *items_written,
GError **error);
gunichar2 *g_ucs4_to_utf16 (const gunichar *str,
gint len,
gint *items_read,
gint *items_written,
glong len,
glong *items_read,
glong *items_written,
GError **error);
gchar* g_ucs4_to_utf8 (const gunichar *str,
gint len,
gint *items_read,
gint *items_written,
glong len,
glong *items_read,
glong *items_written,
GError **error);
/* Convert a single character into UTF-8. outbuf must have at
@@ -234,14 +234,14 @@ gchar* g_ucs4_to_utf8 (const gunichar *str,
* result.
*/
gint g_unichar_to_utf8 (gunichar c,
char *outbuf);
gchar *outbuf);
/* Validate a UTF8 string, return TRUE if valid, put pointer to
* first invalid char in **end
*/
gboolean g_utf8_validate (const gchar *str,
gint max_len,
gssize max_len,
const gchar **end);
/* Validate a Unicode character */