C to Pascal conversion - Help request

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

C to Pascal conversion - Help request

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 ;
 



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C to Pascal conversion - Help request

dmitry boyarintsev


On Mon, Jul 17, 2017 at 7:17 AM, Sandro Cumerlato <[hidden email]> 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  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C to Pascal conversion - Help request

Sandro Cumerlato
Thank you Dmitry for your clarification.

Best regards.

Sandro Cumerlato



On 17 July 2017 at 14:26, Dmitry Boyarintsev <[hidden email]> wrote:


On Mon, Jul 17, 2017 at 7:17 AM, Sandro Cumerlato <[hidden email]> 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  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Loading...