The "keymap" command can now be compiled on Zeta as well - for some stupid reason
it introduces a find_directory_r() instead of making the original call thread-safe. Maybe we should only support this operation on Haiku, anyway. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14597 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -294,7 +294,7 @@ Keymap::Load(entry_ref &ref)
|
|||||||
void
|
void
|
||||||
Keymap::ComputeChars(const char *buffer, struct re_registers ®s, int i, int &offset)
|
Keymap::ComputeChars(const char *buffer, struct re_registers ®s, int i, int &offset)
|
||||||
{
|
{
|
||||||
char *current = &fChars[offset+1];
|
char *current = &fChars[offset + 1];
|
||||||
char hexChars[12];
|
char hexChars[12];
|
||||||
uint32 length = 0;
|
uint32 length = 0;
|
||||||
if (strncmp(buffer + regs.start[i], "''", regs.end[i] - regs.start[i]) == 0)
|
if (strncmp(buffer + regs.start[i], "''", regs.end[i] - regs.start[i]) == 0)
|
||||||
@@ -307,8 +307,8 @@ Keymap::ComputeChars(const char *buffer, struct re_registers ®s, int i, int &
|
|||||||
length = 1;
|
length = 1;
|
||||||
} else if (sscanf(buffer + regs.start[i], "0x%s", hexChars) > 0) {
|
} else if (sscanf(buffer + regs.start[i], "0x%s", hexChars) > 0) {
|
||||||
length = strlen(hexChars) / 2;
|
length = strlen(hexChars) / 2;
|
||||||
for (uint32 j=0; j<length; j++)
|
for (uint32 j = 0; j < length; j++)
|
||||||
sscanf(hexChars + 2*j, "%02x", (uint8*)current + j);
|
sscanf(hexChars + 2*j, "%02hhx", current + j);
|
||||||
}
|
}
|
||||||
fChars[offset] = length;
|
fChars[offset] = length;
|
||||||
offset += length + 1;
|
offset += length + 1;
|
||||||
@@ -1086,8 +1086,11 @@ status_t _restore_key_map_();
|
|||||||
void
|
void
|
||||||
Keymap::RestoreSystemDefault()
|
Keymap::RestoreSystemDefault()
|
||||||
{
|
{
|
||||||
#ifdef __BEOS__
|
#ifdef __BEOS__
|
||||||
|
// work-around to get rid of this stupid find_directory_r() on Zeta
|
||||||
|
# ifdef find_directory
|
||||||
|
# undef find_directory
|
||||||
|
# endif
|
||||||
BPath path;
|
BPath path;
|
||||||
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path)!=B_OK)
|
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path)!=B_OK)
|
||||||
return;
|
return;
|
||||||
@@ -1098,11 +1101,10 @@ Keymap::RestoreSystemDefault()
|
|||||||
ref.Remove();
|
ref.Remove();
|
||||||
|
|
||||||
_restore_key_map_();
|
_restore_key_map_();
|
||||||
|
#else // ! __BEOS__
|
||||||
#else // ! __BEOS__
|
|
||||||
fprintf(stderr, "Unsupported operation on this platform!\n");
|
fprintf(stderr, "Unsupported operation on this platform!\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
#endif // ! __BEOS__
|
#endif // ! __BEOS__
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user