mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Introduced wrapper macros snew(), snewn() and sresize() for the
malloc functions, which automatically cast to the same type they're allocating the size of. Should prevent any future errors involving mallocing the size of the wrong structure type, and will also make life easier if we ever need to turn the PuTTY core code from real C into C++-friendly C. I haven't touched the Mac frontend in this checkin because I couldn't compile or test it. [originally from svn r3014]
This commit is contained in:
@ -53,7 +53,8 @@ struct terminal_tag {
|
||||
int beep_overloaded;
|
||||
long lastbeep;
|
||||
|
||||
#define TSIZE (sizeof(unsigned long))
|
||||
#define TTYPE unsigned long
|
||||
#define TSIZE (sizeof(TTYPE))
|
||||
#define fix_cpos do { \
|
||||
term->cpos = lineptr(term->curs.y) + term->curs.x; \
|
||||
} while(0)
|
||||
|
Reference in New Issue
Block a user