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

remove unused code #299

Merged
merged 1 commit into from
May 6, 2024
Merged
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
1 change: 0 additions & 1 deletion Descent3/BOA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
#include "room.h"
#include <string.h>
#include <stdlib.h>
#include <search.h>
#include "object.h"
#include "bsp.h"
#include "pserror.h"
Expand Down
1 change: 0 additions & 1 deletion Descent3/TerrainSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@
#include "gameloop.h"
#include <memory.h>
#include <stdlib.h>
#include <search.h>
#include "config.h"
#include "dedicated_server.h"

Expand Down
3 changes: 0 additions & 3 deletions Descent3/dedicated_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,11 +786,8 @@ void PrintDedicatedMessage(const char *fmt, ...) {
#ifdef __LINUX__
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/termios.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
Expand Down
6 changes: 1 addition & 5 deletions Descent3/levelgoal.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@

#include "object.h"
#include "cfile.h"
#if defined(MACOSX)
#include <malloc/malloc.h>
#else
#include <malloc.h>
#endif
#include <cstdlib>
#include "mem.h"
#include "levelgoal_external.h"

Expand Down
11 changes: 2 additions & 9 deletions Descent3/loki_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,11 @@


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <dirent.h>
#include <time.h>
#include <errno.h>
#if defined(MACOSX)
#include <sys/mount.h>
#endif

#include "SDL.h"

Expand Down
2 changes: 0 additions & 2 deletions dd_lnxsound/sdlsound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@
#include <fcntl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dlfcn.h>
#include <stdarg.h>
#include <errno.h>
#include "cfile.h"
Expand Down
6 changes: 1 addition & 5 deletions dd_sndlib/ddsoundload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,7 @@
#endif

#include "ssl_lib.h"
#if defined(MACOSX)
#include <sys/malloc.h>
#else
#include <malloc.h>
#endif
#include <cstdlib>
#include "cfile.h"
#include "mem.h"
#include "pserror.h"
Expand Down
1 change: 0 additions & 1 deletion ddebug/lnxmono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ bool Debug_print_block = false;
// pthread library functions
// ===============================
#include <pthread.h>
#include <dlfcn.h>

#include <algorithm>

Expand Down
1 change: 0 additions & 1 deletion ddio_lnx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ set(CPPS
lnxkey_null.cpp
lnxmouse.cpp
lnxtimer.cpp
lnxkey_raw.cpp
lnxcdrom.cpp
lnxkey_sdl.cpp)

Expand Down
39 changes: 0 additions & 39 deletions ddio_lnx/ddio_lnx.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,43 +29,4 @@
class oeLnxApplication;
extern oeLnxApplication *Lnx_app_obj;

/*
typedef struct dinput_data {
oeWin32Application *app;
HWND hwnd;
LPDIRECTINPUT lpdi;

LPDIRECTINPUTDEVICE lpkeydev;
HHOOK hkeyhook;
BOOL key_acquired;
bool preemptive;

LPDIRECTINPUTDEVICE lpmsedev;
HHOOK hmsehook;
BOOL mse_acquired;
int num_mse_buttons;
int num_mse_axes;
} dinput_data;

extern dinput_data DInputData;
extern bool DDIO_init;
extern bool DDIO_preemptive;


// Internal functions
// thread handlers
// -keyboard

bool ddio_JoyHandler();
void ddio_DebugMessage(unsigned err, char *fmt, ...);
float ddio_TickToSeconds(unsigned int ticks);

void ddio_KeyHandler(MSG *msg);
void ddio_MouseHandler(MSG *msg);

#define DDIO_MESSAGE(_m) ddio_DebugMessage _m

#define MAKE_DDIO_TIME(_ms) ddio_TickToSeconds(_ms)

*/
#endif
1 change: 0 additions & 1 deletion ddio_lnx/lnxcdrom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
* $NoKeywords: $
*/

#include <sys/mount.h>
#include <sys/types.h>
#include <stdlib.h>
#include <sys/stat.h>
Expand Down
92 changes: 0 additions & 92 deletions ddio_lnx/lnxfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,98 +511,6 @@ void ddio_FindFileClose() {
#endif
}

glob_t fdres = {0, NULL, 0};
int globdirindex = -1;
bool ddio_FindDirStart(const char *wildcard, char *namebuf) {
ASSERT(wildcard);
ASSERT(namebuf);
if (globdirindex != -1)
ddio_FindDirClose();
int rc, flags;
flags = GLOB_MARK; // put a / to the end of directories, making it easier to find em
rc = glob(wildcard, flags, globerrfn, &fdres);
if (rc == GLOB_NOSPACE) {
mprintf((0, "Out of space during glob\n"));
namebuf[0] = '\0';
globdirindex = -1;
return false;
}

if (!fdres.gl_pathc) {
namebuf[0] = '\0';
globdirindex = -1;
return false;
}

globdirindex = 0;
int glpathlen = strlen(fdres.gl_pathv[0]);

if (fdres.gl_pathv[0][glpathlen - 1] == '/') {
// return only the last directory
fdres.gl_pathv[0][glpathlen - 1] = '\0'; // lose the ending '/'
char *endptr = &fdres.gl_pathv[0][glpathlen - 1];
while (endptr >= fdres.gl_pathv[0] && *endptr != '/')
endptr--;
if (*endptr == '/') {
strcpy(namebuf, endptr + 1);
} else {
strcpy(namebuf, fdres.gl_pathv[0]);
}
return true;
} else {
return ddio_FindNextDir(namebuf);
}

namebuf[0] = '\0';
return false;
}

bool ddio_FindNextDir(char *namebuf) {
ASSERT(namebuf);
if (globdirindex == -1)
return false;
globdirindex++;
if (globdirindex >= fdres.gl_pathc)
return false;

bool done = false;
bool found = false;

while (!done) {
if (globdirindex >= fdres.gl_pathc) {
namebuf[0] = '\0';
done = true;
continue;
}
int glpathlen = strlen(fdres.gl_pathv[globdirindex]);
if (fdres.gl_pathv[globdirindex][glpathlen - 1] == '/') {
// return only the last directory
fdres.gl_pathv[globdirindex][glpathlen - 1] = '\0'; // lose the ending '/'
char *endptr = &fdres.gl_pathv[globdirindex][glpathlen - 1];
while (endptr >= fdres.gl_pathv[globdirindex] && *endptr != '/')
endptr--;
if (*endptr == '/') {
strcpy(namebuf, endptr + 1);
} else {
strcpy(namebuf, fdres.gl_pathv[globdirindex]);
}
done = true;
found = true;
} else {
globdirindex++;
}
}

return found;
}

void ddio_FindDirClose() {
if (globdirindex == -1)
return;
globdirindex = -1;
globfree(&fdres);
}

// pass in a pathname (could be from ddio_SplitPath), root_path will have the drive name.
void ddio_GetRootFromPath(const char *srcPath, char *root_path) {
assert(root_path);
Expand Down
Loading