aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/include
diff options
context:
space:
mode:
authorMax Horn2009-02-21 04:43:49 +0000
committerMax Horn2009-02-21 04:43:49 +0000
commitfa75bd23e6b710d2f225c9162ca651e7e518ce75 (patch)
tree75c0b4137b18230fed9d606d7740b0d42b02a88a /engines/sci/include
parent7c87b4901dd6de93511cf7995931b64e59d13fef (diff)
downloadscummvm-rg350-fa75bd23e6b710d2f225c9162ca651e7e518ce75.tar.gz
scummvm-rg350-fa75bd23e6b710d2f225c9162ca651e7e518ce75.tar.bz2
scummvm-rg350-fa75bd23e6b710d2f225c9162ca651e7e518ce75.zip
SCI: Yet more cleanup
svn-id: r38661
Diffstat (limited to 'engines/sci/include')
-rw-r--r--engines/sci/include/kdebug.h22
-rw-r--r--engines/sci/include/kernel.h68
-rw-r--r--engines/sci/include/resource.h11
3 files changed, 23 insertions, 78 deletions
diff --git a/engines/sci/include/kdebug.h b/engines/sci/include/kdebug.h
index 1fa839b573..68a9e51755 100644
--- a/engines/sci/include/kdebug.h
+++ b/engines/sci/include/kdebug.h
@@ -77,31 +77,15 @@ struct _state;
-#ifdef __GNUC__XXX
-
-#define SCIkwarn(arguments...) _SCIGNUkdebug(__PRETTY_FUNCTION__, ## arguments)
-
-#else /* !__GNUC__ */
-
-#define SCIkwarn _SCIkwarn
-
-#endif /* !__GNUC__ */
-
/* Internal functions */
-void
-_SCIkwarn(struct _state *s, const char *file, int line, int area, const char *format, ...);
-void
-_SCIkdebug(struct _state *s, const char *file, int line, int area, const char *format, ...);
-void
-_SCIGNUkdebug(const char *funcname, struct _state *s, const char *file, int line, int area, const char *format, ...);
+void _SCIkdebug(struct _state *s, const char *file, int line, int area, const char *format, ...);
+void _SCIGNUkdebug(const char *funcname, struct _state *s, const char *file, int line, int area, const char *format, ...);
/* If mode=1, enables debugging for specified areas. If mode=0, disables
** debugging for specified areas.
** Valid area characters: ulgcmfbad
*/
-
-void
-set_debug_mode(struct _state *s, int mode, const char *areas);
+void set_debug_mode(struct _state *s, int mode, const char *areas);
extern int sci_debug_flags;
diff --git a/engines/sci/include/kernel.h b/engines/sci/include/kernel.h
index 071aee7b46..587582d9b7 100644
--- a/engines/sci/include/kernel.h
+++ b/engines/sci/include/kernel.h
@@ -83,21 +83,17 @@ typedef struct {
*/
-reg_t
-read_selector(struct _state *s, reg_t object, selector_t selector_id, const char *fname, int line);
-void
-write_selector(struct _state *s, reg_t object, selector_t selector_id, reg_t value,
+reg_t read_selector(struct _state *s, reg_t object, selector_t selector_id, const char *fname, int line);
+void write_selector(struct _state *s, reg_t object, selector_t selector_id, reg_t value,
const char *fname, int line);
-int
-invoke_selector(struct _state *s, reg_t object, int selector_id, int noinvalid, int kfunct,
+int invoke_selector(struct _state *s, reg_t object, int selector_id, int noinvalid, int kfunct,
stack_ptr_t k_argp, int k_argc, const char *fname, int line, int argc, ...);
/******************** Text functionality ********************/
-char *
-kernel_lookup_text(struct _state *s, reg_t address, int index);
+char *kernel_lookup_text(struct _state *s, reg_t address, int index);
/* Looks up text referenced by scripts
** Parameters: (state_t *s): The current state
** (reg_t) address: The address to look up
@@ -133,16 +129,7 @@ kernel_lookup_text(struct _state *s, reg_t address, int index);
#endif /* !SCI_KERNEL_DEBUG */
-int
-listp(struct _state *s, reg_t address);
-/* Determines whether the object at <address> is a list
-** Parameters: (state_t *) s: The state to use
-** (reg_t) address: The address to check
-** Returns : (int) 0 if not, non-zero if it is a list.
-*/
-
-int
-is_object(struct _state *s, reg_t obj);
+bool is_object(struct _state *s, reg_t obj);
/* Checks whether a heap address contains an object
** Parameters: (state_t *) s: The current state
** (reg_t) obj: The address to check
@@ -150,15 +137,6 @@ is_object(struct _state *s, reg_t obj);
*/
-/* Functions for internal macro use */
-void
-_SCIkvprintf(FILE *file, const char *format, va_list args);
-void
-_SCIkprintf(FILE *file, const char *format, ...) GCC_PRINTF(2, 3);
-
-
-
-
/******************** Kernel function parameter macros ********************/
@@ -175,10 +153,8 @@ _SCIkprintf(FILE *file, const char *format, ...) GCC_PRINTF(2, 3);
#define SKPV_OR_ALT(x,a) KP_SINT(KP_ALT(x, make_reg(0, a)))
#define UKPV_OR_ALT(x,a) KP_UINT(KP_ALT(x, make_reg(0, a)))
-reg_t *
-kernel_dereference_reg_pointer(struct _state *s, reg_t pointer, int entries);
-byte *
-kernel_dereference_bulk_pointer(struct _state *s, reg_t pointer, int entries);
+reg_t *kernel_dereference_reg_pointer(struct _state *s, reg_t pointer, int entries);
+byte *kernel_dereference_bulk_pointer(struct _state *s, reg_t pointer, int entries);
#define kernel_dereference_char_pointer(state, pointer, entries) (char*)kernel_dereference_bulk_pointer(state, pointer, entries)
/* Dereferences a heap pointer
** Parameters: (state_t *) s: The state to operate on
@@ -202,8 +178,7 @@ kernel_dereference_bulk_pointer(struct _state *s, reg_t pointer, int entries);
-int
-kernel_oops(struct _state *s, const char *file, int line, const char *reason);
+int kernel_oops(struct _state *s, const char *file, int line, const char *reason);
/* Halts script execution and informs the user about an internal kernel error or failed assertion
** Paramters: (state_t *) s: The state to use
** (const char *) file: The file the oops occured in
@@ -220,16 +195,14 @@ struct _state;
extern int sci01_priority_table_flags; /* 1: delete, 2: print */
-int
-_find_priority_band(struct _state *s, int band);
+int _find_priority_band(struct _state *s, int band);
/* Finds the position of the priority band specified
** Parameters: (state_t *) s: State to search in
** (int) band: Band to look for
** Returns : (int) Offset at which the band starts
*/
-int
-_find_view_priority(struct _state *s, int y);
+int _find_view_priority(struct _state *s, int y);
/* Does the opposite of _find_priority_band
** Parameters: (state_t *) s: State
** (int) y: Coordinate to check
@@ -257,16 +230,14 @@ _find_view_priority(struct _state *s, int y);
/******************** Dynamic view list functions ********************/
-abs_rect_t
-set_base(struct _state *s, reg_t object);
+abs_rect_t set_base(struct _state *s, reg_t object);
/* Determines the base rectangle of the specified view object
** Parameters: (state_t *) s: The state to use
** (reg_t) object: The object to set
** Returns : (abs_rect) The absolute base rectangle
*/
-extern abs_rect_t
- get_nsrect(struct _state *s, reg_t object, byte clip);
+extern abs_rect_t get_nsrect(struct _state *s, reg_t object, byte clip);
/* Determines the now-seen rectangle of a view object
** Parameters: (state_t *) s: The state to use
** (reg_t) object: The object to check
@@ -276,11 +247,9 @@ extern abs_rect_t
** now-seen area.
*/
-void
-_k_dyn_view_list_prepare_change(struct _state *s);
+void _k_dyn_view_list_prepare_change(struct _state *s);
/* Removes all views in anticipation of a new window or text */
-void
-_k_dyn_view_list_accept_change(struct _state *s);
+void _k_dyn_view_list_accept_change(struct _state *s);
/* Redraws all views after a new window or text was added */
@@ -288,14 +257,12 @@ _k_dyn_view_list_accept_change(struct _state *s);
/******************** Misc functions ********************/
-void
-process_sound_events(struct _state *s); /* Get all sound events, apply their changes to the heap */
+void process_sound_events(struct _state *s); /* Get all sound events, apply their changes to the heap */
#define LOOKUP_NODE(addr) lookup_node(s, (addr), __FILE__, __LINE__)
#define LOOKUP_LIST(addr) lookup_list(s, addr, __FILE__, __LINE__)
-node_t *
-lookup_node(struct _state *s, reg_t addr, const char *file, int line);
+node_t *lookup_node(struct _state *s, reg_t addr, const char *file, int line);
/* Resolves an address into a list node
** Parameters: (state_t *) s: The state to operate on
** (reg_t) addr: The address to resolve
@@ -305,8 +272,7 @@ lookup_node(struct _state *s, reg_t addr, const char *file, int line);
*/
-list_t *
-lookup_list(struct _state *s, reg_t addr, const char *file, int line);
+list_t *lookup_list(struct _state *s, reg_t addr, const char *file, int line);
/* Resolves a list pointer to a list
** Parameters: (state_t *) s: The state to operate on
** (reg_t) addr: The address to resolve
diff --git a/engines/sci/include/resource.h b/engines/sci/include/resource.h
index ebaa23f642..8db6ef9185 100644
--- a/engines/sci/include/resource.h
+++ b/engines/sci/include/resource.h
@@ -260,15 +260,10 @@ int is_print_str(char *str);
# define sci_unlink unlink
# define sci_rmdir rmdir
-#ifndef HAVE_FFS
-int sci_ffs(int _mask);
-#else
-#define sci_ffs ffs
-#endif
+/** Find first set bit in bits and return its index. Returns 0 if bits is 0. */
+int sci_ffs(int bits);
-
-void
-sci_sched_yield(void);
+void sci_sched_yield(void);
/* Yields the running process/thread to the scheduler
** Parameters: (void)
** Returns : after a while.