Changeset 155

Show
Ignore:
Timestamp:
06/05/07 15:25:10 (1 year ago)
Author:
takkaria
Message:

Apply patches from #129 (Christer Nyfalt).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/cmd1.c

    r152 r155  
    500500        if (!inven_carry_okay(o_ptr)) return (FALSE); 
    501501 
    502         /* Object is marked to not pickup */ 
     502        /* Object is marked to pickup */ 
    503503        if ((k_info[o_ptr->k_idx].squelch == NO_SQUELCH_NEVER_PICKUP) && 
    504504                object_aware_p(o_ptr)) return (FALSE); 
  • trunk/src/cmd3.c

    r152 r155  
    191191 
    192192                /* Process preventions */ 
    193                 /* XXX Perhaps this should be factored out to a seperate function? */ 
     193                /* XXX Perhaps this should be factored out to a separate function? */ 
    194194                while (s) 
    195195                { 
     
    544544 
    545545                        /*Mark the view to be updated*/ 
    546                         p_ptr->update |= (PU_FORGET_VIEW | PU_UPDATE_VIEW);; 
     546                        p_ptr->update |= (PU_FORGET_VIEW | PU_UPDATE_VIEW); 
    547547                } 
    548548        } 
  • trunk/src/cmd5.c

    r136 r155  
    577577                spell = get_spell(o_ptr, "browse", TRUE, TRUE); 
    578578                if (spell < 0) break; 
    579          
     579 
    580580                /* Browse the spell */ 
    581581                browse_spell(spell); 
  • trunk/src/files.c

    r153 r155  
    44954495        if(mode == 0) 
    44964496        { 
    4497                 fprintf(htm, "<!DOCTYPE html>"); 
    4498                 fprintf(htm, "<html\n"); 
    4499                 fprintf(htm, "<head>\n"); 
    4500                 fprintf(htm, "  <meta=\"generator\" content=\"%s %d.%d.%d\">\n", 
     4497                fprintf(htm, "<!DOCTYPE html><html><head>\n"); 
     4498                fprintf(htm, "  <meta='generator' content='%s %d.%d.%d'>\n", 
    45014499                        VERSION_NAME, VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); 
    45024500                fprintf(htm, "  <title>%s</title>\n", name); 
    45034501                fprintf(htm, "</head>\n\n"); 
    4504                 fprintf(htm, "<body text=\"#FFFFFF\" bgcolor=\"#000000\">\n"); 
    4505                 fprintf(htm, "<pre><tt>\n"); 
     4502                fprintf(htm, "<body style='color: #fff; background: #000;'>\n"); 
     4503                fprintf(htm, "<pre>\n"); 
    45064504        } 
    45074505        else  
     
    45484546 
    45494547                        /* Write the character and escape special HTML characters */ 
    4550                         if(mode == 0) write_html_escape_char(htm, c); 
     4548                        if (mode == 0) write_html_escape_char(htm, c); 
    45514549                        else fprintf(htm, "%c", c); 
    45524550                } 
     
    45584556        /* Close the last font-color tag if necessary */ 
    45594557        if (oa != TERM_WHITE) fprintf(htm, close_color_fmt); 
    4560         if(mode == 0) { 
    4561                 fprintf(htm, "</tt></pre>\n"); 
     4558 
     4559        if (mode == 0) 
     4560        { 
     4561                fprintf(htm, "</pre>\n"); 
    45624562                fprintf(htm, "</body>\n"); 
    45634563                fprintf(htm, "</html>\n"); 
     
    45684568        } 
    45694569 
    4570                /* Close it */ 
    4571                my_fclose(htm); 
    4572 } 
     4570        /* Close it */ 
     4571        my_fclose(htm); 
     4572} 
  • trunk/src/init1.c

    r136 r155  
    875875                z_info->s_max = max; 
    876876        } 
    877          
     877 
    878878        /* Process 'O' for "Maximum o_list[] index" */ 
    879879        else if (buf[2] == 'O') 
  • trunk/src/init2.c

    r140 r155  
    10781078        } 
    10791079 
    1080         /* Place each spell in it's own book */ 
     1080        /* Place each spell in its own book */ 
    10811081        for (spell = 0; spell < z_info->s_max; spell++) 
    10821082        { 
  • trunk/src/load.c

    r154 r155  
    10131013        for (i = 0; i < inscriptions_count; i++) 
    10141014        { 
    1015                 char tmp[80]; 
    1016  
    1017                 rd_s16b(&inscriptions[i].kind_idx); 
    1018                 rd_string(tmp, 80); 
    1019  
    1020                 inscriptions[i].inscription_idx = quark_add(tmp); 
     1015                char tmp[80]; 
     1016 
     1017                rd_s16b(&inscriptions[i].kind_idx); 
     1018                rd_string(tmp, sizeof(tmp)); 
     1019 
     1020                inscriptions[i].inscription_idx = quark_add(tmp); 
    10211021        } 
    10221022 
  • trunk/src/main-crb.c

    r148 r155  
    37793779 
    37803780 
    3781 /* 
    3782  * Hook to tell the user something, and then crash 
    3783  */ 
    3784 static void hook_core(cptr str) 
    3785 { 
    3786         /* XXX Use the debugger */ 
    3787         /* DebugStr(str); */ 
    3788  
    3789         /* Warning */ 
    3790         if (str) mac_warning(str); 
    3791         if(!save_player()) 
    3792                 mac_warning("Fatal error -- save failed!"); 
    3793         else  
    3794                 mac_warning("Fatal error -- game saved successfully"); 
    3795  
    3796         /* Quit */ 
    3797         quit(NULL); 
    3798 } 
    37993781 
    38003782/*** Main program ***/ 
     
    38603842        plog_aux = hook_plog; 
    38613843        quit_aux = hook_quit; 
    3862         core_aux = hook_core; 
    38633844 
    38643845        /* Initialize colors */ 
  • trunk/src/main-gcu.c

    r128 r155  
    718718 
    719719        /* Format to appropriate size */ 
    720         strnfmt(buf, sizeof buf, "%.*s", n, s); 
     720        strnfmt(buf, sizeof(buf), "%.*s", n, s); 
    721721 
    722722        /* Write to screen */ 
     
    831831        /* Activate hooks */ 
    832832        quit_aux = hook_quit; 
    833         core_aux = hook_quit; 
    834833 
    835834        /* Require standard size screen */ 
  • trunk/src/main-gtk.c

    r148 r155  
    819819        /* Activate hooks */ 
    820820        quit_aux = hook_quit; 
    821         core_aux = hook_quit; 
    822821 
    823822        /* Set the system suffix */ 
  • trunk/src/main-ros.c

    r148 r155  
    170170 *   ultimate benefit. 
    171171 */ 
    172 /* #define HASNOCORE */ 
     172#define HASNOCORE 
    173173 
    174174/* 
  • trunk/src/main-win.c

    r153 r155  
    50255025        plog_aux = hack_plog; 
    50265026        quit_aux = hack_quit; 
    5027         core_aux = hack_quit; 
    50285027 
    50295028        /* Prepare the filepaths */ 
     
    50655064        plog_aux = hook_plog; 
    50665065        quit_aux = hook_quit; 
    5067         core_aux = hook_quit; 
    50685066 
    50695067        /* Set the system suffix */ 
  • trunk/src/object2.c

    r152 r155  
    372372                        /* Nearby objects start out "immune" */ 
    373373                        if ((cur_dis > 0) && (distance(py, px, y, x) < cur_dis) && 
    374                                                                                (k_ptr->squelch != SQUELCH_ALWAYS)) 
     374                            (k_ptr->squelch != SQUELCH_ALWAYS)) 
    375375                                continue; 
    376376 
     
    788788        /* Fully aware of the effects */ 
    789789        k_info[o_ptr->k_idx].aware = TRUE; 
    790          
     790 
    791791        /* Scrolls can change the graphics when becoming aware */ 
    792792        if (o_ptr->tval == TV_SCROLL) 
  • trunk/src/save.c

    r135 r155  
    412412 * Write autoinscribe & squelch item-quality submenu to the savefile 
    413413 */ 
    414 static void wr_squelch(
     414static void wr_squelch(void
    415415{ 
    416416        int i; 
  • trunk/src/spells2.c

    r117 r155  
    247247 
    248248                /* 
    249                 * If the object was squelched, keep analyzing 
    250                 * the same slot (the inventory was displaced). -DG- 
    251                 */ 
     249                * If the object was squelched, keep analyzing 
     250                * the same slot (the inventory was displaced). -DG- 
     251                */ 
    252252                if (squelch != SQUELCH_YES || i < INVEN_WIELD) continue; 
    253253 
     
    39363936        else 
    39373937        { 
    3938                 msg_format("On the ground: %s.  %s", o_name, 
     3938                msg_format("On the ground: %s.  %s", o_name, 
    39393939                          squelch_to_label(squelch)); 
    39403940        } 
     
    39423942        return (squelch); 
    39433943} 
    3944  
  • trunk/src/x-spell.c

    r136 r155  
    1616/* 
    1717 * The defines below must match the spell numbers in spell.txt 
    18  * if they don't, "interessting" things will probably happen. 
     18 * if they don't, "interesting" things will probably happen. 
    1919 * 
    20  * It would be nice if we could get rid of this dependancy 
     20 * It would be nice if we could get rid of this dependency. 
    2121 */ 
    22  
    2322#define SPELL_MAGIC_MISSILE             0 
    2423#define SPELL_DETECT_MONSTERS           1 
  • trunk/src/z-form.c

    r148 r155  
    818818        quit(res); 
    819819} 
    820  
    821  
    822  
    823 /* 
    824  * Vararg interface to core() 
    825  */ 
    826 void core_fmt(cptr fmt, ...) 
    827 { 
    828         char *res; 
    829         va_list vp; 
    830  
    831         /* Begin the Varargs Stuff */ 
    832         va_start(vp, fmt); 
    833  
    834         /* If requested, Do a virtual fprintf to stderr */ 
    835         res = vformat(fmt, vp); 
    836  
    837         /* End the Varargs Stuff */ 
    838         va_end(vp); 
    839  
    840         /* Call core() */ 
    841         core(res); 
    842 } 
  • trunk/src/z-form.h

    r1 r155  
    5656 
    5757 
    58 #endif 
    59  
    60  
     58#endif /* INCLUDED_Z_FORM_H */ 
  • trunk/src/z-util.c

    r148 r155  
    145145 * Determine if string "a" is equal to string "b" 
    146146 */ 
     147#undef streq 
    147148bool streq(cptr a, cptr b) 
    148149{ 
     
    229230        (void)(exit(EXIT_FAILURE)); 
    230231} 
    231  
    232  
    233  
    234 /* 
    235  * Redefinable "core" action 
    236  */ 
    237 void (*core_aux)(cptr) = NULL; 
    238  
    239 /* 
    240  * Dump a core file, after printing a warning message 
    241  * As with "quit()", try to use the "core_aux()" hook first. 
    242  */ 
    243 void core(cptr str) 
    244 { 
    245         char *crash = NULL; 
    246  
    247         /* Use the aux function */ 
    248         if (core_aux) (*core_aux)(str); 
    249  
    250         /* Dump the warning string */ 
    251         if (str) plog(str); 
    252  
    253         /* Attempt to Crash */ 
    254         (*crash) = (*crash); 
    255  
    256         /* Be sure we exited */ 
    257         quit("core() failed"); 
    258 } 
    259  
    260  
    261  
    262  
  • trunk/src/z-util.h

    r1 r155  
    3131extern void (*plog_aux)(cptr); 
    3232extern void (*quit_aux)(cptr); 
    33 extern void (*core_aux)(cptr); 
    3433 
    3534 
     
    5150extern bool suffix(cptr s, cptr t); 
    5251 
     52#define streq(s, t)             (!strcmp(s, t)) 
     53 
    5354 
    5455/* Print an error message */ 
     
    5859extern void quit(cptr str); 
    5960 
    60 /* Dump core, with optional message */ 
    61 extern void core(cptr str); 
    6261 
    6362 
    64  
    65 #endif 
    66  
    67  
     63#endif /* INCLUDED_Z_UTIL_H */ 
  • trunk/src/z-virt.c

    r148 r155  
    3737        if (rpanic_aux) return ((*rpanic_aux)(len)); 
    3838 
    39         /* Attempt to crash before icky things happen */ 
     39        /* Attempt to quit before icky things happen */ 
    4040        quit("Out of Memory!"); 
    4141