[Mono-list] [PATCH] kill warnings part 1

Paolo Molaro lupus@ximian.com
Sat, 1 Jun 2002 15:19:56 +0200


On 06/01/02 Dennis Haney wrote:
> I've made a small patch to make most of the mono/mono subdir compile
> without warnings. Please verify that I've not introduced some strange
> error. Particularly in the assembly code (a change which actually
> makes it compile in gcc-3.1).

Well, it seems the build breaker was the atomic.h bits.
Anyway, I applied some of your fixes.
The assembly code changes are wrong and have not been applied
(I fixed the warnings though). An AssemblyName is not the same thing as
the assembly name: it contains also the info on version, culture etc.
You can't just ignore all the info and use only the bare string name.

> Index: metadata/appdomain.h
> ===================================================================
> RCS file: /mono/mono/mono/metadata/appdomain.h,v
> retrieving revision 1.18
> diff -u -b -B -r1.18 appdomain.h
> --- metadata/appdomain.h	23 May 2002 07:44:00 -0000	1.18
> +++ metadata/appdomain.h	1 Jun 2002 00:03:32 -0000
> @@ -65,7 +65,7 @@
>  	GHashTable         *env;
>  	GHashTable         *assemblies;
>  	MonoAppDomainSetup *setup;
> -	char*              *friendly_name;
> +	char               *friendly_name;

Thanks for catching this one!

> --- metadata/metadata.c	31 May 2002 09:50:46 -0000	1.83
> +++ metadata/metadata.c	1 Jun 2002 00:03:33 -0000
> @@ -2182,19 +2182,21 @@
>   * Computes an hash value for @t1 to be used in GHashTable.
>   */
>  guint
> -mono_metadata_type_hash (MonoType *t1)
> +//mono_metadata_type_hash (const MonoType *t1)
> +mono_metadata_type_hash (gconstpointer t1)

I prefer keeping the current prototype for type safety and
adding a cast when the function is used in the hash table creation.

lupus

-- 
-----------------------------------------------------------------
lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better