Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2009-10

csize_t

10 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Felipe Monteiro de Carvalho

Hello,

In the past there was a csize_t which I used in the imagemagick headers, but now it seams to have disappeared. Is size_t compatible with the c type? Or else any other compatible type to use?

thanks,

Felipe Monteiro de Carvalho

Reply by email

Vincent Snijders
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 6 lines
Hello, In the past there was a csize_t which I used in the imagemagick headers, but now it seams to have disappeared. Is size_t compatible with the c type? Or else any other compatible type to use?

Well, there is still is:
http://lazarus-ccr.sourceforge.net/fpcdoc/rtl/ctypes/csize_t.html

I think the description is a bit strange: "Character size type". I wouldhave guess the c was not because of Character, but because of the C language.

Vincent

Reply by email

Vincent Snijders
to Felipe Monteiro de Carvalho: On Wed, Oct 28, 2009 at 4:51 PM, Vincent Snijders The docs could be out-dated, csize_t…
Felipe Monteiro de Carvalho wrote 7 lines
On Wed, Oct 28, 2009 at 4:51 PM, Vincent Snijders wrote: > Well, there is still is: > http://lazarus-ccr.sourceforge.net/fpcdoc/rtl/ctypes/csize_t.html The docs could be out-dated, csize_t doesn't compile in FPC 2.2.4

Or maybe too new. Try to compile with 2.5.1 or 2.3.1.

Show quoted text 5 lines
> I think the description is a bit strange: "Character size type". I wouldhave > guess the c was not because of Character, but because of the C language. The descriptions is completely wrong.

Michael, do you need a bug report?

Vincent

Reply by email

Graeme Geldenhuys
to Vincent Snijders

2009/10/28 Vincent Snijders :

Show quoted text 8 lines
>> I think the description is a bit strange: "Character size type". I >> wouldhave >> guess the c was not because of Character, but because of the C language. > > The descriptions is completely wrong. > Michael, do you need a bug report?

Originally Posted by google
`size_t' is a type suitable for representing the amount of memory a data object requires, expressed in units of `char'. It is an integer type (C cannot keep track of fractions of a `char'), and it is unsigned (negative sizes make no sense). It is the type of the result of the `sizeof' operator. It is the type you pass to malloc() and friends to say how much memory you want. It is the type returned by strlen() to say how many "significant" characters are in a string

The more detailed answer is here:
http://bytes.com/forum/thread220206.html

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Michael Van Canneyt
to Felipe Monteiro de Carvalho: On Wed, Oct 28, 2009 at 4:51 PM, Vincent Snijders The docs could be out-dated, csize_t…
Felipe Monteiro de Carvalho wrote 11 lines
On Wed, Oct 28, 2009 at 4:51 PM, Vincent Snijders wrote: > Well, there is still is: > http://lazarus-ccr.sourceforge.net/fpcdoc/rtl/ctypes/csize_t.html The docs could be out-dated, csize_t doesn't compile in FPC 2.2.4 > I think the description is a bit strange: "Character size type". I wouldhave > guess the c was not because of Character, but because of the C language. The descriptions is completely wrong.

Please post a bugreport.

Michael.

Reply by email

Ivo Steinmann
to Felipe Monteiro de Carvalho: In the past there was a csize_t which I used in the imagemagick headers, but now it seams…
Show quoted text 8 lines
Hello, In the past there was a csize_t which I used in the imagemagick headers, but now it seams to have disappeared. Is size_t compatible with the c type? Or else any other compatible type to use? thanks,

Some time ago I noticed that a lot of packages are defining their own size_t type. So I added csize_t to ctypes and removed all individual definitions from the packages so that all are using csize_t.

But this changes are quit old, so I wounder why these aren't in 2.2.4

from svn log

------------------------------------------------------------------------ r12602 | ivost | 2009-01-26 13:58:20 +0100 (Mon, 26. Jan 2009) | 4 Zeilen

* added csize_t and pcsize_t for non unix systems (in unix/ctypes.pp)
* added csize_t = UnixTypes.size_t in ctypes.pp for unix systems.
* reason: size_t is a C type and it's often used by C header files. Several packages define their own size_t.

------------------------------------------------------------------------ r12603 | ivost | 2009-01-26 14:01:03 +0100 (Mon, 26. Jan 2009) | 2 Zeilen

* removed the usage of unixtypes from imagemagick headers. Type size_t was used. csize_t is now available for all platforms over ctypes.

-Ivo Steinmann

Reply by email