ATTRIBUTE((pure)) for Ptile2tile(), add a forgotten comment.

git-svn-id: https://svn.eduke32.com/eduke32@2412 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-03-04 20:14:18 +00:00
parent fbbefc0df9
commit 9eae2b485a
2 changed files with 6 additions and 2 deletions

View File

@ -799,7 +799,7 @@ int32_t hicsetsubsttex(int32_t picnum, int32_t palnum, const char *filen, float
int32_t hicsetskybox(int32_t picnum, int32_t palnum, char *faces[6]);
int32_t hicclearsubst(int32_t picnum, int32_t palnum);
int32_t Ptile2tile(int32_t tile, int32_t pallet);
int32_t Ptile2tile(int32_t tile, int32_t pallet) ATTRIBUTE((pure));
int32_t md_loadmodel(const char *fn);
int32_t md_setmisc(int32_t modelid, float scale, int32_t shadeoff, float zadd, float yoffset, int32_t flags);
// int32_t md_tilehasmodel(int32_t tilenume, int32_t pal);

View File

@ -395,7 +395,7 @@ static inline __attribute__((warn_unused_result)) int clamp(int in, int min, int
static inline int clamp(int in, int min, int max)
#endif
{
return in <= min ? min : in >= max ? max : in;
return in <= min ? min : (in >= max ? max : in);
}
#define BMAX_PATH 256
@ -504,6 +504,10 @@ static inline uint16_t system_15bit_rand(void) { return ((uint16_t)rand())&0x7ff
# define Bstrlen strlen
# define Bstrchr strchr
# define Bstrrchr strrchr
// XXX: different across 32- and 64-bit archs (e.g.
// parsing the decimal representation of 0xffffffff,
// 4294967295 -- long is signed, so strtol would
// return LONG_MAX (== 0x7fffffff on 32-bit archs))
# define Batoi(str) ((int32_t)strtol(str, NULL, 10))
# define Batol(str) (strtol(str, NULL, 10))
# define Bstrtol strtol