Changeset 14295


Ignore:
Timestamp:
Sep 22, 2010, 1:10:30 AM (9 years ago)
Author:
rme
Message:

Eliminate some (but not all) warnings produced when building with
"-Wall -Wno-format". Also a couple of minor changes that enable
clang to build the lisp kernel (at least on x8632 and x8664).

Location:
trunk/source/lisp-kernel
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/area.h

    r14119 r14295  
    105105void untenure_from_area(area *);
    106106
     107Boolean grow_dynamic_area(natural);
     108Boolean shrink_dynamic_area(natural);
     109
    107110/* serialize add_area/remove_area, and also the tcr queue */
    108111void *tcr_area_lock;
  • trunk/source/lisp-kernel/bits.h

    r14119 r14295  
    115115    BITWvar = (*BITPvar << BITIDXvar) >> BITIDXvar; }
    116116
    117 #ifdef __GNUC__
     117#if defined(__GNUC__) && !defined(__clang__)
    118118static __inline__ natural
    119119current_stack_pointer(void) __attribute__((always_inline));
  • trunk/source/lisp-kernel/gc-common.c

    r14273 r14295  
    742742  void *p, *next, *addr;
    743743  struct xmacptr *x, *xnext;
    744   int i, flags;
     744  int flags;
    745745  xmacptr_dispose_fn dfn;
    746746
     
    752752 
    753753  for (x = user_postGC_macptrs; x; x = xnext) {
    754     xnext = (xmacptr *) (x->class);;
     754    xnext = (xmacptr *) (x->class);
    755755    flags = x->flags - xmacptr_flag_user_first;
    756756    dfn = xmacptr_dispose_functions[flags];
     
    10281028  LispObj *ptr = &(lisp_global(WEAKVLL)), this, new, old;
    10291029
    1030   while (this = *ptr) {
     1030  while ((this = *ptr)) {
    10311031    old = this + fulltag_misc;
    10321032    new = node_forwarding_address(old);
     
    11011101  }
    11021102  xprev = &user_postGC_macptrs;
    1103   while (xnext = *xprev) {
     1103  while ((xnext = *xprev)) {
    11041104    xnew = (struct xmacptr *)locative_forwarding_address((LispObj)xnext);
    11051105    if (xnew != xnext) {
     
    11141114{
    11151115  bitvector refbits = a->refbits;
    1116   LispObj *p = (LispObj *) a->low, *p0 = p, x1, x2, new;
     1116  LispObj *p = (LispObj *) a->low, x1, x2, new;
     1117#ifdef ARM
     1118  LispObj *p0 = p;
     1119#endif
    11171120  natural bits, bitidx, *bitsp, nextbit, diff, memo_dnode = 0, hash_dnode_limit = 0;
    11181121  int tag_x1;
  • trunk/source/lisp-kernel/gc.h

    r14119 r14295  
    8181LispObj node_forwarding_address(LispObj);
    8282void forward_range(LispObj *, LispObj *);
     83void forward_tcr_xframes(TCR *);
    8384void note_memoized_references(ExceptionInformation *,LogicalAddress, LogicalAddress, BytePtr *, BytePtr *);
    8485void gc(TCR *, signed_natural);
  • trunk/source/lisp-kernel/image.c

    r14207 r14295  
    2727#include <stdio.h>
    2828#include <limits.h>
    29 
     29#include <time.h>
    3030
    3131
  • trunk/source/lisp-kernel/image.h

    r13279 r14295  
    8787load_openmcl_image(int, openmcl_image_file_header*);
    8888
     89Boolean find_openmcl_image_file_header(int fd, openmcl_image_file_header *h);
    8990
    9091
  • trunk/source/lisp-kernel/lisp-debug.c

    r14292 r14295  
    640640debug_memory_areas(ExceptionInformation *xp, siginfo_t *info, int arg)
    641641{
    642   int i;
    643642  area *a, *header = all_areas;
    644643  char label[100];
     
    815814{
    816815  char s[32], *res, *endptr;
    817   int n;
    818816  natural val;
    819817
     
    13071305}
    13081306
     1307void
    13091308debug_identify_function(ExceptionInformation *xp, siginfo_t *info)
    13101309{
  • trunk/source/lisp-kernel/lisp-exceptions.h

    r14206 r14295  
    108108Fatal(StringPtr, StringPtr);
    109109
     110void fatal_oserr(StringPtr, OSErr);
     111
    110112void
    111113non_fatal_error( char * );
     
    143145#endif
    144146
     147#ifdef DARWIN
     148void darwin_exception_init(TCR *tcr);
     149void darwin_exception_cleanup(TCR *tcr);
     150#endif
     151
     152void thread_signal_setup(void);
    145153void suspend_other_threads(Boolean);
    146154void resume_other_threads(Boolean);
    147 
     155void reset_lisp_process(ExceptionInformation *);
     156void terminate_lisp(void);
    148157
    149158#endif /* __lisp_exceptions_h__ */
  • trunk/source/lisp-kernel/memory.c

    r14277 r14295  
    4747}
    4848
    49 void
    50 fatal_oserr(StringPtr param, OSErr err)
    51 {
    52   char buf[64];
    53   sprintf(buf," - operating system error %d.", err);
    54   Fatal(param, buf);
    55 }
    56 
    5749void *
    5850lisp_malloc(size_t size)
     
    114106}
    115107#endif
     108
    116109
    117110
     
    206199CommitMemory (LogicalAddress start, natural len)
    207200{
    208   LogicalAddress rc;
    209201#if DEBUG_MEMORY
    210202  fprintf(dbgout, "Committing memory at 0x" LISP ", size 0x" LISP "\n", start, len);
    211203#endif
    212204#ifdef WINDOWS
     205  LogicalAddress rc;
     206
    213207  if ((start < ((LogicalAddress)nil_value)) &&
    214208      (((LogicalAddress)nil_value) < (start+len))) {
     
    228222  return true;
    229223#else
    230   int i, err;
     224  int i;
    231225  void *addr;
    232226
     
    504498                    natural free_space_size)
    505499{
    506   extern int page_size;
    507500  area *a = active_dynamic_area;
    508   BytePtr newlimit, protptr, zptr;
    509   int psize = page_size;
     501  BytePtr newlimit;
     502
    510503  if (free_space_size) {
    511504    BytePtr lowptr = a->active;
     
    519512    }
    520513  }
     514  return false;
    521515}
    522516
     
    718712  BytePtr
    719713    curfree = a->active,
    720     target_low = target->low,
    721     tenured_low = tenured_area->low;
    722   natural
    723     dynamic_dnodes = area_dnode(curfree, a->low),
    724     new_tenured_dnodes = area_dnode(curfree, tenured_area->low);
     714    target_low = target->low;
     715  natural new_tenured_dnodes = area_dnode(curfree, tenured_area->low);
    725716  bitvector
    726717    refbits = tenured_area->refbits,
  • trunk/source/lisp-kernel/memprotect.h

    r14233 r14295  
    7676int
    7777MapFile(LogicalAddress addr, natural pos, natural nbytes, int permissions, int fd);
     78void allocation_failure(Boolean pointerp, natural size);
     79
     80void protect_watched_areas(void);
     81void unprotect_watched_areas(void);
    7882
    7983typedef enum {
     
    101105} protected_area, *protected_area_ptr;
    102106
     107void unprotect_area(protected_area_ptr);
    103108
    104109/* Various functions that try to respond to a protection violation */
  • trunk/source/lisp-kernel/platform-darwinx8632.h

    r13952 r14295  
    4040/* xp accessors, sigreturn stuff */
    4141#define DARWIN_USE_PSEUDO_SIGRETURN 1
     42extern int darwin_sigreturn(ExceptionInformation *context);
    4243#define DarwinSigReturn(context) do {\
    4344    darwin_sigreturn(context);\
  • trunk/source/lisp-kernel/platform-darwinx8664.h

    r13952 r14295  
    4040/* xp accessors, sigreturn stuff */
    4141#define DARWIN_USE_PSEUDO_SIGRETURN 1
     42extern int darwin_sigreturn(ExceptionInformation *context);
    4243#define DarwinSigReturn(context) do {\
    4344    darwin_sigreturn(context);\
  • trunk/source/lisp-kernel/pmcl-kernel.c

    r14278 r14295  
    601601map_initial_reloctab(BytePtr low, BytePtr high) 
    602602{
    603   natural ndnodes, reloctab_size, n;
     603  natural ndnodes, reloctab_size;
    604604
    605605  low_relocatable_address = low; /* will never change */
     
    857857  fprintf(dbgout, "Fatal error: %s\n%s\n", param0, param1);
    858858  _exit(-1);
     859}
     860
     861void
     862fatal_oserr(StringPtr param, OSErr err)
     863{
     864  char buf[64];
     865  sprintf(buf," - operating system error %d.", err);
     866  Fatal(param, buf);
    859867}
    860868
     
    14481456  long got, want;
    14491457  char *got_end,*want_end;
    1450 #ifdef X8632
    1451   extern Boolean rcontext_readonly;
    1452 #endif
    14531458
    14541459  want = strtoul(min_os_version,&want_end,10);
     
    14561461  uname(&uts);
    14571462  got = strtoul(uts.release,&got_end,10);
    1458 #ifdef X8632
    1459 #ifdef FREEBSD
     1463#if defined(X8632) && defined(FREEBSD)
    14601464  if (!strcmp(uts.machine,"amd64")) {
     1465    extern Boolean rcontext_readonly;
     1466
    14611467    rcontext_readonly = true;
    14621468  }
    1463 #endif
    14641469#endif
    14651470  while (got == want) {
     
    16521657int
    16531658main(int argc, char *argv[]
    1654 #ifndef WINDOWS
     1659#if defined(PPC) && defined(LINUX)
    16551660, char *envp[], void *aux
    16561661#endif
  • trunk/source/lisp-kernel/threads.h

    r14280 r14295  
    136136#endif
    137137
     138void signal_semaphore(SEMAPHORE s);
     139int wait_on_semaphore(void *s, int seconds, int millis);
    138140void sem_wait_forever(SEMAPHORE s);
    139141
     
    179181void *tsd_get(LispObj);
    180182TCR *new_tcr(natural, natural);
     183void thread_init_tcr(TCR *tcr, void *stack_base, natural stack_size);
    181184TCR *initial_thread_tcr;
    182185
     
    197200TCR *get_tcr(Boolean);
    198201TCR *get_interrupt_tcr(Boolean);
     202
    199203Boolean suspend_tcr(TCR *);
    200204Boolean resume_tcr(TCR *);
     205Boolean kill_tcr(TCR *);
     206
     207int raise_thread_interrupt(TCR *target);
     208
     209Boolean lisp_suspend_tcr(TCR *);
     210Boolean lisp_resume_tcr(TCR *);
     211void lisp_suspend_other_threads(void);
     212void lisp_resume_other_threads(void);
    201213
    202214typedef struct
  • trunk/source/lisp-kernel/unix-calls.c

    r14281 r14295  
    3737#include <stdint.h>
    3838#include <signal.h>
     39#include <fcntl.h>
    3940
    4041ssize_t
  • trunk/source/lisp-kernel/x86-constants32.h

    r14207 r14295  
    382382#define EFL_DF 1024
    383383#endif
     384
  • trunk/source/lisp-kernel/x86-exceptions.c

    r14207 r14295  
    581581  unsigned allocptr_tag;
    582582  signed_natural disp;
    583   Boolean notify_pending_gc = false;
    584583 
    585584  cur_allocptr = xpGPR(xp,Iallocptr);
     
    38833882  LispObj *newnode = (LispObj *)untag(new);
    38843883  area *a = area_containing((BytePtr)old);
     3884  extern void update_managed_refs(area *, BytePtr, natural);
    38853885
    38863886  if (a && a->code == AREA_WATCHED) {
  • trunk/source/lisp-kernel/x86-exceptions.h

    r13638 r14295  
    4545#define XUUO_KILL 9
    4646#define XUUO_ALLOCATE_LIST 10
     47
     48int callback_to_lisp (TCR *tcr, LispObj callback_macptr, ExceptionInformation *xp,
     49                      natural arg1, natural arg2, natural arg3, natural arg4,
     50                      natural arg5);
     51
    4752
    4853void
     
    97102extern natural get_mxcsr();
    98103extern void set_mxcsr(natural);
     104void enable_fp_exceptions(void);
    99105
    100106#ifdef X8632
     
    107113#endif
    108114
     115void callback_for_gc_notification(ExceptionInformation *xp, TCR *tcr);
     116
    109117#endif /* X86_EXCEPTIONS_H */
    110118
  • trunk/source/lisp-kernel/x86-gc.c

    r14197 r14295  
    2828
    2929#ifdef X8632
    30 inline natural
     30natural
    3131imm_word_count(LispObj fn)
    3232{
     
    251251check_xp(ExceptionInformation *xp, natural node_regs_mask)
    252252{
    253   natural *regs = (natural *) xpGPRvector(xp), dnode;
     253  natural *regs = (natural *) xpGPRvector(xp);
    254254
    255255  if (node_regs_mask & (1<<0)) check_node(regs[REG_EAX]);
     
    271271check_xp(ExceptionInformation *xp)
    272272{
    273   natural *regs = (natural *) xpGPRvector(xp), dnode;
     273  natural *regs = (natural *) xpGPRvector(xp);
    274274
    275275  check_node(regs[Iarg_z]);
     
    15261526  natural *regs = (natural *) xpGPRvector(xp), dnode;
    15271527  LispObj eip;
    1528   int i;
    15291528
    15301529  if (node_regs_mask & (1<<0)) mark_root(regs[REG_EAX]);
  • trunk/source/lisp-kernel/x86_print.c

    r13067 r14295  
    316316      add_char(' ');
    317317    } else if (lfbits & lfbits_gfn_mask) {
    318       LispObj gf_slots;
    319       LispObj gf_name;
    320 
    321318      add_c_string("Generic Function ");
    322319
    323320#ifdef X8632
    324       gf_slots = nth_immediate(o, 2);
    325       gf_name = deref(gf_slots, 2);
    326       sprint_lisp_object(gf_name, depth);
    327       add_char(' ');
     321      {
     322        LispObj gf_slots = nth_immediate(o, 2);
     323        LispObj gf_name = deref(gf_slots, 2);
     324
     325        sprint_lisp_object(gf_name, depth);
     326        add_char(' ');
     327      }
    328328#endif
    329329    } else {
Note: See TracChangeset for help on using the changeset viewer.