Remove some unused code.

This commit is contained in:
2021-03-14 18:50:14 +00:00
parent b1f7226cfa
commit 1fa25644d1
13 changed files with 11 additions and 48 deletions

View File

@@ -74,15 +74,12 @@ void GetOsInfo()
case DOS_FLAVOR_WINME: case DOS_FLAVOR_WINME:
printf("Will not run under Windows 9x. Exiting...\n"); printf("Will not run under Windows 9x. Exiting...\n");
exit(1); exit(1);
break;
case DOS_FLAVOR_WINNT: case DOS_FLAVOR_WINNT:
printf("Will not run under Windows NT. Exiting...\n"); printf("Will not run under Windows NT. Exiting...\n");
exit(1); exit(1);
break;
case DOS_FLAVOR_OS2: case DOS_FLAVOR_OS2:
printf("Will not run under OS/2. Exiting...\n"); printf("Will not run under OS/2. Exiting...\n");
exit(1); exit(1);
break;
case DOS_FLAVOR_PTSDOS: case DOS_FLAVOR_PTSDOS:
printf("OS information:\n"); printf("OS information:\n");
printf("\tRunning under PTS-DOS %d.%d\n", dosuname_version.major, dosuname_version.minor); printf("\tRunning under PTS-DOS %d.%d\n", dosuname_version.major, dosuname_version.minor);

View File

@@ -49,10 +49,9 @@ void Filenames(const char* path)
int16_t refNum; int16_t refNum;
int16_t refFile; int16_t refFile;
int32_t dirId; int32_t dirId;
FInfo finderInfo;
int32_t count; int32_t count;
char message[300]; char message[300];
int pos = 0; int pos;
HParamBlockRec dirPB; HParamBlockRec dirPB;
snprintf((char*)str255, 255, "%s", path); snprintf((char*)str255, 255, "%s", path);

View File

@@ -43,16 +43,13 @@ Copyright (C) 2011-2021 Natalia Portillo
void MillionFiles(const char* path) void MillionFiles(const char* path)
{ {
OSErr rc, wRc, cRc; OSErr rc;
Str255 str255; Str255 str255;
HVolumeParam hpb; HVolumeParam hpb;
int16_t refNum; int16_t refNum;
int16_t refFile;
int32_t dirId; int32_t dirId;
FInfo finderInfo;
int32_t count;
char filename[9]; char filename[9];
int pos = 0; int pos;
HParamBlockRec dirPB; HParamBlockRec dirPB;
snprintf((char*)str255, 255, "%s", path); snprintf((char*)str255, 255, "%s", path);

View File

@@ -27,17 +27,7 @@ Contains 32-bit OS/2 code
Copyright (C) 2011-2021 Natalia Portillo Copyright (C) 2011-2021 Natalia Portillo
*****************************************************************************/ *****************************************************************************/
#define INCL_DOSMISC #include "../../include/defs.h"
#define INCL_DOSFILEMGR
#include <os2.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../os2.h"
#include "include/consts.h"
#include "include/defs.h"
void ExtendedAttributes(const char* path) void ExtendedAttributes(const char* path)
{ /* TODO: Implement */ { /* TODO: Implement */

View File

@@ -86,7 +86,7 @@ Copyright (C) 2011-2021 Natalia Portillo
#define __os2_chdir(path) DosSetCurrentDir(path) #define __os2_chdir(path) DosSetCurrentDir(path)
#define __os2_mkdir(path) DosCreateDir(path, NULL) #define __os2_mkdir(path) DosCreateDir(path, NULL)
#define __os2_delete(path) DosDelete(path); #define __os2_delete(path) DosDelete(path)
#endif #endif

View File

@@ -39,7 +39,7 @@ Copyright (C) 2011-2021 Natalia Portillo
void DeleteFiles(const char* path) void DeleteFiles(const char* path)
{ {
char filename[9]; char filename[9];
long pos = 0; long pos;
FILE* h; FILE* h;
int ret; int ret;

View File

@@ -42,7 +42,7 @@ void Filenames(const char* path)
FILE* h; FILE* h;
int rc, wRc, cRc; int rc, wRc, cRc;
char message[300]; char message[300];
int pos = 0; int pos;
ret = chdir(path); ret = chdir(path);

View File

@@ -43,7 +43,7 @@ Copyright (C) 2011-2021 Natalia Portillo
void DeleteFiles(const char* path) void DeleteFiles(const char* path)
{ {
char filename[9]; char filename[9];
DWORD pos = 0; DWORD pos;
HANDLE h; HANDLE h;
BOOL ret; BOOL ret;
DWORD error; DWORD error;

View File

@@ -51,7 +51,7 @@ void Filenames(const char* path)
DWORD dwNumberOfBytesWritten; DWORD dwNumberOfBytesWritten;
DWORD rc, wRc, cRc; DWORD rc, wRc, cRc;
char message[300]; char message[300];
int pos = 0; int pos;
lpRootPathName = malloc(dwMaxNameSize); lpRootPathName = malloc(dwMaxNameSize);

View File

@@ -43,7 +43,7 @@ Copyright (C) 2011-2021 Natalia Portillo
void MillionFiles(const char* path) void MillionFiles(const char* path)
{ {
char filename[9]; char filename[9];
DWORD pos = 0; DWORD pos;
HANDLE h; HANDLE h;
BOOL ret; BOOL ret;
DWORD error; DWORD error;

View File

@@ -55,7 +55,7 @@ void Fragmentation(const char* path, size_t clusterSize)
LPSTR lpRootPathName; LPSTR lpRootPathName;
const size_t pathSize = strlen(path); const size_t pathSize = strlen(path);
HANDLE h; HANDLE h;
DWORD rc, wRc, cRc, tRc; DWORD rc, wRc, cRc;
DWORD dwNumberOfBytesWritten; DWORD dwNumberOfBytesWritten;
lpRootPathName = malloc(dwMaxNameSize); lpRootPathName = malloc(dwMaxNameSize);
@@ -102,7 +102,6 @@ void Fragmentation(const char* path, size_t clusterSize)
rc = 0; rc = 0;
wRc = 0; wRc = 0;
cRc = 0; cRc = 0;
tRc = 0;
if(h == INVALID_HANDLE_VALUE) rc = GetLastError(); if(h == INVALID_HANDLE_VALUE) rc = GetLastError();
else else
{ {
@@ -125,7 +124,6 @@ void Fragmentation(const char* path, size_t clusterSize)
rc = 0; rc = 0;
wRc = 0; wRc = 0;
cRc = 0; cRc = 0;
tRc = 0;
if(h == INVALID_HANDLE_VALUE) rc = GetLastError(); if(h == INVALID_HANDLE_VALUE) rc = GetLastError();
else else
{ {
@@ -149,7 +147,6 @@ void Fragmentation(const char* path, size_t clusterSize)
rc = 0; rc = 0;
wRc = 0; wRc = 0;
cRc = 0; cRc = 0;
tRc = 0;
if(h == INVALID_HANDLE_VALUE) rc = GetLastError(); if(h == INVALID_HANDLE_VALUE) rc = GetLastError();
else else
{ {
@@ -172,7 +169,6 @@ void Fragmentation(const char* path, size_t clusterSize)
rc = 0; rc = 0;
wRc = 0; wRc = 0;
cRc = 0; cRc = 0;
tRc = 0;
if(h == INVALID_HANDLE_VALUE) rc = GetLastError(); if(h == INVALID_HANDLE_VALUE) rc = GetLastError();
else else
{ {
@@ -200,7 +196,6 @@ void Fragmentation(const char* path, size_t clusterSize)
rc = 0; rc = 0;
wRc = 0; wRc = 0;
cRc = 0; cRc = 0;
tRc = 0;
if(h == INVALID_HANDLE_VALUE) rc = GetLastError(); if(h == INVALID_HANDLE_VALUE) rc = GetLastError();
else else
{ {
@@ -228,7 +223,6 @@ void Fragmentation(const char* path, size_t clusterSize)
rc = 0; rc = 0;
wRc = 0; wRc = 0;
cRc = 0; cRc = 0;
tRc = 0;
if(h == INVALID_HANDLE_VALUE) rc = GetLastError(); if(h == INVALID_HANDLE_VALUE) rc = GetLastError();
else else
{ {
@@ -251,7 +245,6 @@ void Fragmentation(const char* path, size_t clusterSize)
rc = 0; rc = 0;
wRc = 0; wRc = 0;
cRc = 0; cRc = 0;
tRc = 0;
if(h == INVALID_HANDLE_VALUE) rc = GetLastError(); if(h == INVALID_HANDLE_VALUE) rc = GetLastError();
else else
{ {
@@ -274,7 +267,6 @@ void Fragmentation(const char* path, size_t clusterSize)
rc = 0; rc = 0;
wRc = 0; wRc = 0;
cRc = 0; cRc = 0;
tRc = 0;
if(h == INVALID_HANDLE_VALUE) rc = GetLastError(); if(h == INVALID_HANDLE_VALUE) rc = GetLastError();
else else
{ {
@@ -301,7 +293,6 @@ void Fragmentation(const char* path, size_t clusterSize)
rc = 0; rc = 0;
wRc = 0; wRc = 0;
cRc = 0; cRc = 0;
tRc = 0;
if(h == INVALID_HANDLE_VALUE) rc = GetLastError(); if(h == INVALID_HANDLE_VALUE) rc = GetLastError();
else else
{ {
@@ -336,7 +327,6 @@ void Fragmentation(const char* path, size_t clusterSize)
rc = 0; rc = 0;
wRc = 0; wRc = 0;
cRc = 0; cRc = 0;
tRc = 0;
if(h == INVALID_HANDLE_VALUE) rc = GetLastError(); if(h == INVALID_HANDLE_VALUE) rc = GetLastError();
else else
{ {

View File

@@ -29,7 +29,6 @@ Copyright (C) 2011-2021 Natalia Portillo
// ReSharper disable CppJoinDeclarationAndAssignment // ReSharper disable CppJoinDeclarationAndAssignment
// ReSharper disable CppDeprecatedEntity // ReSharper disable CppDeprecatedEntity
#define _CRT_SECURE_NO_WARNINGS 1
#include "../include/defs.h" #include "../include/defs.h"

View File

@@ -163,9 +163,6 @@ void ExtendedAttributes(const char* path)
printf("Creating files with extended attributes.\n"); printf("Creating files with extended attributes.\n");
rc = 0;
wRc = 0;
cRc = 0;
rRc = 0; rRc = 0;
cmp = TRUE; cmp = TRUE;
h = CreateFileA("COMMENTS", h = CreateFileA("COMMENTS",
@@ -225,9 +222,6 @@ void ExtendedAttributes(const char* path)
rRc, rRc,
cmp); cmp);
rc = 0;
wRc = 0;
cRc = 0;
rRc = 0; rRc = 0;
cmp = TRUE; cmp = TRUE;
h = CreateFileA("COMMENTS.CRT", h = CreateFileA("COMMENTS.CRT",
@@ -287,9 +281,6 @@ void ExtendedAttributes(const char* path)
rRc, rRc,
cmp); cmp);
rc = 0;
wRc = 0;
cRc = 0;
rRc = 0; rRc = 0;
cmp = TRUE; cmp = TRUE;
h = CreateFileA("ICON", h = CreateFileA("ICON",