Author: benny Date: 2007-05-22 13:34:13 +0000 (Tue, 22 May 2007) New Revision: 25738
Modified: thunar/trunk/ChangeLog thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-info.sgml thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-mime-application.sgml thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-monitor.sgml thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-volume.sgml thunar/trunk/docs/reference/thunarx/tmpl/thunarx-provider-plugin.sgml thunar/trunk/thunar-vfs/thunar-vfs-path.c Log: 2007-05-22 Benedikt Meurer <[EMAIL PROTECTED]> * thunar-vfs/thunar-vfs-path.c: Fix unaligned access in ThunarVfsPath on sparc64. Bug #2815. * docs/reference/: Update reference manual. Modified: thunar/trunk/ChangeLog =================================================================== --- thunar/trunk/ChangeLog 2007-05-22 13:29:18 UTC (rev 25737) +++ thunar/trunk/ChangeLog 2007-05-22 13:34:13 UTC (rev 25738) @@ -1,3 +1,9 @@ +2007-05-22 Benedikt Meurer <[EMAIL PROTECTED]> + + * thunar-vfs/thunar-vfs-path.c: Fix unaligned access in ThunarVfsPath + on sparc64. Bug #2815. + * docs/reference/: Update reference manual. + 2007-05-20 Benedikt Meurer <[EMAIL PROTECTED]> * thunar/thunar-preferences.c(thunar_preferences_set_property): Modified: thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-info.sgml =================================================================== --- thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-info.sgml 2007-05-22 13:29:18 UTC (rev 25737) +++ thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-info.sgml 2007-05-22 13:34:13 UTC (rev 25738) @@ -125,8 +125,6 @@ @working_directory: @error: @Returns: -<!-- # Unused Parameters # --> [EMAIL PROTECTED]: <!-- ##### FUNCTION thunar_vfs_info_rename ##### --> Modified: thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-mime-application.sgml =================================================================== --- thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-mime-application.sgml 2007-05-22 13:29:18 UTC (rev 25737) +++ thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-mime-application.sgml 2007-05-22 13:34:13 UTC (rev 25738) @@ -69,8 +69,6 @@ @mime_application: @Returns: -<!-- # Unused Parameters # --> [EMAIL PROTECTED]: <!-- ##### FUNCTION thunar_vfs_mime_application_get_desktop_id ##### --> @@ -80,8 +78,6 @@ @mime_application: @Returns: -<!-- # Unused Parameters # --> [EMAIL PROTECTED]: <!-- ##### MACRO thunar_vfs_mime_application_get_flags ##### --> @@ -91,8 +87,6 @@ @mime_application: @Returns: -<!-- # Unused Parameters # --> [EMAIL PROTECTED]: <!-- ##### MACRO thunar_vfs_mime_application_get_name ##### --> @@ -102,8 +96,6 @@ @mime_application: @Returns: -<!-- # Unused Parameters # --> [EMAIL PROTECTED]: <!-- ##### FUNCTION thunar_vfs_mime_application_hash ##### --> @@ -113,8 +105,6 @@ @mime_application: @Returns: -<!-- # Unused Parameters # --> [EMAIL PROTECTED]: <!-- ##### FUNCTION thunar_vfs_mime_application_equal ##### --> Modified: thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-monitor.sgml =================================================================== --- thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-monitor.sgml 2007-05-22 13:29:18 UTC (rev 25737) +++ thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-monitor.sgml 2007-05-22 13:34:13 UTC (rev 25738) @@ -50,9 +50,6 @@ @handle_path: @event_path: @user_data: -<!-- # Unused Parameters # --> [EMAIL PROTECTED]: [EMAIL PROTECTED]: <!-- ##### FUNCTION thunar_vfs_monitor_get_default ##### --> @@ -73,8 +70,6 @@ @callback: @user_data: @Returns: -<!-- # Unused Parameters # --> [EMAIL PROTECTED]: <!-- ##### FUNCTION thunar_vfs_monitor_add_file ##### --> @@ -87,8 +82,6 @@ @callback: @user_data: @Returns: -<!-- # Unused Parameters # --> [EMAIL PROTECTED]: <!-- ##### FUNCTION thunar_vfs_monitor_remove ##### --> @@ -108,8 +101,6 @@ @monitor: @event: @path: -<!-- # Unused Parameters # --> [EMAIL PROTECTED]: <!-- ##### FUNCTION thunar_vfs_monitor_wait ##### --> Modified: thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-volume.sgml =================================================================== --- thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-volume.sgml 2007-05-22 13:29:18 UTC (rev 25737) +++ thunar/trunk/docs/reference/thunar-vfs/tmpl/thunar-vfs-volume.sgml 2007-05-22 13:34:13 UTC (rev 25738) @@ -47,6 +47,7 @@ @THUNAR_VFS_VOLUME_STATUS_MOUNTED: @THUNAR_VFS_VOLUME_STATUS_PRESENT: [EMAIL PROTECTED]: <!-- ##### STRUCT ThunarVfsVolume ##### --> <para> Modified: thunar/trunk/docs/reference/thunarx/tmpl/thunarx-provider-plugin.sgml =================================================================== --- thunar/trunk/docs/reference/thunarx/tmpl/thunarx-provider-plugin.sgml 2007-05-22 13:29:18 UTC (rev 25737) +++ thunar/trunk/docs/reference/thunarx/tmpl/thunarx-provider-plugin.sgml 2007-05-22 13:34:13 UTC (rev 25738) @@ -93,7 +93,7 @@ @plugin: @name: [EMAIL PROTECTED]: [EMAIL PROTECTED]: @Returns: @@ -104,7 +104,7 @@ @plugin: @name: [EMAIL PROTECTED]: [EMAIL PROTECTED]: @Returns: Modified: thunar/trunk/thunar-vfs/thunar-vfs-path.c =================================================================== --- thunar/trunk/thunar-vfs/thunar-vfs-path.c 2007-05-22 13:29:18 UTC (rev 25737) +++ thunar/trunk/thunar-vfs/thunar-vfs-path.c 2007-05-22 13:34:13 UTC (rev 25738) @@ -1,6 +1,6 @@ /* $Id$ */ /*- - * Copyright (c) 2005-2006 Benedikt Meurer <[EMAIL PROTECTED]> + * Copyright (c) 2005-2007 Benedikt Meurer <[EMAIL PROTECTED]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -46,11 +46,11 @@ /* Masks to handle the 4-byte aligned path names */ #if G_BYTE_ORDER == G_LITTLE_ENDIAN -#define THUNAR_VFS_PATH_MASK (0xffu << ((sizeof (guint) - 1) * 8)) +#define THUNAR_VFS_PATH_MASK (0xffu << ((sizeof (gsize) - 1) * 8)) #define THUNAR_VFS_PATH_ROOT (0x2fu) #elif G_BYTE_ORDER == G_BIG_ENDIAN #define THUNAR_VFS_PATH_MASK (0xffu) -#define THUNAR_VFS_PATH_ROOT (0x2fu << ((sizeof (guint) - 1) * 8)) +#define THUNAR_VFS_PATH_ROOT (0x2fu << ((sizeof (gsize) - 1) * 8)) #else #error "Unsupported endianess" #endif @@ -484,7 +484,7 @@ thunar_vfs_path_unref (ThunarVfsPath *path) { ThunarVfsPath *parent; - const guint *p; + const gsize *p; while (path != NULL && (g_atomic_int_exchange_and_add (&path->ref_count, -1) & ~THUNAR_VFS_PATH_SCHEME_MASK) == 1) { @@ -519,7 +519,7 @@ THUNAR_VFS_PATH_DEBUG_REMOVE (path); /* release the path resources (we need to determine the size for the slice allocator) */ - for (p = (const guint *) thunar_vfs_path_get_name (path); (*p & THUNAR_VFS_PATH_MASK) != 0u; ++p) + for (p = (const gsize *) thunar_vfs_path_get_name (path); (*p & THUNAR_VFS_PATH_MASK) != 0u; ++p) ; _thunar_vfs_slice_free1 (((const guint8 *) (p + 1)) - ((const guint8 *) path), path); @@ -570,8 +570,8 @@ { const ThunarVfsPath *path_a = path_ptr_a; const ThunarVfsPath *path_b = path_ptr_b; - const guint *a; - const guint *b; + const gsize *a; + const gsize *b; /* compare the schemes */ if (thunar_vfs_path_get_scheme (path_a) != thunar_vfs_path_get_scheme (path_b)) @@ -583,8 +583,8 @@ return TRUE; /* compare the last path component */ - a = (const guint *) thunar_vfs_path_get_name (path_a); - b = (const guint *) thunar_vfs_path_get_name (path_b); + a = (const gsize *) thunar_vfs_path_get_name (path_a); + b = (const gsize *) thunar_vfs_path_get_name (path_b); for (;;) { if (*a != *b) @@ -1120,7 +1120,7 @@ _thunar_vfs_return_if_fail (n_home_components == 0); /* include the root element */ - n_bytes = sizeof (ThunarVfsPath) + sizeof (guint); + n_bytes = sizeof (ThunarVfsPath) + sizeof (gsize); n_home_components = 1; /* split the home path into its components */ @@ -1128,7 +1128,7 @@ for (component = components; *component != NULL; ++component) if (G_LIKELY (**component != '\0')) { - n_bytes += sizeof (ThunarVfsPath) + ((strlen (*component) + sizeof (guint)) / sizeof (guint)) * sizeof (guint); + n_bytes += sizeof (ThunarVfsPath) + ((strlen (*component) + sizeof (gsize)) / sizeof (gsize)) * sizeof (gsize); n_home_components += 1; } @@ -1141,8 +1141,8 @@ path->ref_count = 1; path->parent = NULL; home_components[0] = path; - *((guint *) thunar_vfs_path_get_name (path)) = THUNAR_VFS_PATH_ROOT; - offset += sizeof (ThunarVfsPath) + sizeof (guint); + *((gsize *) thunar_vfs_path_get_name (path)) = THUNAR_VFS_PATH_ROOT; + offset += sizeof (ThunarVfsPath) + sizeof (gsize); /* add the remaining path components */ for (component = components; *component != NULL; ++component) @@ -1155,7 +1155,7 @@ home_components[++n] = path; /* calculate the offset for the next home path component */ - offset += sizeof (ThunarVfsPath) + ((strlen (*component) + sizeof (guint)) / sizeof (guint)) * sizeof (guint); + offset += sizeof (ThunarVfsPath) + ((strlen (*component) + sizeof (gsize)) / sizeof (gsize)) * sizeof (gsize); /* copy the path */ for (s = *component, t = (gchar *) thunar_vfs_path_get_name (path); *s != '\0'; ) @@ -1170,10 +1170,10 @@ g_assert (n_home_components == n + 1); /* allocate the trash root path */ - _thunar_vfs_path_trash_root = g_malloc (sizeof (ThunarVfsPath) + sizeof (guint)); + _thunar_vfs_path_trash_root = g_malloc (sizeof (ThunarVfsPath) + sizeof (gsize)); _thunar_vfs_path_trash_root->ref_count = 1 | THUNAR_VFS_PATH_SCHEME_TRASH; _thunar_vfs_path_trash_root->parent = NULL; - *((guint *) thunar_vfs_path_get_name (_thunar_vfs_path_trash_root)) = THUNAR_VFS_PATH_ROOT; + *((gsize *) thunar_vfs_path_get_name (_thunar_vfs_path_trash_root)) = THUNAR_VFS_PATH_ROOT; /* cleanup */ g_strfreev (components); @@ -1252,7 +1252,7 @@ /* determine the length of the path component in bytes */ for (s1 = s + 1; *s1 != '\0' && *s1 != G_DIR_SEPARATOR; ++s1) ; - n = (((s1 - s) + sizeof (guint)) / sizeof (guint)) * sizeof (guint) + n = (((s1 - s) + sizeof (gsize)) / sizeof (gsize)) * sizeof (gsize) + sizeof (ThunarVfsPath); /* allocate memory for the new path component */ @@ -1264,7 +1264,7 @@ THUNAR_VFS_PATH_DEBUG_INSERT (path); /* zero out the last word to have the name zero-terminated */ - *(((guint *) (((gchar *) path) + n)) - 1) = 0; + *(((gsize *) (((gchar *) path) + n)) - 1) = 0; /* copy the path component name */ for (t = (gchar *) thunar_vfs_path_get_name (path); *s != '\0' && *s != G_DIR_SEPARATOR; ) @@ -1325,7 +1325,7 @@ /* determine the length of the name in bytes */ for (s = name + 1; *s != '\0'; ++s) ; - n = (((s - name) + sizeof (guint)) / sizeof (guint)) * sizeof (guint) + n = (((s - name) + sizeof (gsize)) / sizeof (gsize)) * sizeof (gsize) + sizeof (ThunarVfsPath); /* allocate memory for the new path component */ @@ -1337,7 +1337,7 @@ THUNAR_VFS_PATH_DEBUG_INSERT (path); /* zero out the last word to have the name zero-terminated */ - *(((guint *) (((gchar *) path) + n)) - 1) = 0; + *(((gsize *) (((gchar *) path) + n)) - 1) = 0; /* copy the path component name */ for (s = name, t = (gchar *) thunar_vfs_path_get_name (path); *s != '\0'; ) _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits