mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-03 17:48:56 +01:00 
			
		
		
		
	Bug 570501 - g_win32_get_system_data_dirs uses invalid conversion of
2009-02-23 Tor Lillqvist <tml@novell.com> Bug 570501 - g_win32_get_system_data_dirs uses invalid conversion of function pointer to object pointer * glib/gutils.c (g_win32_get_system_data_dirs_for_module): Change the type of the function's parameter to be explicitly a function pointer. * glib/gutils.h (_g_win32_get_system_data_dirs): Modify declaration and the only caller, the inline _g_win32_get_system_data_dirs(), accordingly. Add comments pointing out these are internal GLib functions. svn path=/trunk/; revision=7899
This commit is contained in:
		
				
					committed by
					
						
						Tor Lillqvist
					
				
			
			
				
	
			
			
			
						parent
						
							f548330275
						
					
				
				
					commit
					739a81e08a
				
			
							
								
								
									
										14
									
								
								ChangeLog
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								ChangeLog
									
									
									
									
									
								
							@@ -1,3 +1,17 @@
 | 
				
			|||||||
 | 
					2009-02-23  Tor Lillqvist  <tml@novell.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						Bug 570501 - g_win32_get_system_data_dirs uses invalid conversion
 | 
				
			||||||
 | 
						of function pointer to object pointer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* glib/gutils.c (g_win32_get_system_data_dirs_for_module): Change
 | 
				
			||||||
 | 
						the type of the function's parameter to be explicitly a function
 | 
				
			||||||
 | 
						pointer.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* glib/gutils.h (_g_win32_get_system_data_dirs): Modify
 | 
				
			||||||
 | 
						declaration and the only caller, the inline
 | 
				
			||||||
 | 
						_g_win32_get_system_data_dirs(), accordingly. Add comments
 | 
				
			||||||
 | 
						pointing out these are internal GLib functions.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
2009-02-22  Matthias Clasen  <mclasen@redhat.com>
 | 
					2009-02-22  Matthias Clasen  <mclasen@redhat.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	Bug 572151 – “it's” and “its” confused in docs and comments
 | 
						Bug 572151 – “it's” and “its” confused in docs and comments
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2578,7 +2578,7 @@ get_module_share_dir (gconstpointer address)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
G_CONST_RETURN gchar * G_CONST_RETURN *
 | 
					G_CONST_RETURN gchar * G_CONST_RETURN *
 | 
				
			||||||
g_win32_get_system_data_dirs_for_module (gconstpointer address)
 | 
					g_win32_get_system_data_dirs_for_module (void (*address_of_function)())
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  GArray *data_dirs;
 | 
					  GArray *data_dirs;
 | 
				
			||||||
  HMODULE hmodule;
 | 
					  HMODULE hmodule;
 | 
				
			||||||
@@ -2587,10 +2587,10 @@ g_win32_get_system_data_dirs_for_module (gconstpointer address)
 | 
				
			|||||||
  gchar *p;
 | 
					  gchar *p;
 | 
				
			||||||
  gchar *exe_root;
 | 
					  gchar *exe_root;
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
  if (address)
 | 
					  if (address_of_function)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      G_LOCK (g_utils_global);
 | 
					      G_LOCK (g_utils_global);
 | 
				
			||||||
      hmodule = get_module_for_address (address);
 | 
					      hmodule = get_module_for_address (address_of_function);
 | 
				
			||||||
      if (hmodule != NULL)
 | 
					      if (hmodule != NULL)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
	  if (per_module_data_dirs == NULL)
 | 
						  if (per_module_data_dirs == NULL)
 | 
				
			||||||
@@ -2628,9 +2628,9 @@ g_win32_get_system_data_dirs_for_module (gconstpointer address)
 | 
				
			|||||||
   * subdirectory of the installation directory for the package
 | 
					   * subdirectory of the installation directory for the package
 | 
				
			||||||
   * our caller is a part of.
 | 
					   * our caller is a part of.
 | 
				
			||||||
   *
 | 
					   *
 | 
				
			||||||
   * The address parameter, if non-NULL, points to a function in the
 | 
					   * The address_of_function parameter, if non-NULL, points to a
 | 
				
			||||||
   * calling module. Use that to determine that module's installation
 | 
					   * function in the calling module. Use that to determine that
 | 
				
			||||||
   * folder, and use its "share" subfolder.
 | 
					   * module's installation folder, and use its "share" subfolder.
 | 
				
			||||||
   *
 | 
					   *
 | 
				
			||||||
   * Additionally, also use the "share" subfolder of the installation
 | 
					   * Additionally, also use the "share" subfolder of the installation
 | 
				
			||||||
   * locations of GLib and the .exe file being run.
 | 
					   * locations of GLib and the .exe file being run.
 | 
				
			||||||
@@ -2642,7 +2642,7 @@ g_win32_get_system_data_dirs_for_module (gconstpointer address)
 | 
				
			|||||||
   * function.
 | 
					   * function.
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  p = get_module_share_dir (address);
 | 
					  p = get_module_share_dir (address_of_function);
 | 
				
			||||||
  if (p)
 | 
					  if (p)
 | 
				
			||||||
    g_array_append_val (data_dirs, p);
 | 
					    g_array_append_val (data_dirs, p);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
@@ -2663,7 +2663,7 @@ g_win32_get_system_data_dirs_for_module (gconstpointer address)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  retval = (gchar **) g_array_free (data_dirs, FALSE);
 | 
					  retval = (gchar **) g_array_free (data_dirs, FALSE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (address)
 | 
					  if (address_of_function)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      if (hmodule != NULL)
 | 
					      if (hmodule != NULL)
 | 
				
			||||||
	g_hash_table_insert (per_module_data_dirs, hmodule, retval);
 | 
						g_hash_table_insert (per_module_data_dirs, hmodule, retval);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -133,16 +133,21 @@ G_CONST_RETURN gchar*    g_get_user_cache_dir     (void);
 | 
				
			|||||||
G_CONST_RETURN gchar* G_CONST_RETURN * g_get_system_data_dirs   (void);
 | 
					G_CONST_RETURN gchar* G_CONST_RETURN * g_get_system_data_dirs   (void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef G_OS_WIN32
 | 
					#ifdef G_OS_WIN32
 | 
				
			||||||
G_CONST_RETURN gchar* G_CONST_RETURN * g_win32_get_system_data_dirs_for_module (gconstpointer address);
 | 
					/* This functions is not part of the public GLib API */
 | 
				
			||||||
 | 
					G_CONST_RETURN gchar* G_CONST_RETURN * g_win32_get_system_data_dirs_for_module (void (*address_of_function)());
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined (G_OS_WIN32) && defined (G_CAN_INLINE) && !defined (__cplusplus)
 | 
					#if defined (G_OS_WIN32) && defined (G_CAN_INLINE) && !defined (__cplusplus)
 | 
				
			||||||
 | 
					/* This function is not part of the public GLib API either. Just call
 | 
				
			||||||
 | 
					 * g_get_system_data_dirs() in your code, never mind that that is
 | 
				
			||||||
 | 
					 * actually a macro and you will in fact call this inline function.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
static inline G_CONST_RETURN gchar * G_CONST_RETURN *
 | 
					static inline G_CONST_RETURN gchar * G_CONST_RETURN *
 | 
				
			||||||
g_win32_get_system_data_dirs (void)
 | 
					_g_win32_get_system_data_dirs (void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  return g_win32_get_system_data_dirs_for_module ((gconstpointer) &g_win32_get_system_data_dirs);
 | 
					  return g_win32_get_system_data_dirs_for_module ((void (*)()) &_g_win32_get_system_data_dirs);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#define g_get_system_data_dirs g_win32_get_system_data_dirs
 | 
					#define g_get_system_data_dirs _g_win32_get_system_data_dirs
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
G_CONST_RETURN gchar* G_CONST_RETURN * g_get_system_config_dirs (void);
 | 
					G_CONST_RETURN gchar* G_CONST_RETURN * g_get_system_config_dirs (void);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user