diff --git a/doc/NetHack开源代码泛读报告.docx b/doc/NetHack开源代码泛读报告.docx new file mode 100644 index 0000000..ae9b9a1 Binary files /dev/null and b/doc/NetHack开源代码泛读报告.docx differ diff --git a/src/NetHack_3.7/src/detect.c b/src/NetHack_3.7/src/detect.c index 2754e00..693a81c 100644 --- a/src/NetHack_3.7/src/detect.c +++ b/src/NetHack_3.7/src/detect.c @@ -9,7 +9,7 @@ */ #include "hack.h" -#include "artifact.h" +#include "artifact.h" static boolean unconstrain_map(void); static void reconstrain_map(void); diff --git a/src/NetHack_3.7/src/dig.c b/src/NetHack_3.7/src/dig.c index 5e3d81a..1d13be1 100644 --- a/src/NetHack_3.7/src/dig.c +++ b/src/NetHack_3.7/src/dig.c @@ -3,7 +3,7 @@ /*-Copyright (c) Michael Allison, 2012. */ /* NetHack may be freely redistributed. See license for details. */ -#include "hack.h" +#include "hack.h" static boolean rm_waslit(void); static void mkcavepos(coordxy, coordxy, int, boolean, boolean); diff --git a/src/NetHack_3.7/src/display.c b/src/NetHack_3.7/src/display.c index 0211e14..a3bfed6 100644 --- a/src/NetHack_3.7/src/display.c +++ b/src/NetHack_3.7/src/display.c @@ -19,7 +19,7 @@ * interface. * * The display system deals with an abstraction called a glyph. Anything - * that could possibly be displayed has a unique glyph identifier. + * that could possibly be displayed has a unique glyph identifier. * * What is seen on the screen is a combination of what the hero remembers * and what the hero currently sees. Objects and dungeon features (walls diff --git a/src/NetHack_3.7/src/dlb.c b/src/NetHack_3.7/src/dlb.c index 3e1ea9e..b57116b 100644 --- a/src/NetHack_3.7/src/dlb.c +++ b/src/NetHack_3.7/src/dlb.c @@ -26,7 +26,7 @@ typedef struct dlb_procs { int (*dlb_fread_proc)(char *, int, int, DLB_P); int (*dlb_fseek_proc)(DLB_P, long, int); char *(*dlb_fgets_proc)(char *, int, DLB_P); - int (*dlb_fgetc_proc)(DLB_P); + int (*dlb_fgetc_proc)(DLB_P); long (*dlb_ftell_proc)(DLB_P); } dlb_procs_t; diff --git a/src/NetHack_3.7/src/do.c b/src/NetHack_3.7/src/do.c index e50d8a7..b2df39c 100644 --- a/src/NetHack_3.7/src/do.c +++ b/src/NetHack_3.7/src/do.c @@ -26,7 +26,7 @@ static void temperature_change_msg(schar); /* the #drop command: drop one inventory item */ int -dodrop(void) +dodrop(void) { int result; diff --git a/src/NetHack_3.7/src/do_name.c b/src/NetHack_3.7/src/do_name.c index 3e94a14..9ecbcef 100644 --- a/src/NetHack_3.7/src/do_name.c +++ b/src/NetHack_3.7/src/do_name.c @@ -28,7 +28,7 @@ static void do_oname(struct obj *); static char *docall_xname(struct obj *); static void namefloorobj(void); -extern const char what_is_an_unknown_object[]; /* from pager.c */ +extern const char what_is_an_unknown_object[]; /* from pager.c */ #define NUMMBUF 5 diff --git a/src/NetHack_3.7/src/do_wear.c b/src/NetHack_3.7/src/do_wear.c index 6593ebf..45e2b18 100644 --- a/src/NetHack_3.7/src/do_wear.c +++ b/src/NetHack_3.7/src/do_wear.c @@ -32,7 +32,7 @@ static int Shirt_on(void); static void dragon_armor_handling(struct obj *, boolean, boolean); static void Amulet_on(void); static void learnring(struct obj *, boolean); -static void adjust_attrib(struct obj *, int, int); +static void adjust_attrib(struct obj *, int, int); static void Ring_off_or_gone(struct obj *, boolean); static int select_off(struct obj *); static struct obj *do_takeoff(void); diff --git a/src/NetHack_3.7/src/dog.c b/src/NetHack_3.7/src/dog.c index 5a8480d..ea99adc 100644 --- a/src/NetHack_3.7/src/dog.c +++ b/src/NetHack_3.7/src/dog.c @@ -34,7 +34,7 @@ free_edog(struct monst *mtmp) { if (mtmp->mextra && EDOG(mtmp)) { free((genericptr_t) EDOG(mtmp)); - EDOG(mtmp) = (struct edog *) 0; + EDOG(mtmp) = (struct edog *) 0; } mtmp->mtame = 0; } diff --git a/src/NetHack_3.7/src/dogmove.c b/src/NetHack_3.7/src/dogmove.c index 710c4f0..adc3b4a 100644 --- a/src/NetHack_3.7/src/dogmove.c +++ b/src/NetHack_3.7/src/dogmove.c @@ -33,7 +33,7 @@ droppables(struct monst *mon) * be considered a duplicate and get treated as a normal candidate * for dropping. * - * This could be 'auto', but then 'gcc -O2' warns that this function + * This could be 'auto', but then 'gcc -O2' warns that this function * might return the address of a local variable. It's mistaken, * &dummy is never returned. 'static' is simplest way to shut it up. */ diff --git a/src/NetHack_3.7/src/dokick.c b/src/NetHack_3.7/src/dokick.c index e9b9d79..acf396e 100644 --- a/src/NetHack_3.7/src/dokick.c +++ b/src/NetHack_3.7/src/dokick.c @@ -31,7 +31,7 @@ static const char kick_passes_thru[] = "kick passes harmlessly through"; static void kickdmg(struct monst *mon, boolean clumsy) { - int mdx, mdy; + int mdx, mdy; int dmg = (ACURRSTR + ACURR(A_DEX) + ACURR(A_CON)) / 15; int specialdmg, kick_skill = P_NONE; boolean trapkilled = FALSE; diff --git a/src/NetHack_3.7/src/dothrow.c b/src/NetHack_3.7/src/dothrow.c index dec8fba..4421636 100644 --- a/src/NetHack_3.7/src/dothrow.c +++ b/src/NetHack_3.7/src/dothrow.c @@ -30,7 +30,7 @@ static boolean mhurtle_step(genericptr_t, coordxy, coordxy); && ((o)->otyp == AKLYS \ || ((o)->oartifact == ART_MJOLLNIR && Role_if(PM_VALKYRIE)))) \ || (o)->otyp == BOOMERANG) - + /* gt.thrownobj (decl.c) tracks an object until it lands */ int