mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-23 06:30:04 +00:00
Fixed data types
This commit is contained in:
parent
d85af02c50
commit
f29626e58f
@ -1116,6 +1116,8 @@ int startrascsi(void)
|
|||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
#endif // BAREMETAL
|
#endif // BAREMETAL
|
||||||
|
GOOGLE_PROTOBUF_VERIFY_VERSION;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
int actid;
|
int actid;
|
||||||
DWORD now;
|
DWORD now;
|
||||||
|
@ -82,6 +82,8 @@ BOOL SendCommand(const char *hostname, const Command& command)
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
GOOGLE_PROTOBUF_VERIFY_VERSION;
|
||||||
|
|
||||||
// Display help
|
// Display help
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
cerr << "SCSI Target Emulator RaSCSI Controller" << endl;
|
cerr << "SCSI Target Emulator RaSCSI Controller" << endl;
|
||||||
|
@ -25,7 +25,7 @@ using namespace std;
|
|||||||
void SerializeProtobufData(int fd, const string& data)
|
void SerializeProtobufData(int fd, const string& data)
|
||||||
{
|
{
|
||||||
// Write the size of the protobuf data as a header
|
// Write the size of the protobuf data as a header
|
||||||
ssize_t size = data.length();
|
int32_t size = data.length();
|
||||||
if (write(fd, &size, sizeof(size)) != sizeof(size)) {
|
if (write(fd, &size, sizeof(size)) != sizeof(size)) {
|
||||||
throw ioexception("Cannot write protobuf header");
|
throw ioexception("Cannot write protobuf header");
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ void SerializeProtobufData(int fd, const string& data)
|
|||||||
string DeserializeProtobufData(int fd)
|
string DeserializeProtobufData(int fd)
|
||||||
{
|
{
|
||||||
// First read the header with the size of the protobuf data
|
// First read the header with the size of the protobuf data
|
||||||
size_t size;
|
int32_t size;
|
||||||
if (read(fd, &size, sizeof(int)) != sizeof(int)) {
|
if (read(fd, &size, sizeof(int)) != sizeof(int)) {
|
||||||
// No more data
|
// No more data
|
||||||
return "";
|
return "";
|
||||||
|
Loading…
Reference in New Issue
Block a user