2019-12-02 03:52:53 +01:00
|
|
|
#ifndef BAD_DECLARATIONS_H
|
|
|
|
#define BAD_DECLARATIONS_H
|
2019-08-25 06:46:40 +02:00
|
|
|
|
|
|
|
#include "gd_types.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file bad_declarations.h
|
|
|
|
*
|
|
|
|
* Match incorrect type promotion for two declared functions.
|
|
|
|
*
|
|
|
|
* There is an issue with the compiled code for these function calls in files
|
2019-12-02 03:52:53 +01:00
|
|
|
* outside of the files in which they were defined: instead of passing f32's,
|
|
|
|
* the caller passes f64's.
|
|
|
|
*
|
2019-08-25 06:46:40 +02:00
|
|
|
* The only possible reason I can come up with for this behavior is that
|
|
|
|
* goddard only declared (not prototyped) his functions in the headers,
|
2019-12-02 03:52:53 +01:00
|
|
|
* and didn't include the header in the function's defining .c file.
|
|
|
|
* (Even IDO 5.3 cares about illegal promotion of types!) This results in
|
|
|
|
* default argument promotion, which is incorrect in this case.
|
2019-08-25 06:46:40 +02:00
|
|
|
*
|
|
|
|
* Since that's an awful practice to emulate, include this file (first!) to prevent
|
|
|
|
* the proper prototypes of these functions from being seen by files with the
|
|
|
|
* the incorrectly compiled calls.
|
|
|
|
*/
|
|
|
|
|
2019-12-02 03:52:53 +01:00
|
|
|
#ifndef AVOID_UB
|
2019-08-25 06:46:40 +02:00
|
|
|
|
2019-12-02 03:52:53 +01:00
|
|
|
#define GD_USE_BAD_DECLARATIONS
|
2019-08-25 06:46:40 +02:00
|
|
|
|
2019-12-02 03:52:53 +01:00
|
|
|
/* shape_helper.h */
|
|
|
|
extern struct ObjFace *make_face_with_colour();
|
2019-08-25 06:46:40 +02:00
|
|
|
/* should be: make_face_with_colour(f32, f32, f32) */
|
|
|
|
|
2019-12-02 03:52:53 +01:00
|
|
|
/* old_menu.h */
|
2019-08-25 06:46:40 +02:00
|
|
|
extern struct ObjLabel *make_label();
|
|
|
|
/* should be: make_label(struct ObjValPtrs *, char *, s32, f32, f32, f32) */
|
|
|
|
|
2019-12-02 03:52:53 +01:00
|
|
|
#endif /* !AVOID_UB */
|
|
|
|
|
|
|
|
#endif /* BAD_DECLARATIONS_H */
|