summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Haley2010-09-18 07:54:00 +0000
committerJames Haley2010-09-18 07:54:00 +0000
commitbf215f516ed4742fd19b920d8a5d3f6738375168 (patch)
tree63514b2a3fa1266f3a68169495ae6cc1b4e630c3
parent496bd0cfca29fdcb7b6de72fac85d6d6fa62e2af (diff)
downloadchocolate-doom-bf215f516ed4742fd19b920d8a5d3f6738375168.tar.gz
chocolate-doom-bf215f516ed4742fd19b920d8a5d3f6738375168.tar.bz2
chocolate-doom-bf215f516ed4742fd19b920d8a5d3f6738375168.zip
Upped warning level and started fixing warnings - can't believe some
genius had them completely disabled... Also, a bug fix to EV_ClearForceFields so that it continues running on all tagged sectors even if sec->linecount is 0, and so that it returns a value. Made dialogtext and M_WriteText's 3rd parameter const for safety. Subversion-branch: /branches/strife-branch Subversion-revision: 2108
-rw-r--r--msvc/strife.vcproj2
-rw-r--r--src/strife/m_menu.c18
-rw-r--r--src/strife/m_menu.h2
-rw-r--r--src/strife/p_dialog.c2
-rw-r--r--src/strife/p_doors.c10
-rw-r--r--src/strife/p_spec.h4
6 files changed, 20 insertions, 18 deletions
diff --git a/msvc/strife.vcproj b/msvc/strife.vcproj
index 63778125..51676a8b 100644
--- a/msvc/strife.vcproj
+++ b/msvc/strife.vcproj
@@ -51,7 +51,7 @@
UsePrecompiledHeader="0"
ExpandAttributedSource="true"
AssemblerOutput="2"
- WarningLevel="0"
+ WarningLevel="2"
DebugInformationFormat="4"
CompileAs="1"
/>
diff --git a/src/strife/m_menu.c b/src/strife/m_menu.c
index 8fc049a5..62a56ab2 100644
--- a/src/strife/m_menu.c
+++ b/src/strife/m_menu.c
@@ -1333,15 +1333,15 @@ int M_StringHeight(char* string)
//
int
M_WriteText
-( int x,
- int y,
- char* string)
-{
- int w;
- char* ch;
- int c;
- int cx;
- int cy;
+( int x,
+ int y,
+ const char* string) // haleyjd: made const for safety w/dialog engine
+{
+ int w;
+ const char* ch;
+ int c;
+ int cx;
+ int cy;
ch = string;
cx = x;
diff --git a/src/strife/m_menu.h b/src/strife/m_menu.h
index b302ea08..bbd2d9bc 100644
--- a/src/strife/m_menu.h
+++ b/src/strife/m_menu.h
@@ -94,7 +94,7 @@ void M_Init (void);
void M_StartControlPanel (void);
// haleyjd 09/04/10: Externalized. Draws menu text.
-int M_WriteText(int x, int y, char *string);
+int M_WriteText(int x, int y, const char *string);
// haleyjd 09/04/10: [STRIFE] New function.
void M_DialogDimMsg(int x, int y, char *str, boolean useyfont);
diff --git a/src/strife/p_dialog.c b/src/strife/p_dialog.c
index 1557c369..da46f4c2 100644
--- a/src/strife/p_dialog.c
+++ b/src/strife/p_dialog.c
@@ -379,7 +379,7 @@ static int dialogbgpiclumpnum;
static char *dialogname;
// Current dialog text.
-static char *dialogtext;
+static const char *dialogtext;
//=============================================================================
//
diff --git a/src/strife/p_doors.c b/src/strife/p_doors.c
index 9a536c64..b9696a53 100644
--- a/src/strife/p_doors.c
+++ b/src/strife/p_doors.c
@@ -498,13 +498,14 @@ int EV_DoDoor(line_t* line, vldoor_e type)
//
// villsa [STRIFE] new function
//
-int EV_ClearForceFields(line_t* line)
+boolean EV_ClearForceFields(line_t* line)
{
int secnum;
int rtn;
sector_t* sec;
int i;
line_t* secline;
+ boolean ret = false;
secnum = -1;
rtn = 0;
@@ -515,10 +516,9 @@ int EV_ClearForceFields(line_t* line)
rtn = 1;
line->special = 0;
+ ret = true;
- if(!sec->linecount)
- return;
-
+ // haleyjd 09/18/10: fixed to continue w/linecount == 0, not return
for(i = 0; i < sec->linecount; i++)
{
secline = sec->lines[i];
@@ -533,6 +533,8 @@ int EV_ClearForceFields(line_t* line)
sides[secline->sidenum[1]].midtexture = 0;
}
}
+
+ return ret;
}
diff --git a/src/strife/p_spec.h b/src/strife/p_spec.h
index 215c7644..49c5fbd9 100644
--- a/src/strife/p_spec.h
+++ b/src/strife/p_spec.h
@@ -131,8 +131,8 @@ getNextSector
//
// SPECIAL
//
-int EV_DoDonut(line_t* line);
-int EV_ClearForceFields(line_t* line); // villsa [STRIFE]
+int EV_DoDonut(line_t* line);
+boolean EV_ClearForceFields(line_t* line); // villsa [STRIFE]
//