I have code which says
#define MYBOOL int
This code is very old. people who have written is not avaible. I was
thinking what could be reason.
1) bool datatype was not available that time (10 years back: correct me
if i am wrong)
2) int was word aligned (16bit and 32bit). Writter of above code doesnt
want to give choice to compiler.
if we say bool , compiler can represent this on his way (again,correct
me if i am wrong)
This much i can think of it.
even in many books, i have seen author using int as a flag. example
Richard Stevens, "advance programming in unix environment" . and this
book uses 'restrict' keyword.
Now, i have to change it for 64bit arch. In my system, performance is
more important thn anything else.
I thought of changing it to long on 64arch.
#define MYBOOL long
Any comment on this will be appreciated.
#define MYBOOL int
This code is very old. people who have written is not avaible. I was
thinking what could be reason.
1) bool datatype was not available that time (10 years back: correct me
if i am wrong)
2) int was word aligned (16bit and 32bit). Writter of above code doesnt
want to give choice to compiler.
if we say bool , compiler can represent this on his way (again,correct
me if i am wrong)
This much i can think of it.
even in many books, i have seen author using int as a flag. example
Richard Stevens, "advance programming in unix environment" . and this
book uses 'restrict' keyword.
Now, i have to change it for 64bit arch. In my system, performance is
more important thn anything else.
I thought of changing it to long on 64arch.
#define MYBOOL long
Any comment on this will be appreciated.
Comment