Re: More on 64-bit code changes



Tim Janik wrote:
> 
> On Mon, 21 May 2001, Mark Murnane wrote:
> 
> > Tim,
> >
> > I've gone over your comments on the proposed set of 64-bit changes.
> > I've attached a new diff which basically includes all of the
> > uncontroversial changes, i.e. sizes and the like.  I'm still looking at
> > some of the others, i.e. hashing, casting macros, etc.
> >
> > I'll hopefully have more to add on that subject tomorrow.
> >
> > Anyway, these ones shouldn't cause too much of a problem.
> 
> > Index: ghash.c
> > ===================================================================
> > RCS file: /sgnome/cvsroots/GNOME/glib/ghash.c,v
> > retrieving revision 1.26
> > diff -u -r1.26 ghash.c
> > --- ghash.c   2001/05/04 17:01:53     1.26
> > +++ ghash.c   2001/05/21 16:00:20
> > @@ -32,6 +32,7 @@
> >  #include <config.h>
> >  #endif
> >
> > +#include <stdio.h>
> >  #include "glib.h"
> >
> 
> (we usually don't need stdio.h)
> what did you add this for here?

Whoops!  Meant to take that out.  We've had a few problems, I think to
do with the order of include files, where NULL doesn't get defined
properly for the 64-bit platform.  This causes the build to break as
anytime NULL is used as a GDestroyNotify the compiler will halt. 
Including stdio.h, or any file that will define NULL properly,
beforehand means the build will run straight through without falling
over.  That little snippet can be removed.  

> > @@ -759,7 +759,7 @@
> >  #ifdef P_tmpdir
> >        if (!g_tmp_dir)
> >         {
> > -         int k;
> > +         gsize k;
> >           g_tmp_dir = g_strdup (P_tmpdir);
> >           k = strlen (g_tmp_dir);
> >           if (g_tmp_dir[k-1] == G_DIR_SEPARATOR)
> > @@ -827,7 +827,7 @@
> >          struct passwd pwd;
> >  #    ifdef _SC_GETPW_R_SIZE_MAX
> >         /* This reurns the maximum length */
> > -        guint bufsize = sysconf (_SC_GETPW_R_SIZE_MAX);
> > +        guint bufsize = (guint)sysconf (_SC_GETPW_R_SIZE_MAX);
> >  #    else /* _SC_GETPW_R_SIZE_MAX */
> >          guint bufsize = 64;
> >  #    endif /* _SC_GETPW_R_SIZE_MAX */
> 
> there's really no need to cast long->int here.

I know, but it doesn't hurt.  Just makes it explicit that the return
type is being squashed.

> 
> > @@ -130,15 +130,14 @@
> >
> >  /* Miscellaneous utility functions
> >   */
> > -guint                 g_parse_debug_string (const gchar     *string,
> > -                                           const GDebugKey *keys,
> > -                                           guint            nkeys);
> > -
> > -gint                  g_snprintf           (gchar       *string,
> > +guint                 g_parse_debug_string (const gchar *string,
> > +                                           const GDebugKey   *keys,
> > +                                           guint        nkeys);
> > +glong                 g_snprintf           (gchar       *string,
> >                                             gulong       n,
> >                                             gchar const *format,
> >                                             ...) G_GNUC_PRINTF (3, 4);
> > -gint                  g_vsnprintf          (gchar       *string,
> > +glong                 g_vsnprintf          (gchar       *string,
> >                                             gulong       n,
> >                                             gchar const *format,
> >                                             va_list      args);
> 
> since standard printf() is still returning an int,
> g_snprintf and g_vsnprintf should as well.

Another mistake.  Meant to change that too.

> i'd like to get a final ok from owen before changing
> GSource timeouts from int to long (though as i said
> in my last mail, i think this change is for the
> good, especially since we just revamped that API already).
> 

I've attached a revised diff with those issues taken care of.

Thanks,

Mark

------------------------------------
Mark Murnane
Desktop, Applications and Middleware
Sun Microsystems Ireland
------------------------------------

Attachment: glib-64-bit-initial.diff.gz
Description: GNU Zip compressed data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]