Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] PATCH: gint/gpointer casting in GTK+ client
Home

[Freeciv-Dev] PATCH: gint/gpointer casting in GTK+ client

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] PATCH: gint/gpointer casting in GTK+ client
From: Ben Webb <ben@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 8 Oct 2001 19:11:48 +0100 (BST)

        There are a lot of places in the GTK+ client where integer values
are cast to and from pointer values. This causes no problems on (for
example) an i386 Linux box, since sizeof(gint)=sizeof(gpointer). However,
this is not the case on my Alpha box. The GLib guys have already allowed
for this, however, and have provided GINT_TO_POINTER and GPOINTER_TO_INT
macros for supposedly "safe" casts. The attached patch replaces the
existing casts with the GLib macros, removing a LOT of redundant warnings
when compiling on an Alpha.

        The patch touches little code, so I don't see any reasonable
reason why it shouldn't be committed. Complaints?

        Ben
-- 
ben@xxxxxxxxxxxxxxxxxxxxxx           http://bellatrix.pcl.ox.ac.uk/~ben/
"Verbosity leads to unclear, inarticulate things."
        - Vice President Dan Quayle, 11/30/88

Attachment: gintpointer.patch.gz
Description: GNU Zip compressed data


[Prev in Thread] Current Thread [Next in Thread]