#include <ncurses.h> /* for initscr(), noecho(), curs_set(), keypad(), raw() */
#include <time.h> /* for time() */
#include <unistd.h> /* for getopt(), optarg */
+#include <stdint.h> /* for uint8_t */
#include "windows.h" /* for structs WinMeta, Win, init_win(), init_win_meta(),
* draw_all_wins()
*/
/* Replay mode. */
int key;
- unsigned char quit_called = 0;
- unsigned char await_actions = 1;
+ uint8_t quit_called = 0;
+ uint8_t await_actions = 1;
if (0 == world.interactive)
{
int action;
#include "map_objects.h"
#include <stdlib.h> /* for malloc(), calloc(), free(), atoi() */
+#include <stdint.h> /* for uint8_t */
#include <stdio.h> /* for FILE typedef */
#include <string.h> /* for strchr(), strlen(), memcpy() */
#include "readwrite.h" /* for [read/write]_uint[8/16/23][_bigendian]() */
extern void * build_map_objects(struct World * world, void * start, char def_id,
- unsigned char n)
+ uint8_t n)
{
- unsigned char i;
+ uint8_t i;
struct MapObj * mo;
char first = 1;
struct MapObjDef * mod = get_map_obj_def(world, def_id);
#include <stdio.h> /* for FILE typedef */
+#include <stdint.h> /* for uint8_t */
#include "yx_uint16.h" /* for yx_uint16 coordinates */
struct World;
struct Player
{
struct yx_uint16 pos;
- unsigned char hitpoints;
+ uint8_t hitpoints;
};
struct Monster
{
struct MapObj map_obj;
- unsigned char hitpoints;
+ uint8_t hitpoints;
};
struct MonsterDef
{
struct MapObjDef map_obj_def;
- unsigned char hitpoints_start; /* Hitpoints each monster starts with. */
+ uint8_t hitpoints_start; /* Hitpoints each monster starts with. */
};
* "def_id".
*/
extern void * build_map_objects(struct World * world, void * start, char def_id,
- unsigned char n);
+ uint8_t n);
#include "misc.h"
#include <stdlib.h> /* for calloc(), free() */
#include <string.h> /* for strlen(), strcmp(), memcpy() */
+#include <stdint.h> /* for uint8_t */
#include "windows.h" /* for suspend_win(), append_win(), reset_pad_offset(),
* resize_active_win(), cycle_active_win(),
* shift_active_win(), struct Win, struct WinMeta
-extern unsigned char meta_keys(int key, struct World * world,
- struct WinMeta * win_meta,
- struct Win * win_keys,
- struct Win * win_map,
- struct Win * win_info,
- struct Win * win_log)
+extern uint8_t meta_keys(int key, struct World * world,
+ struct WinMeta * win_meta, struct Win * win_keys,
+ struct Win * win_map, struct Win * win_info,
+ struct Win * win_log)
{
if (key == get_action_key(world->keybindings, "quit"))
{
-#include <stdint.h> /* for uint16_t, uint32_t */
+#include <stdint.h> /* for uint8_t, uint16_t, uint32_t */
#include <stdio.h> /* for FILE typedef */
#include "yx_uint16.h" /* for yx_uint16 coordinates */
struct World;
/* Call some meta game / window management actions dependent on key. If the
* "quit" action is called, return 1 only instead of doing anything directly.
*/
-extern unsigned char meta_keys(int key, struct World * world,
- struct WinMeta * win_meta,
- struct Win * win_keys,
- struct Win * win_map,
- struct Win * win_info,
+extern uint8_t meta_keys(int key, struct World * world,
+ struct WinMeta * win_meta, struct Win * win_keys,
+ struct Win * win_map, struct Win * win_info,
struct Win * win_log);
#include "readwrite.h"
#include <stdio.h> /* for FILE typedef*/
-#include <stdint.h> /* for uint16_t, uint32_t */
+#include <stdint.h> /* for uint8_t, uint16_t, uint32_t */
#include <stdio.h> /* for FILE typedef */
-#include <stdint.h> /* for uint16_t, uint32_t */
+#include <stdint.h> /* for uint8_t, uint16_t, uint32_t */
#include "rexit.h"
#include <stdlib.h> /* for exit(), free(), defines EXIT_SUCESS, EXIT_FAILURE */
#include <stdio.h> /* for printf() */
+#include <stdint.h> /* for uint8_t */
#include <ncurses.h> /* for endwin() */
#include "main.h" /* for World struct */
#include "map.h" /* for Map struct */
/* The clean-up routine and the flag resource by which it decides what to do. */
-static unsigned char cleanup_flags = 0x00;
+static uint8_t cleanup_flags = 0x00;
static void cleanup(struct World * world);
-extern void exit_err(unsigned char err, struct World * world, char * msg)
+extern void exit_err(uint8_t err, struct World * world, char * msg)
{
if (0 == err)
{
+#include <stdint.h> /* for uint8_t */
struct World;
struct Map;
* pass the result of functions that return non-zero as an error status and
* thereby avoid bloating up the code with if-error-conditionals.)
*/
-extern void exit_err(unsigned char err, struct World * world, char * msg);
+extern void exit_err(uint8_t err, struct World * world, char * msg);