C & C++

Using SDI_stdarg.h for OS4 and OS3 with VBCC

HI I (re)use this piece of code for OS4 and OS3 and with VBCC, OS3 build works fine, but OS4 build I get always a crash :-(
What am I doing wrong? Do I need to use/add "VA_ARG(ap, )" to VSNPrintf(), or change it to SNPrintf() ¿:-/

Alresdy read "https://os4coding.net/forum/vsprintf" but still don't get it.

Forums: 

programming tricks

I posted a few days ago that I was exploring disassembling. I'm working on a 6502 disassembler now. I'm attempting to adapt programs written in C by other programmers years ago written for the Amiga. They are rife with programming tricks. For example, this one:

for (address1 = sizeof MemType / sizeof *MemType; address1--;
MemType[address1] = 0);

I can't tell what this does.

This is the syntax of a for loop:

Syntax
The syntax of a for loop in C programming language is −

Forums: 

How to convert a 68k executable back to C source code?

Hello,

I'd like to port/remake an old Classic Amiga game for AmigaOS 4. The game was programmed with C for AmigaOS 1.3 in the late 80's but the source code is now lost. All that remains is an executable.

Any recommendations how I could turn that executable back to C source code?

Forums: 

stl_list crashing on program exit

Hello guys. I need your help and ideas on something I am working on porting.

I am using gcc 8 and I have managed to compile a program, which is written in c++, and having it working pretty well, except one thing, were I need your help.

The problem I am experiencing is that the app crashes when it exits. Even if I execute just the binary with no arguments, it prints out all the help information and then crashes. I tested it with one of its features and reported fine all it had to report, and then it crashed when it finished its work.

Forums: 

Allocating memory for a class

This is a general C++ question, I think.

If you allocate memory for a class and the class has functions, in other words the class has code, there are couple of questions. Actually every class has code because there is a constructor and destructor.

gameterrain = (class TerrainElement *)IExec->AllocVecTags(sizeof(TerrainElement),
AVT_Type, MEMF_SHARED,
TAG_DONE);

Forums: 

ftime in C++

Dear all

I am trying to a compile a GLClock app, however I have some difficulty related to ftime()
What should I use ?

The error I am getting is:
$ ppc-amigaos-g++ CGClock.cpp -o CGClock -lGL -lGLU -lGLUT
/tmp/ccTAWsKT.o: In function `_Z14TimerFunction4i':
CGClock.cpp:(.text+0x30f0): undefined reference to `ftime'

Code snippet is:

void TimerFunction4(int value){
struct timeb tb;
time_t tim=time(0);
struct tm* t;
t=localtime(&tim);
ftime(&tb);

Forums: 

Pages

Subscribe to RSS - C & C++