Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move strupr and strlwr replacements to string.c #436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions SRB2.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -1785,15 +1785,6 @@ HW3SOUND for 3D hardware sound support
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl/dosstr.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
<Option target="Release Native/SDL" />
<Option target="Debug Linux/SDL" />
<Option target="Release Linux/SDL" />
<Option target="Debug Mingw/SDL" />
<Option target="Release Mingw/SDL" />
</Unit>
<Unit filename="src/sdl/endtxt.c">
<Option compilerVar="CC" />
<Option target="Debug Native/SDL" />
Expand Down
2 changes: 0 additions & 2 deletions src/android/i_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,5 +271,3 @@ char *I_ClipboardPaste(void)
}

void I_RegisterSysCommands(void) {}

#include "../sdl/dosstr.c"
4 changes: 2 additions & 2 deletions src/doomtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ typedef long ssize_t;
#endif

#ifndef HAVE_DOSSTR_FUNCS
int strupr(char *n); // from dosstr.c
int strlwr(char *n); // from dosstr.c
int strupr(char *n); // from string.c
int strlwr(char *n); // from string.c
#endif

#include <stddef.h> // for size_t
Expand Down
3 changes: 0 additions & 3 deletions src/dummy/i_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,3 @@ char *I_ClipboardPaste(void)
}

void I_RegisterSysCommands(void) {}

#include "../sdl/dosstr.c"

2 changes: 0 additions & 2 deletions src/nds/i_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,5 +282,3 @@ char *I_ClipboardPaste(void)
}

void I_RegisterSysCommands(void) {}

#include "../sdl/dosstr.c"
1 change: 0 additions & 1 deletion src/sdl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ else()
endif()

set(SRB2_SDL2_SOURCES
dosstr.c
endtxt.c
hwsym_sdl.c
i_cdmus.c
Expand Down
2 changes: 1 addition & 1 deletion src/sdl/Makefile.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ifndef NOASM
endif
endif

OBJS+=$(OBJDIR)/i_video.o $(OBJDIR)/dosstr.o $(OBJDIR)/endtxt.o $(OBJDIR)/hwsym_sdl.o
OBJS+=$(OBJDIR)/i_video.o $(OBJDIR)/endtxt.o $(OBJDIR)/hwsym_sdl.o

OPTS+=-DDIRECTFULLSCREEN -DHAVE_SDL

Expand Down
1 change: 0 additions & 1 deletion src/sdl/Srb2SDL-vc10.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@
<ClCompile Include="..\w_wad.c" />
<ClCompile Include="..\y_inter.c" />
<ClCompile Include="..\z_zone.c" />
<ClCompile Include="dosstr.c" />
<ClCompile Include="endtxt.c" />
<ClCompile Include="hwsym_sdl.c" />
<ClCompile Include="IMG_xpm.c">
Expand Down
3 changes: 0 additions & 3 deletions src/sdl/Srb2SDL-vc10.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -840,9 +840,6 @@
<ClCompile Include="..\w_wad.c">
<Filter>W_Wad</Filter>
</ClCompile>
<ClCompile Include="dosstr.c">
<Filter>SDLApp</Filter>
</ClCompile>
<ClCompile Include="endtxt.c">
<Filter>SDLApp</Filter>
</ClCompile>
Expand Down
40 changes: 0 additions & 40 deletions src/sdl/Srb2SDL-vc9.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -418,46 +418,6 @@
<Filter
Name="SDLapp"
>
<File
RelativePath="dosstr.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="endtxt.c"
>
Expand Down
4 changes: 0 additions & 4 deletions src/sdl/Srb2SDL.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 0 additions & 38 deletions src/sdl/dosstr.c

This file was deleted.

4 changes: 0 additions & 4 deletions src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
1E44AFA90B67CF6400BAD059 /* w_wad.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFA70B67CF6400BAD059 /* w_wad.c */; };
1E44AFAD0B67CF6F00BAD059 /* y_inter.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFAB0B67CF6F00BAD059 /* y_inter.c */; };
1E44AFB10B67CF7A00BAD059 /* z_zone.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFAF0B67CF7A00BAD059 /* z_zone.c */; };
1E44AFC40B67CFDC00BAD059 /* dosstr.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFB40B67CFDC00BAD059 /* dosstr.c */; };
1E44AFC50B67CFDC00BAD059 /* endtxt.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFB50B67CFDC00BAD059 /* endtxt.c */; };
1E44AFC70B67CFDC00BAD059 /* hwsym_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFB70B67CFDC00BAD059 /* hwsym_sdl.c */; };
1E44AFC90B67CFDC00BAD059 /* i_cdmus.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFB90B67CFDC00BAD059 /* i_cdmus.c */; };
Expand Down Expand Up @@ -335,7 +334,6 @@
1E44AFAC0B67CF6F00BAD059 /* y_inter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = y_inter.h; path = ../../y_inter.h; sourceTree = SOURCE_ROOT; };
1E44AFAF0B67CF7A00BAD059 /* z_zone.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = z_zone.c; path = ../../z_zone.c; sourceTree = SOURCE_ROOT; };
1E44AFB00B67CF7A00BAD059 /* z_zone.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = z_zone.h; path = ../../z_zone.h; sourceTree = SOURCE_ROOT; };
1E44AFB40B67CFDC00BAD059 /* dosstr.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dosstr.c; path = ../dosstr.c; sourceTree = SOURCE_ROOT; };
1E44AFB50B67CFDC00BAD059 /* endtxt.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = endtxt.c; path = ../endtxt.c; sourceTree = SOURCE_ROOT; };
1E44AFB60B67CFDC00BAD059 /* endtxt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = endtxt.h; path = ../endtxt.h; sourceTree = SOURCE_ROOT; };
1E44AFB70B67CFDC00BAD059 /* hwsym_sdl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hwsym_sdl.c; path = ../hwsym_sdl.c; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -794,7 +792,6 @@
children = (
1E44AFE50B67D04900BAD059 /* macosx */,
1E44AFD40B67D03100BAD059 /* filter */,
1E44AFB40B67CFDC00BAD059 /* dosstr.c */,
1E44AFB50B67CFDC00BAD059 /* endtxt.c */,
1E44AFB60B67CFDC00BAD059 /* endtxt.h */,
1E44AFB70B67CFDC00BAD059 /* hwsym_sdl.c */,
Expand Down Expand Up @@ -1142,7 +1139,6 @@
1E44AFA90B67CF6400BAD059 /* w_wad.c in Sources */,
1E44AFAD0B67CF6F00BAD059 /* y_inter.c in Sources */,
1E44AFB10B67CF7A00BAD059 /* z_zone.c in Sources */,
1E44AFC40B67CFDC00BAD059 /* dosstr.c in Sources */,
1E44AFC50B67CFDC00BAD059 /* endtxt.c in Sources */,
1E44AFC70B67CFDC00BAD059 /* hwsym_sdl.c in Sources */,
1E44AFC90B67CFDC00BAD059 /* i_cdmus.c in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion src/sdl12/Makefile.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ifndef NOASM
endif
endif

OBJS+=$(OBJDIR)/i_video.o $(OBJDIR)/dosstr.o $(OBJDIR)/endtxt.o $(OBJDIR)/hwsym_sdl.o
OBJS+=$(OBJDIR)/i_video.o $(OBJDIR)/endtxt.o $(OBJDIR)/hwsym_sdl.o

OPTS+=-DDIRECTFULLSCREEN -DHAVE_SDL

Expand Down
10 changes: 0 additions & 10 deletions src/sdl12/Srb2SDL-vc10.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -319,16 +319,6 @@
<ClCompile Include="..\blua\lzio.c" />
<ClCompile Include="..\b_bot.c" />
<ClCompile Include="..\m_cond.c" />
<ClCompile Include="dosstr.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="endtxt.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
40 changes: 0 additions & 40 deletions src/sdl12/Srb2SDL-vc9.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -418,46 +418,6 @@
<Filter
Name="SDLapp"
>
<File
RelativePath="dosstr.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="endtxt.c"
>
Expand Down
4 changes: 0 additions & 4 deletions src/sdl12/Srb2SDL.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 0 additions & 38 deletions src/sdl12/dosstr.c

This file was deleted.

4 changes: 0 additions & 4 deletions src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
1E44AFA90B67CF6400BAD059 /* w_wad.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFA70B67CF6400BAD059 /* w_wad.c */; };
1E44AFAD0B67CF6F00BAD059 /* y_inter.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFAB0B67CF6F00BAD059 /* y_inter.c */; };
1E44AFB10B67CF7A00BAD059 /* z_zone.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFAF0B67CF7A00BAD059 /* z_zone.c */; };
1E44AFC40B67CFDC00BAD059 /* dosstr.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFB40B67CFDC00BAD059 /* dosstr.c */; };
1E44AFC50B67CFDC00BAD059 /* endtxt.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFB50B67CFDC00BAD059 /* endtxt.c */; };
1E44AFC70B67CFDC00BAD059 /* hwsym_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFB70B67CFDC00BAD059 /* hwsym_sdl.c */; };
1E44AFC90B67CFDC00BAD059 /* i_cdmus.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AFB90B67CFDC00BAD059 /* i_cdmus.c */; };
Expand Down Expand Up @@ -335,7 +334,6 @@
1E44AFAC0B67CF6F00BAD059 /* y_inter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = y_inter.h; path = ../../y_inter.h; sourceTree = SOURCE_ROOT; };
1E44AFAF0B67CF7A00BAD059 /* z_zone.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = z_zone.c; path = ../../z_zone.c; sourceTree = SOURCE_ROOT; };
1E44AFB00B67CF7A00BAD059 /* z_zone.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = z_zone.h; path = ../../z_zone.h; sourceTree = SOURCE_ROOT; };
1E44AFB40B67CFDC00BAD059 /* dosstr.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dosstr.c; path = ../dosstr.c; sourceTree = SOURCE_ROOT; };
1E44AFB50B67CFDC00BAD059 /* endtxt.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = endtxt.c; path = ../endtxt.c; sourceTree = SOURCE_ROOT; };
1E44AFB60B67CFDC00BAD059 /* endtxt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = endtxt.h; path = ../endtxt.h; sourceTree = SOURCE_ROOT; };
1E44AFB70B67CFDC00BAD059 /* hwsym_sdl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hwsym_sdl.c; path = ../hwsym_sdl.c; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -794,7 +792,6 @@
children = (
1E44AFE50B67D04900BAD059 /* macosx */,
1E44AFD40B67D03100BAD059 /* filter */,
1E44AFB40B67CFDC00BAD059 /* dosstr.c */,
1E44AFB50B67CFDC00BAD059 /* endtxt.c */,
1E44AFB60B67CFDC00BAD059 /* endtxt.h */,
1E44AFB70B67CFDC00BAD059 /* hwsym_sdl.c */,
Expand Down Expand Up @@ -1142,7 +1139,6 @@
1E44AFA90B67CF6400BAD059 /* w_wad.c in Sources */,
1E44AFAD0B67CF6F00BAD059 /* y_inter.c in Sources */,
1E44AFB10B67CF7A00BAD059 /* z_zone.c in Sources */,
1E44AFC40B67CFDC00BAD059 /* dosstr.c in Sources */,
1E44AFC50B67CFDC00BAD059 /* endtxt.c in Sources */,
1E44AFC70B67CFDC00BAD059 /* hwsym_sdl.c in Sources */,
1E44AFC90B67CFDC00BAD059 /* i_cdmus.c in Sources */,
Expand Down
27 changes: 27 additions & 0 deletions src/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,33 @@
#include <stddef.h>
#include <string.h>
#include "doomdef.h"
#include "doomtype.h"

#ifndef HAVE_DOSSTR_FUNCS

#include <ctype.h>

int strupr(char *n)
{
while (*n != '\0')
{
*n = toupper(*n);
n++;
}
return 1;
}

int strlwr(char *n)
{
while (*n != '\0')
{
*n = tolower(*n);
n++;
}
return 1;
}

#endif

#if !defined (__APPLE__)

Expand Down
Loading