Code refactor.

This commit is contained in:
2021-04-11 00:44:29 +01:00
parent d3b8e65bdd
commit 09e7535190
13 changed files with 49 additions and 26 deletions

View File

@@ -112,4 +112,3 @@ static const os2_attr_tests_t os2_attrs[KNOWN_OS2_ATTRS] = {
};
#endif // AARU_FSTESTER_SETTER_SRC_OS2_ATTR_H_

View File

@@ -44,7 +44,7 @@ void DeleteFiles(const char* path)
ACTION_RET actionTaken = 0;
HFILE handle;
// 16 bit
// 16 bit
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
USHORT driveNo = path[0] - '@';
#else // 32 bit

View File

@@ -42,7 +42,7 @@ void DirectoryDepth(const char* path)
char filename[9];
int pos = 2;
// 16 bit
// 16 bit
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
USHORT driveNo = path[0] - '@';
#else // 32 bit

View File

@@ -44,7 +44,7 @@ void Filenames(const char* path)
char message[300];
int pos = 0;
// 16 bit
// 16 bit
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
USHORT driveNo = path[0] - '@';
#else // 32 bit

View File

@@ -44,7 +44,7 @@ void MillionFiles(const char* path)
ACTION_RET actionTaken = 0;
HFILE handle;
// 16 bit
// 16 bit
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
USHORT driveNo = path[0] - '@';
#else // 32 bit

View File

@@ -49,7 +49,7 @@ void Fragmentation(const char* path, size_t clusterSize)
HFILE handle;
long i;
// 16 bit
// 16 bit
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
USHORT driveNo = path[0] - '@';
#else // 32 bit

View File

@@ -24,5 +24,6 @@ Copyright (C) 2011-2021 Natalia Portillo
#include "../include/defs.h"
void FilePermissions(const char* path) { /* Do nothing, not supported by target operating system */ }
void FilePermissions(const char* path)
{ /* Do nothing, not supported by target operating system */
}

View File

@@ -24,4 +24,6 @@ Copyright (C) 2011-2021 Natalia Portillo
#include "../include/defs.h"
void ResourceFork(const char* path) { /* Do nothing, not supported by target operating system */ }
void ResourceFork(const char* path)
{ /* Do nothing, not supported by target operating system */
}

View File

@@ -30,9 +30,9 @@ Copyright (C) 2011-2021 Natalia Portillo
#include <stdlib.h>
#include <string.h>
#include "../os2defs.h"
#include "../include/consts.h"
#include "../include/defs.h"
#include "os2defs.h"
void Sparse(const char* path)
{ /* Do nothing, not supported by target operating system */

View File

@@ -45,7 +45,7 @@ void Timestamps(const char* path)
HFILE handle;
char message[300];
// 16 bit
// 16 bit
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
USHORT status_size = sizeof(FILESTATUS);
FILESTATUS status;

View File

@@ -45,7 +45,7 @@ void GetVolumeInfo(const char* path, size_t* clusterSize)
USHORT usVolSerialHigh;
USHORT usVolSerialLow;
// 16 bit
// 16 bit
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
USHORT cbData = sizeof(bData);
USHORT driveNo = path[0] - '@';
@@ -58,7 +58,7 @@ void GetVolumeInfo(const char* path, size_t* clusterSize)
*clusterSize = 0;
// 16 bit
// 16 bit
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
rc = DosQFSAttach((PSZ)path, 0, FSAIL_QUERYNAME, (PVOID)&bData, &cbData, 0);
#else // 32 bit
@@ -72,7 +72,7 @@ void GetVolumeInfo(const char* path, size_t* clusterSize)
if(rc) log_write("Error %d requesting volume information.\n", rc);
else
{
// 16 bit
// 16 bit
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
fsdName = &bData[4 + (USHORT)bData[2] + 1 + 2];
#else // 32 bit
@@ -83,7 +83,7 @@ void GetVolumeInfo(const char* path, size_t* clusterSize)
pfsAllocateBuffer = (PFSALLOCATE)malloc(sizeof(FSALLOCATE));
// 16 bit
// 16 bit
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
rc = DosQFSInfo(driveNo, 1, (PBYTE)pfsAllocateBuffer, sizeof(FSALLOCATE));
#else // 32 bit
@@ -111,7 +111,7 @@ void GetVolumeInfo(const char* path, size_t* clusterSize)
pfsInfo = (PFSINFO)malloc(sizeof(FSINFO));
// 16 bit
// 16 bit
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
rc = DosQFSInfo(driveNo, 2, (PBYTE)pfsInfo, sizeof(FSINFO));
#else // 32 bit
@@ -122,11 +122,9 @@ void GetVolumeInfo(const char* path, size_t* clusterSize)
else
{
usVolSerialHigh = *((PUSHORT)&pfsInfo->ftimeCreation);
usVolSerialLow = *((PUSHORT)&pfsInfo->fdateCreation);
usVolSerialLow = *((PUSHORT)&pfsInfo->fdateCreation);
log_write("\tVolume label: %s\n", pfsInfo->vol.szVolLabel);
log_write("\tVolume created on %04X:%04X\n",
usVolSerialHigh,
usVolSerialLow);
log_write("\tVolume created on %04X:%04X\n", usVolSerialHigh, usVolSerialLow);
}
free(pfsInfo);