mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Replace Maxsi::String::Compare with strcmp.
This commit is contained in:
parent
70da61f5d1
commit
e5cf6c18f7
9 changed files with 25 additions and 24 deletions
|
@ -1103,7 +1103,7 @@ extern "C" bool ReadParamString(const char* str, ...)
|
|||
while ( (keyname = va_arg(args, const char*)) )
|
||||
{
|
||||
char** nameptr = va_arg(args, char**);
|
||||
if ( String::Compare(keyname, name) ) { continue; }
|
||||
if ( strcmp(keyname, name) ) { continue; }
|
||||
*nameptr = value;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <libmaxsi/platform.h>
|
||||
#include <libmaxsi/string.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <readparamstring.h>
|
||||
|
||||
using namespace Maxsi;
|
||||
|
@ -51,7 +52,7 @@ extern "C" bool ReadParamString(const char* str, ...)
|
|||
while ( (keyname = va_arg(args, const char*)) )
|
||||
{
|
||||
char** nameptr = va_arg(args, char**);
|
||||
if ( String::Compare(keyname, name) ) { continue; }
|
||||
if ( strcmp(keyname, name) ) { continue; }
|
||||
*nameptr = value;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ namespace Sortix
|
|||
{
|
||||
for ( size_t i = 0; i < entriesused; i++ )
|
||||
{
|
||||
if ( String::Compare(name, deventries[i].name) ) { continue; }
|
||||
if ( strcmp(name, deventries[i].name) ) { continue; }
|
||||
deventries[i].dev->Refer();
|
||||
return deventries[i].dev;
|
||||
}
|
||||
|
@ -360,10 +360,10 @@ namespace Sortix
|
|||
return new DevDevFSDir();
|
||||
}
|
||||
|
||||
if ( String::Compare(path, "/null") == 0 ) { return new DevNull; }
|
||||
if ( String::Compare(path, "/tty") == 0 ) { tty->Refer(); return tty; }
|
||||
if ( String::Compare(path, "/vga") == 0 ) { return new DevVGA; }
|
||||
if ( String::Compare(path, "/video") == 0 ||
|
||||
if ( strcmp(path, "/null") == 0 ) { return new DevNull; }
|
||||
if ( strcmp(path, "/tty") == 0 ) { tty->Refer(); return tty; }
|
||||
if ( strcmp(path, "/vga") == 0 ) { return new DevVGA; }
|
||||
if ( strcmp(path, "/video") == 0 ||
|
||||
String::StartsWith(path, "/video/") )
|
||||
{
|
||||
return DeviceFS::videofs->Open(path + strlen("/video"), flags, mode);
|
||||
|
@ -387,7 +387,7 @@ namespace Sortix
|
|||
|
||||
bool DevDevFS::Unlink(const char* path)
|
||||
{
|
||||
if ( String::Compare(path, "/video") == 0 ||
|
||||
if ( strcmp(path, "/video") == 0 ||
|
||||
String::StartsWith(path, "/video/") )
|
||||
{
|
||||
return DeviceFS::videofs->Unlink(path);
|
||||
|
|
|
@ -235,12 +235,12 @@ namespace Sortix
|
|||
|
||||
int CompareFiles(DevRAMFSFile* file1, DevRAMFSFile* file2)
|
||||
{
|
||||
return String::Compare(file1->name, file2->name);
|
||||
return strcmp(file1->name, file2->name);
|
||||
}
|
||||
|
||||
int LookupFile(DevRAMFSFile* file, const char* name)
|
||||
{
|
||||
return String::Compare(file->name, name);
|
||||
return strcmp(file->name, name);
|
||||
}
|
||||
|
||||
Device* DevRAMFS::Open(const char* path, int flags, mode_t mode)
|
||||
|
|
|
@ -295,7 +295,7 @@ DevVideoFS::~DevVideoFS()
|
|||
|
||||
Device* DevVideoFS::Open(const char* path, int flags, mode_t mode)
|
||||
{
|
||||
if ( !String::Compare(path, "") || !String::Compare(path, "/") )
|
||||
if ( !strcmp(path, "") || !strcmp(path, "/") )
|
||||
{
|
||||
if ( (flags & O_LOWERFLAGS) == O_SEARCH ) { return new DevVideoFSDir; }
|
||||
errno = EISDIR;
|
||||
|
@ -306,7 +306,7 @@ Device* DevVideoFS::Open(const char* path, int flags, mode_t mode)
|
|||
|
||||
for ( size_t i = 0; i < NumNodes(); i++ )
|
||||
{
|
||||
if ( String::Compare(path, nodes[i].name) ) { continue; }
|
||||
if ( strcmp(path, nodes[i].name) ) { continue; }
|
||||
return nodes[i].factory(flags, mode);
|
||||
}
|
||||
errno = ENOENT;
|
||||
|
|
|
@ -119,7 +119,7 @@ uint32_t Traverse(uint32_t ino, const char* name)
|
|||
{
|
||||
uint32_t pos = inode->dataoffset + offset;
|
||||
const initrd_dirent* dirent = (const initrd_dirent*) (initrd + pos);
|
||||
if ( dirent->namelen && !String::Compare(dirent->name, name) )
|
||||
if ( dirent->namelen && !strcmp(dirent->name, name) )
|
||||
{
|
||||
return dirent->inode;
|
||||
}
|
||||
|
@ -222,12 +222,12 @@ void Init(addr_t phys, size_t size)
|
|||
"has been passed to the kernel.");
|
||||
}
|
||||
|
||||
if ( String::Compare(sb->magic, "sortix-initrd-1") == 0 )
|
||||
if ( strcmp(sb->magic, "sortix-initrd-1") == 0 )
|
||||
{
|
||||
Panic("Sortix initrd format version 1 is no longer supported.");
|
||||
}
|
||||
|
||||
if ( String::Compare(sb->magic, "sortix-initrd-2") != 0 )
|
||||
if ( strcmp(sb->magic, "sortix-initrd-2") != 0 )
|
||||
{
|
||||
Panic("The initrd has a format that isn't supported. Perhaps it is "
|
||||
"too new? Try downgrade or regenerate the initrd.");
|
||||
|
|
|
@ -39,10 +39,10 @@ namespace Info {
|
|||
|
||||
const char* KernelInfo(const char* req)
|
||||
{
|
||||
if ( String::Compare(req, "name") == 0 ) { return "Sortix"; }
|
||||
if ( String::Compare(req, "version") == 0 ) { return VERSIONSTR; }
|
||||
if ( String::Compare(req, "builddate") == 0 ) { return __DATE__; }
|
||||
if ( String::Compare(req, "buildtime") == 0 ) { return __TIME__; }
|
||||
if ( strcmp(req, "name") == 0 ) { return "Sortix"; }
|
||||
if ( strcmp(req, "version") == 0 ) { return VERSIONSTR; }
|
||||
if ( strcmp(req, "builddate") == 0 ) { return __DATE__; }
|
||||
if ( strcmp(req, "buildtime") == 0 ) { return __TIME__; }
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ namespace Sortix
|
|||
|
||||
if ( !root ) { root = mp; return true; }
|
||||
|
||||
if ( String::Compare(path, root->path) < 0 )
|
||||
if ( strcmp(path, root->path) < 0 )
|
||||
{
|
||||
mp->next = root;
|
||||
root->prev = mp;
|
||||
|
@ -115,7 +115,7 @@ namespace Sortix
|
|||
|
||||
for ( MountPoint* tmp = root; tmp; tmp = tmp->next )
|
||||
{
|
||||
if ( tmp->next == NULL || String::Compare(path, tmp->next->path) < 0 )
|
||||
if ( tmp->next == NULL || strcmp(path, tmp->next->path) < 0 )
|
||||
{
|
||||
mp->next = tmp->next;
|
||||
tmp->next = mp;
|
||||
|
|
|
@ -56,10 +56,10 @@ bool ReadParamString(const char* str, ...)
|
|||
va_start(args, str);
|
||||
while ( (keyname = va_arg(args, const char*)) )
|
||||
{
|
||||
if ( String::Compare(keyname, "STOP") == 0 )
|
||||
if ( strcmp(keyname, "STOP") == 0 )
|
||||
break;
|
||||
char** nameptr = va_arg(args, char**);
|
||||
if ( String::Compare(keyname, name) ) { continue; }
|
||||
if ( strcmp(keyname, name) ) { continue; }
|
||||
*nameptr = value;
|
||||
break;
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ static DriverEntry* GetDriverEntry(const char* drivername)
|
|||
{
|
||||
for ( size_t i = 0; i < numdrivers; i++ )
|
||||
{
|
||||
if ( !String::Compare(drivername, drivers[i].name) )
|
||||
if ( !strcmp(drivername, drivers[i].name) )
|
||||
{
|
||||
return drivers + i;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue