Thanks a lot.
VictoR
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
gint, gchar ..., are not defined by the C standard. They are therefore
likely to be either an extension provided by the compiler or a typedef
from a library. Either read your compiler's documentation, and/or
search any 3rd party library header files for the definition.
--
Tristan Styles #1485
Failure is not an Option
It is Standard Operating Procedure
Please, explain what is gint, gchar...?
What difference are from int, char...?
They're defined by libglib; beyond that I don't know. I suspect you
could consult the libglib docs at http://www.gtk.org for more
information. They're not standard ANSI C types.
--
"Large amounts of money tend to quench any scruples I might be having."
-- Stephan Wilms
This is off topic for comp.lang.c. In standard C there is no type as
'gint' or 'gchar'. My guess is that you are using the glib library
from the gtk+ toolkit. You will find better answers to the questions
you seek by consulting the appropriate newsgroup. Being that there is
no dedicated gtk or gimp newsgroup, the best place to ask this question
might be in comp.os.linux.development.apps because gtk is a widely used
toolkit on that platform.
Paul
--
Paul D. Boyle | bo...@laue.chem.ncsu.edu
Director, X-ray Structural Facility | phone: (919) 515-7362
Department of Chemistry - Box 8204 | FAX: (919) 515-5079
North Carolina State University |
Raleigh, NC, 27695-8204
http://laue.chem.ncsu.edu/web/xray.welcome.html
Umm, never heard of gint, gchar, I dobut there is such thing, must be a
typo, or something misunderstood. I hope.
Uzo
I think that it might be a typedef from the GLIB library. This is a supporting
library for GTK.
Here is a snippet from /usr/local/include/gint.h on the system that
I'm posting from:
/* GLIB - Library of useful routines for C programming
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
[ big snip ]
/* Provide type definitions for commonly used types.
* These are useful because a "gint8" can be adjusted
* to be 1 byte (8 bits) on all platforms. Similarly and
* more importantly, "gint32" can be adjusted to be
* 4 bytes (32 bits) on all platforms.
*/
typedef char gchar;
typedef short gshort;
typedef long glong;
typedef int gint;
typedef gint gboolean;
It's funny how even very good programmers get sucked into superstitious rituals
involving useless typedefs that solve imagined porting issues that haven't
actually arisen and never will.
never occur.
On Dos (and Unix I thing) an integer is 16-bit, on Windows, it's 32-bit. =
Isn't that
an issue?
It's a much more general issue than that. `typedef int gint' is not a
solution. (And all Unices I've of have `int' of at least 32 bits.)
--
"In My Egotistical Opinion, most people's C programs should be indented six
feet downward and covered with dirt." -- Blair P. Houghton
Kaz Kylheku a écrit:
--
Anyone uses that signature feature in their mail program?
> On Dos (and Unix I thing) an integer is 16-bit, on Windows, it's 32-bit. =
> Isn't that
> an issue?
>It's a much more general issue than that. `typedef int gint' is not a
>solution. (And all Unices I've of have `int' of at least 32 bits.)
I agree the "gint" thing is wacky, but the "gchar" thing is so we can
eventually migrate to "typedef wchar_t gchar".
And please don't forget what the comment was actually talking about, i.e. :
typedef signed char gint8;
typedef unsigned char guint8;
typedef signed short gint16;
typedef unsigned short guint16;
typedef signed int gint32;
typedef unsigned int guint32;
This is sensible. Indeed, they are standardising it.
--
Robert
Please try to follow the Usenet convention of adding your text *after* the
quoted material, and also the practice of trimming replies reasonably.
It is only sensible when you are writing code that interfaces with specific
hardware, whereby you need to create a memory access having a given width.
Most other uses are simply a case of wanting to continue assembly language
programming in a higher level language.
My DOS, Unix, and Winblows compilers all use 32-bit ints. This is not a
platform issue.
--
Martin Ambuhl (mam...@earthlink.net)
Note: mam...@tiac.net will soon be inactive
...or you are reading and writing portable binary file formats.
...or you are reading and writing binary streams over a network.
With exact-sized types and ntohl/htonl etc., these problems are solvable.
--
Richard Krehbiel, Kastle Systems, Arlington VA USA
ri...@kastle.com (work) or kreh...@crosslink.net (personal)