Fix unsafe memory operations and warnings in the fatDrive class
- Move imageDiskList from pointer to vector of unique_ptr - Replace string operations with size-limited versions - Initialize members - Eliminate unecessary casts - Eliminate memory-leak on pointer assignment
This commit is contained in:
parent
e942a02fcb
commit
c9198b2944
11 changed files with 219 additions and 131 deletions
|
@ -85,7 +85,7 @@ static INLINE void host_writed(HostPt off,Bit32u val) {
|
|||
#else
|
||||
|
||||
static INLINE Bit8u host_readb(HostPt off) {
|
||||
return *(Bit8u *)off;
|
||||
return *off;
|
||||
}
|
||||
static INLINE Bit16u host_readw(HostPt off) {
|
||||
return *(Bit16u *)off;
|
||||
|
@ -94,7 +94,7 @@ static INLINE Bit32u host_readd(HostPt off) {
|
|||
return *(Bit32u *)off;
|
||||
}
|
||||
static INLINE void host_writeb(HostPt off,Bit8u val) {
|
||||
*(Bit8u *)(off)=val;
|
||||
*off = val;
|
||||
}
|
||||
static INLINE void host_writew(HostPt off,Bit16u val) {
|
||||
*(Bit16u *)(off)=val;
|
||||
|
@ -107,7 +107,7 @@ static INLINE void host_writed(HostPt off,Bit32u val) {
|
|||
|
||||
|
||||
static INLINE void var_write(Bit8u * var, Bit8u val) {
|
||||
host_writeb((HostPt)var, val);
|
||||
host_writeb(var, val);
|
||||
}
|
||||
|
||||
static INLINE void var_write(Bit16u * var, Bit16u val) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue