size_t _len, uint8_t *_data,
Arch _arch, OpSys _opSys)
: filename(_filename), descriptor(_fd), fileData(_data), len(_len),
- arch(_arch), opSys(_opSys), globalPtr(0)
+ arch(_arch), opSys(_opSys), entry(0), globalPtr(0),
+ text{0, nullptr, 0}, data{0, nullptr, 0}, bss{0, nullptr, 0}
{
}
}
// find the length of the file by seeking to the end
- size_t len = (size_t)lseek(fd, 0, SEEK_END);
+ off_t off = lseek(fd, 0, SEEK_END);
+ fatal_if(off < 0, "Failed to determine size of object file %s\n", fname);
+ size_t len = static_cast<size_t>(off);
// mmap the whole shebang
uint8_t *fileData =
/** The number of buckets. Equal to (max-min)/bucket_size. */
size_type buckets;
- Params() : DistParams(Dist) {}
+ Params() : DistParams(Dist), min(0), max(0), bucket_size(0),
+ buckets(0) {}
};
private:
panic("%s: cannot accept a connection if not listening!", name());
int fd = listener.accept(true);
+ fatal_if(fd < 0, "%s: failed to accept VNC connection!", name());
+
if (dataFd != -1) {
char message[] = "vnc server already attached!\n";
atomic_write(fd, message, sizeof(message));
assert(fbPtr);
uint8_t *tmp = vc->convert(fbPtr);
- write(tmp, videoWidth() * videoHeight() * sizeof(uint32_t));
+ uint64_t num_pixels = videoWidth() * videoHeight();
+ write(tmp, num_pixels * sizeof(uint32_t));
delete [] tmp;
}
typedef SimObjectParams Params;
const Params *params() const { return _params; }
SimObject(const Params *_params);
- virtual ~SimObject() {}
+ virtual ~SimObject();
public: