1
0
Fork 0

Remove false friend declarations

The single use from friended class is in public interface. Removal of
friend designators allows Clang to pinpoint few additional unused
private fields.
This commit is contained in:
Patryk Obara 2019-12-31 20:29:22 +01:00 committed by Patryk Obara
parent 3be0409d25
commit 8da42c5983
5 changed files with 13 additions and 37 deletions

View file

@ -16,14 +16,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "programs.h"
#include "dosbox.h"
#include <stdlib.h>
#include <string.h>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include "programs.h"
#include "support.h"
#include "drives.h"
#include "cross.h"
@ -31,15 +31,13 @@
#include "callback.h"
#include "cdrom.h"
#include "dos_system.h"
#include "dos_inc.h"
#include "bios.h"
#include "bios_disk.h"
#include "setup.h"
#include "control.h"
#include "inout.h"
#include "dma.h"
#include "shell.h"
#if defined(WIN32)
#ifndef S_ISDIR

View file

@ -720,8 +720,6 @@ fatDrive::fatDrive(const char *sysFilename,
Bit32u startSector)
: loadedDisk(nullptr),
created_successfully(true),
srchInfo{ {0} },
allocation{0, 0, 0, 0, 0},
bootbuffer{{0}, {0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0}, 0, 0},
absolute(false),
fattype(0),
@ -730,10 +728,9 @@ fatDrive::fatDrive(const char *sysFilename,
firstDataSector(0),
firstRootDirSect(0),
cwdDirCluster(0),
dirPosition(0),
fatSectBuffer{0},
curFatSect(0)
{
{
FILE *diskfile;
Bit32u filesize;
bool is_hdd;

View file

@ -16,11 +16,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "dosbox.h"
#include "dos_system.h"
#include "drives.h"
#include "mapper.h"
#include "support.h"
bool WildFileCmp(const char * file, const char * wild)

View file

@ -16,16 +16,17 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef DOSBOX_DRIVES_H
#define DOSBOX_DRIVES_H
#ifndef _DRIVES_H__
#define _DRIVES_H__
#include "dosbox.h"
#include <memory>
#include <string>
#include <vector>
#include <sys/types.h>
#include "dos_inc.h"
#include "dos_system.h"
#include "shell.h" /* for DOS_Shell */
bool WildFileCmp(const char * file, const char * wild);
void Set_Label(char const * const input, char * const output, bool cdrom);
@ -75,9 +76,6 @@ public:
const char* getBasedir() {return basedir;};
protected:
char basedir[CROSS_LEN];
private:
friend void DOS_Shell::CMD_SUBST(char* args);
protected:
struct {
char srch_dir[CROSS_LEN];
} srchInfo[MAX_OPENDIRS];
@ -197,18 +195,6 @@ private:
bool addDirectoryEntry(Bit32u dirClustNumber, direntry useEntry);
void zeroOutCluster(Bit32u clustNumber);
bool getEntryName(char *fullname, char *entname);
friend void DOS_Shell::CMD_SUBST(char* args);
struct {
char srch_dir[CROSS_LEN];
} srchInfo[MAX_OPENDIRS];
struct {
Bit16u bytes_sector;
Bit8u sectors_cluster;
Bit16u total_clusters;
Bit16u free_clusters;
Bit8u mediaid;
} allocation;
bootstrap bootbuffer;
bool absolute;
@ -219,13 +205,11 @@ private:
Bit32u firstRootDirSect;
Bit32u cwdDirCluster;
Bit32u dirPosition; /* Position in directory search */
Bit8u fatSectBuffer[1024];
Bit32u curFatSect;
};
class cdromDrive : public localDrive
{
public:

View file

@ -1275,7 +1275,7 @@ void DOS_Shell::CMD_SUBST (char * args) {
if( ( ldp=dynamic_cast<localDrive*>(Drives[drive])) == 0 ) throw 0;
char newname[CROSS_LEN];
strcpy(newname, ldp->basedir);
strcpy(newname, ldp->getBasedir());
strcat(newname,fulldir);
CROSS_FILENAME(newname);
ldp->dirCache.ExpandName(newname);