mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-10 18:29:44 +00:00
- size of ExtFS finf helper file extended to 32 bytes to allow future expansion
(the complete FInfo/FXInfo could be stored in it) - main_unix.cpp: replaced TIMER_RELTIME (which doesn't seem to exist on Irix) by 0
This commit is contained in:
parent
78ff964fc9
commit
f0e931daed
@ -84,7 +84,7 @@ struct finf_struct {
|
|||||||
uint32 type;
|
uint32 type;
|
||||||
uint32 creator;
|
uint32 creator;
|
||||||
uint16 flags;
|
uint16 flags;
|
||||||
uint16 pad0;
|
uint8 pad0[22]; // total size: 32 bytes to match the size of FInfo+FXInfo
|
||||||
};
|
};
|
||||||
|
|
||||||
static void make_helper_path(const char *src, char *dest, const char *add, bool only_dir = false)
|
static void make_helper_path(const char *src, char *dest, const char *add, bool only_dir = false)
|
||||||
@ -221,7 +221,7 @@ void get_finder_type(const char *path, uint32 &type, uint32 &creator)
|
|||||||
|
|
||||||
// Read file
|
// Read file
|
||||||
finf_struct finf;
|
finf_struct finf;
|
||||||
if (read(fd, &finf, sizeof(finf_struct)) == sizeof(finf_struct)) {
|
if (read(fd, &finf, sizeof(finf_struct)) >= 8) {
|
||||||
|
|
||||||
// Type/creator are in Finder info file, return them
|
// Type/creator are in Finder info file, return them
|
||||||
type = ntohl(finf.type);
|
type = ntohl(finf.type);
|
||||||
@ -254,7 +254,9 @@ void set_finder_type(const char *path, uint32 type, uint32 creator)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Read file
|
// Read file
|
||||||
finf_struct finf = {0, 0, DEFAULT_FINDER_FLAGS, 0};
|
finf_struct finf;
|
||||||
|
finf.flags = DEFAULT_FINDER_FLAGS;
|
||||||
|
memset(&finf, 0, sizeof(finf_struct));
|
||||||
read(fd, &finf, sizeof(finf_struct));
|
read(fd, &finf, sizeof(finf_struct));
|
||||||
|
|
||||||
// Set Finder flags
|
// Set Finder flags
|
||||||
@ -283,7 +285,7 @@ void get_finder_flags(const char *path, uint16 &flags)
|
|||||||
|
|
||||||
// Read Finder flags
|
// Read Finder flags
|
||||||
finf_struct finf;
|
finf_struct finf;
|
||||||
if (read(fd, &finf, sizeof(finf_struct)) == sizeof(finf_struct))
|
if (read(fd, &finf, sizeof(finf_struct)) >= 10)
|
||||||
flags = ntohs(finf.flags);
|
flags = ntohs(finf.flags);
|
||||||
|
|
||||||
// Close file
|
// Close file
|
||||||
@ -298,7 +300,9 @@ void set_finder_flags(const char *path, uint16 flags)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Read file
|
// Read file
|
||||||
finf_struct finf = {0, 0, DEFAULT_FINDER_FLAGS, 0};
|
finf_struct finf;
|
||||||
|
memset(&finf, 0, sizeof(finf_struct));
|
||||||
|
finf.flags = DEFAULT_FINDER_FLAGS;
|
||||||
read(fd, &finf, sizeof(finf_struct));
|
read(fd, &finf, sizeof(finf_struct));
|
||||||
|
|
||||||
// Set Finder flags
|
// Set Finder flags
|
||||||
|
@ -85,7 +85,7 @@ struct finf_struct {
|
|||||||
uint32 type;
|
uint32 type;
|
||||||
uint32 creator;
|
uint32 creator;
|
||||||
uint16 flags;
|
uint16 flags;
|
||||||
uint16 pad0;
|
uint8 pad0[22]; // total size: 32 bytes to match the size of FInfo+FXInfo
|
||||||
};
|
};
|
||||||
|
|
||||||
static void make_helper_path(const char *src, char *dest, const char *add, bool only_dir = false)
|
static void make_helper_path(const char *src, char *dest, const char *add, bool only_dir = false)
|
||||||
@ -226,7 +226,7 @@ void get_finder_type(const char *path, uint32 &type, uint32 &creator)
|
|||||||
|
|
||||||
// Read file
|
// Read file
|
||||||
finf_struct finf;
|
finf_struct finf;
|
||||||
if (read(fd, &finf, sizeof(finf_struct)) == sizeof(finf_struct)) {
|
if (read(fd, &finf, sizeof(finf_struct)) >= 8) {
|
||||||
|
|
||||||
// Type/creator are in Finder info file, return them
|
// Type/creator are in Finder info file, return them
|
||||||
type = ntohl(finf.type);
|
type = ntohl(finf.type);
|
||||||
@ -259,7 +259,9 @@ void set_finder_type(const char *path, uint32 type, uint32 creator)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Read file
|
// Read file
|
||||||
finf_struct finf = {0, 0, DEFAULT_FINDER_FLAGS, 0};
|
finf_struct finf;
|
||||||
|
finf.flags = DEFAULT_FINDER_FLAGS;
|
||||||
|
memset(&finf, 0, sizeof(finf_struct));
|
||||||
read(fd, &finf, sizeof(finf_struct));
|
read(fd, &finf, sizeof(finf_struct));
|
||||||
|
|
||||||
// Set Finder flags
|
// Set Finder flags
|
||||||
@ -288,7 +290,7 @@ void get_finder_flags(const char *path, uint16 &flags)
|
|||||||
|
|
||||||
// Read Finder flags
|
// Read Finder flags
|
||||||
finf_struct finf;
|
finf_struct finf;
|
||||||
if (read(fd, &finf, sizeof(finf_struct)) == sizeof(finf_struct))
|
if (read(fd, &finf, sizeof(finf_struct)) >= 10)
|
||||||
flags = ntohs(finf.flags);
|
flags = ntohs(finf.flags);
|
||||||
|
|
||||||
// Close file
|
// Close file
|
||||||
@ -303,7 +305,9 @@ void set_finder_flags(const char *path, uint16 flags)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Read file
|
// Read file
|
||||||
finf_struct finf = {0, 0, DEFAULT_FINDER_FLAGS, 0};
|
finf_struct finf;
|
||||||
|
memset(&finf, 0, sizeof(finf_struct));
|
||||||
|
finf.flags = DEFAULT_FINDER_FLAGS;
|
||||||
read(fd, &finf, sizeof(finf_struct));
|
read(fd, &finf, sizeof(finf_struct));
|
||||||
|
|
||||||
// Set Finder flags
|
// Set Finder flags
|
||||||
|
@ -268,7 +268,7 @@ int main(int argc, char **argv)
|
|||||||
req.it_value.tv_nsec = 16625000;
|
req.it_value.tv_nsec = 16625000;
|
||||||
req.it_interval.tv_sec = 0;
|
req.it_interval.tv_sec = 0;
|
||||||
req.it_interval.tv_nsec = 16625000;
|
req.it_interval.tv_nsec = 16625000;
|
||||||
if (timer_settime(timer, TIMER_RELTIME, &req, NULL) < 0) {
|
if (timer_settime(timer, 0, &req, NULL) < 0) {
|
||||||
printf("FATAL: cannot start timer\n");
|
printf("FATAL: cannot start timer\n");
|
||||||
QuitEmulator();
|
QuitEmulator();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user