Sign in Join

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

Mailing lists / fpc-pascal / 2017-07

C to Pascal conversion - Help request

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Sandro Cumerlato

Hello,
can someone please help me converting the folowing C types to Pascal?

SF_CUE_POINT is simple, but I'm not sure how to convert SF_CUES_VAR(count) ad SF_CUES.

Thank you in advance!

Sandro Cumerlato

typedef struct
{ int32_t indx ;
uint32_t position ;
int32_t fcc_chunk ;
int32_t chunk_start ;
int32_t block_start ;
uint32_t sample_offset ;
char name [256] ;
} SF_CUE_POINT ;

#define SF_CUES_VAR(count) \
struct \
{ uint32_t cue_count ; \
SF_CUE_POINT cue_points [count] ; \
}

typedef SF_CUES_VAR (100) SF_CUES ;
Dmitry Boyarintsev
to Sandro Cumerlato

On Mon, Jul 17, 2017 at 7:17 AM, Sandro Cumerlato <

Show quoted text 5 lines
wrote: Hello, can someone please help me converting the folowing C types to Pascal?

SF_CUE_POINT is simple, but I'm not sure how to convert SF_CUES_VAR(count)

ad SF_CUES.
type
   SF_CUES   = record
     cue_count : cuint32 ; // declared in "ctypes"
     cue_points : array [0..100-1] of SF_CUE_POINT;
   end;

going forward in C translation, any time you find SF_CUES_VAR (xxx) used, you'll have to declare a new type (with the proper "count" used) or reuse an existing type, if it already exists.

Sandro Cumerlato
to Dmitry Boyarintsev

Thank you Dmitry for your clarification.

Best regards.

Sandro Cumerlato

Dmitry Boyarintsev wrote 28 lines
On Mon, Jul 17, 2017 at 7:17 AM, Sandro Cumerlato < > wrote: > Hello, > can someone please help me converting the folowing C types to Pascal? > SF_CUE_POINT is simple, but I'm not sure how to convert SF_CUES_VAR(count) > ad SF_CUES. > > type SF_CUES = record cue_count : cuint32 ; // declared in "ctypes" cue_points : array [0..100-1] of SF_CUE_POINT; end; going forward in C translation, any time you find SF_CUES_VAR (xxx) used, you'll have to declare a new type (with the proper "count" used) or reuse an existing type, if it already exists. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal