Changeset 9901


Ignore:
Timestamp:
Jul 6, 2008, 8:55:03 AM (11 years ago)
Author:
gb
Message:

Remove unused variables. (May need to compile with -Wall to find
more unused vars on PPC, too.)

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

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/gc-common.c

    r8561 r9901  
    280280  hash_table_vector_header *hashp = (hash_table_vector_header *)(untag(htabv));
    281281  natural
    282     dnode,
    283282    npairs = (header_element_count(hashp->header) -
    284283              (hash_table_vector_header_count - 1)) >> 1;
    285   LispObj *pairp = (LispObj*) (hashp+1), weakelement;
     284  LispObj *pairp = (LispObj*) (hashp+1);
    286285  Boolean
    287286    weak_on_value = ((hashp->flags & nhash_weak_value_mask) != 0);
    288   bitvector markbits = GCmarkbits;
    289   int tag;
     287
    290288
    291289  for (i = 2; i <= skip; i++) {
     
    423421  LispObj this, header, pending;
    424422  int subtag;
    425   bitvector markbits = GCmarkbits;
    426423  hash_table_vector_header *hashp;
    427424  Boolean marked_new;
     
    448445        }
    449446      } else if (subtag == subtag_hash_vector) {
    450         natural elements = header_element_count(header), i;
     447        natural elements = header_element_count(header);
    451448
    452449        hashp = (hash_table_vector_header *) ptr_from_lispobj(untag(this));
     
    507504  LispObj this, header, pending = 0;
    508505  int subtag;
    509   bitvector markbits = GCmarkbits;
    510   hash_table_vector_header *hashp;
    511506  Boolean marked_new;
    512507
     
    925920reclaim_static_dnodes()
    926921{
    927   natural nstatic = tenured_area->static_dnodes, i, bits, mask, bitnum;
     922  natural nstatic = tenured_area->static_dnodes, i, bits, bitnum;
    928923  cons *c = (cons *)tenured_area->low, *d;
    929924  bitvector bitsp = GCmarkbits;
     
    1002997gc(TCR *tcr, signed_natural param)
    1003998{
    1004   xframe_list *xframes = (tcr->xframe);
    1005999  struct timeval start, stop;
    10061000  area *a = active_dynamic_area, *to = NULL, *from = NULL, *note = NULL;
    10071001  unsigned timeidx = 1;
    10081002  paging_info paging_info_start;
    1009   xframe_list *x;
    10101003  LispObj
    1011     pkg,
     1004    pkg = 0,
    10121005    itabvec = 0;
    10131006  BytePtr oldfree = a->active;
     
    12341227        sym = *raw;
    12351228        if (is_symbol_fulltag(sym)) {
    1236           lispsymbol *rawsym = (lispsymbol *)ptr_from_lispobj(untag(sym));
    12371229          natural dnode = gc_area_dnode(sym);
    12381230
  • trunk/source/lisp-kernel/memory.c

    r8701 r9901  
    4040{
    4141  char buf[64];
    42   sprintf(buf, "Can't allocate %s of size %d bytes.", pointerp ? "pointer" : "handle", size);
     42  sprintf(buf, "Can't allocate %s of size %ld bytes.", pointerp ? "pointer" : "handle", size);
    4343  Fatal(":   Kernel memory allocation failure.  ", buf);
    4444}
     
    200200                    natural free_space_size)
    201201{
    202   extern int page_size;
    203202  area *a = active_dynamic_area;
    204   BytePtr newlimit, protptr, zptr;
    205   int psize = page_size;
     203  BytePtr newlimit;
    206204  if (free_space_size) {
    207205    BytePtr lowptr = a->active;
     
    411409  BytePtr
    412410    curfree = a->active,
    413     target_low = target->low,
    414     tenured_low = tenured_area->low;
     411    target_low = target->low;
    415412  natural
    416     dynamic_dnodes = area_dnode(curfree, a->low),
    417413    new_tenured_dnodes = area_dnode(curfree, tenured_area->low);
    418414  bitvector
     
    496492    }
    497493    if (activate) {
    498       LispObj *heap_start = ptr_from_lispobj(lisp_global(HEAP_START));
    499 
    500494      a->older = g1_area;
    501495      tenure_to_area(tenured_area);
  • trunk/source/lisp-kernel/plsym.c

    r5123 r9901  
    9090  area *a =  ((area *) (ptr_from_lispobj(lisp_global(ALL_AREAS))))->succ;
    9191  area_code code;
    92   LispObj sym;
     92  LispObj sym = 0;
    9393
    9494  while ((code = a->code) != AREA_VOID) {
  • trunk/source/lisp-kernel/pmcl-kernel.c

    r9785 r9901  
    203203  natural overhead;
    204204  BytePtr base, softlimit, hardlimit;
    205   OSErr err;
    206205  Ptr h = allocate_stack(size+4095);
    207206  protected_area_ptr hprotp = NULL, sprotp;
     
    477476{
    478477  if (len != 0) {
    479     int i, err;
     478    int i;
    480479    void *addr;
    481480
     
    503502    return false;
    504503  }
     504  return true;
    505505}
    506506#endif
     
    532532  BytePtr new_start, new_end;
    533533
    534   if (a = find_readonly_area()) {
     534  a = find_readonly_area();
     535  if (a) {
    535536    if ((a->active + more) > a->high) {
    536537      return NULL;
     
    631632create_reserved_area(natural totalsize)
    632633{
    633   OSErr err;
    634634  Ptr h;
    635   natural base, n;
     635  natural base;
    636636  BytePtr
    637637    end,
    638638    lastbyte,
    639639    start,
    640     protstart,
    641     p,
    642     want = (BytePtr)IMAGE_BASE_ADDRESS,
    643     try2;
     640    want = (BytePtr)IMAGE_BASE_ADDRESS;
    644641  area *reserved;
    645642  Boolean fixed_map_ok = false;
     
    689686               totalsize + heap_segment_size,
    690687               PROT_NONE,
    691                MAP_PRIVATE | MAP_ANON | (fixed_map_ok ? MAP_FIXED : 0, MAP_NORESERVE),
     688               MAP_PRIVATE | MAP_ANON | (fixed_map_ok ? MAP_FIXED : 0) | MAP_NORESERVE,
    692689               -1,
    693690               0);
     
    762759  natural
    763760    ndnodes = area_dnode(lisp_global(HEAP_END),lisp_global(HEAP_START)),
    764     npages = (lisp_global(HEAP_END)-lisp_global(HEAP_START)) >> log2_page_size,
    765761    markbits_size = (3*sizeof(LispObj))+((ndnodes+7)>>3),
    766762    reloctab_size = (sizeof(LispObj)*(((ndnodes+((1<<bitmap_shift)-1))>>bitmap_shift)+1));
     
    877873register_sigint_handler()
    878874{
     875  extern void install_signal_handler(int, void*);
    879876  install_signal_handler(SIGINT, (void *)sigint_handler);
    880877}
     
    11201117      } else if ((flag = (strncmp(arg, "-R", 2) == 0)) ||
    11211118                 (strcmp(arg, "--heap-reserve") == 0)) {
    1122         natural reserved_size;
     1119        natural reserved_size = reserved_area_size;
    11231120
    11241121        if (flag && arg[2]) {
     
    13481345#else
    13491346  struct utsname uts;
     1347  long got, want;
     1348  char *got_end,*want_end;
     1349  want = strtoul(min_os_version,&want_end,10);
    13501350
    13511351  uname(&uts);
    1352   if (strcmp(uts.release, min_os_version) < 0) {
     1352  got = strtoul(uts.release,&got_end,10);
     1353
     1354  while (got == want) {
     1355    if (*want_end == '.') {
     1356      want = strtoul(want_end+1,&want_end,10);
     1357      got = 0;
     1358      if (*got_end == '.') {
     1359        got = strtoul(got_end+1,&got_end,10);
     1360      } else {
     1361        break;
     1362      }
     1363    } else {
     1364      break;
     1365    }
     1366  }
     1367
     1368  if (got < want) {
    13531369    fprintf(stderr, "\n%s requires %s version %s or later; the current version is %s.\n", progname, uts.sysname, min_os_version, uts.release);
    13541370    exit(1);
     
    14721488}
    14731489
     1490int
    14741491main(int argc, char *argv[], char *envp[], void *aux)
    14751492{
     
    14801497#endif
    14811498  extern LispObj load_image(char *);
    1482   long resp;
    1483   BytePtr stack_end;
    14841499  area *a;
    14851500  BytePtr stack_base, current_sp = (BytePtr) current_stack_pointer();
    14861501  TCR *tcr;
    1487   int i;
    14881502
    14891503  check_os_version(argv[0]);
  • trunk/source/lisp-kernel/thread_manager.c

    r9785 r9901  
    11081108{
    11091109  thread_activation activation;
    1110   TCR *current = get_tcr(false);
    11111110
    11121111
     
    13571356resume_tcr(TCR *tcr)
    13581357{
    1359   int suspend_count = atomic_decf(&(tcr->suspend_count)), err;
     1358  int suspend_count = atomic_decf(&(tcr->suspend_count));
    13601359  if (suspend_count == 0) {
    13611360#ifdef DARWIN
     
    15741573
    15751574  void *p = calloc(1,sizeof(rwlock)+cache_block_size-1);
    1576   rwlock *rw;
     1575  rwlock *rw = NULL;;
    15771576 
    15781577  if (p) {
  • trunk/source/lisp-kernel/x86-constants.h

    r7624 r9901  
    3838
    3939#define dnode_size (node_size*2)
    40 #define dnode_shift node_shift+1
     40#define dnode_shift (node_shift+1)
    4141
    4242#define INTERRUPT_LEVEL_BINDING_INDEX (1)
  • trunk/source/lisp-kernel/x86-exceptions.c

    r9055 r9901  
    439439                  natural arg1, natural arg2, natural arg3, natural arg4, natural arg5)
    440440{
    441   natural  callback_ptr, i;
     441  natural  callback_ptr;
    442442  int delta;
    443443  unsigned old_mxcsr = get_mxcsr();
     
    679679handle_floating_point_exception(TCR *tcr, ExceptionInformation *xp, siginfo_t *info)
    680680{
    681   int code = info->si_code, rfn = 0, skip;
    682   pc program_counter = (pc)xpPC(xp);
    683   LispObj rpc = (LispObj) program_counter, xcf, cmain = nrs_CMAIN.vcell,
     681  int code = info->si_code, skip;
     682  LispObj  xcf, cmain = nrs_CMAIN.vcell,
    684683
    685684    save_rbp = xpGPR(xp,Irbp), save_vsp = xpGPR(xp,Isp);
     
    11831182    rsp = (LispObj)(tcr->foreign_sp);
    11841183  }
    1185   return (LispObj *) ((rsp-128 & ~15));
     1184  return (LispObj *) (((rsp-128) & ~15));
    11861185}
    11871186
     
    15791578quit_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
    15801579{
    1581 #ifdef DARWIN_GS_HACK
    1582   Boolean gs_was_tcr = ensure_gs_pthread();
    1583 #endif
    15841580  TCR *tcr = get_tcr(false);
    15851581  area *a;
     
    16111607
    16121608#ifndef USE_SIGALTSTACK
     1609void
    16131610arbstack_quit_handler(int signum, siginfo_t *info, ExceptionInformation *context)
    16141611{
     
    19171914  if ((program_counter >= &egc_write_barrier_start) &&
    19181915      (program_counter < &egc_write_barrier_end)) {
    1919     LispObj *ea = 0, val, root;
     1916    LispObj *ea = 0, val, root = 0;
    19201917    bitvector refbits = (bitvector)(lisp_global(REFBITS));
    19211918    Boolean need_store = true, need_check_memo = true, need_memoize_root = false;
     
    19811978{
    19821979  void *cur_allocptr = (void *)(tcr->save_allocptr);
    1983   LispObj lisprsp, lisptsp;
     1980  LispObj lisprsp;
    19841981  area *a;
    19851982
     
    20262023{
    20272024  TCR *tcr = get_tcr(false), *other_tcr;
    2028   ExceptionInformation* other_xp;
    20292025  int result;
    20302026  signed_natural inhibit;
     
    22422238restore_mach_thread_state(mach_port_t thread, ExceptionInformation *pseudosigcontext)
    22432239{
    2244   int i, j;
    22452240  kern_return_t kret;
    22462241#if WORD_SIZE == 64
     
    23192314{
    23202315  mach_msg_type_number_t thread_state_count;
    2321   kern_return_t result;
    2322   int i,j;
    23232316  ExceptionInformation *pseudosigcontext;
    23242317#ifdef X8664
     
    23272320  struct mcontext *mc;
    23282321#endif
    2329   natural stackp, backlink;
     2322  natural stackp;
    23302323
    23312324 
     
    24132406#endif
    24142407  ExceptionInformation *pseudosigcontext;
    2415   int i, j, old_valence = tcr->valence;
    2416   kern_return_t result;
     2408  int  old_valence = tcr->valence;
    24172409  natural stackp, *stackpp;
    24182410  siginfo_t *info;
     
    25242516                      mach_msg_type_number_t code_count)
    25252517{
    2526   int signum = 0, code = *code_vector, code1;
     2518  int signum = 0, code = *code_vector;
    25272519  TCR *tcr = TCR_FROM_EXCEPTION_PORT(exception_port);
    25282520  kern_return_t kret, call_kret;
     
    28072799  mach_port_t
    28082800    thread_exception_port = TCR_TO_EXCEPTION_PORT(tcr),
    2809     target_thread = pthread_mach_thread_np((pthread_t)ptr_from_lispobj(tcr->osid)),
    28102801    task_self = mach_task_self();
    28112802  kern_return_t kret;
  • trunk/source/lisp-kernel/x86-gc.c

    r9536 r9901  
    144144check_range(LispObj *start, LispObj *end, Boolean header_allowed)
    145145{
    146   LispObj node, *current = start, *prev;
     146  LispObj node, *current = start, *prev = NULL;
    147147  int tag;
    148148  natural elements;
     
    413413  int tag_n = fulltag_of(n);
    414414  bitvector markbits = GCmarkbits;
    415   natural dnode, bits, *bitsp, mask, original_n = n;
     415  natural dnode, bits, *bitsp, mask;
    416416
    417417  if (!is_node_fulltag(tag_n)) {
     
    14401440  int tag;
    14411441  bitvector markbits = GCmarkbits;
    1442     /* keep track of whether or not we saw any
    1443        code_vector headers, and only flush cache if so. */
    1444   Boolean GCrelocated_code_vector = false;
    14451442
    14461443  if (dnode < GCndnodes_in_area) {
     
    17481745{
    17491746  LispObj obj = *ref, header, new;
    1750   natural tag = fulltag_of(obj), header_tag, header_subtag;
     1747  natural tag = fulltag_of(obj), header_tag;
    17511748  Boolean changed = false;
    17521749
     
    19941991  TCR  *other_tcr;
    19951992  natural max_pure_size;
    1996   OSErr err;
    19971993  BytePtr new_pure_start;
    19981994
  • trunk/source/lisp-kernel/x86_print.c

    r6522 r9901  
    254254  LispObj
    255255    pname = rawsym->pname,
    256     package = rawsym->package_predicate,
    257     pname_header = header_of(pname);
     256    package = rawsym->package_predicate;
    258257
    259258  if (fulltag_of(package) == fulltag_cons) {
     
    318317{
    319318  signed sdisp;
    320   unsigned disp;
     319  unsigned disp = 0;
    321320  LispObj f = 0;
    322321
Note: See TracChangeset for help on using the changeset viewer.