mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Renamed print functions
This commit is contained in:
parent
9a59137064
commit
7fd6532345
@ -30,7 +30,7 @@ namespace Disk
|
||||
for (unsigned char ItrPort = 0; ItrPort < this->AvailablePorts; ItrPort++)
|
||||
{
|
||||
Drive *drive = new Drive;
|
||||
sprintf_(drive->Name, "sd%ld-%d", DriverUID, this->AvailablePorts);
|
||||
sprintf(drive->Name, "sd%ld-%d", DriverUID, this->AvailablePorts);
|
||||
debug("Drive Name: %s", drive->Name);
|
||||
// TODO: Implement disk type detection. Very useful in the future.
|
||||
drive->MechanicalDisk = true;
|
||||
@ -98,7 +98,7 @@ namespace Disk
|
||||
drive->Partitions.push_back(partition);
|
||||
|
||||
char *PartitionName = new char[64];
|
||||
sprintf_(PartitionName, "sd%ldp%ld", drives.size() - 1, partition->Index);
|
||||
sprintf(PartitionName, "sd%ldp%ld", drives.size() - 1, partition->Index);
|
||||
|
||||
/*
|
||||
----> Add to devfs the disk
|
||||
@ -128,7 +128,7 @@ namespace Disk
|
||||
drive->Partitions.push_back(partition);
|
||||
|
||||
char *PartitionName = new char[64];
|
||||
sprintf_(PartitionName, "sd%ldp%ld", drives.size() - 1, partition->Index);
|
||||
sprintf(PartitionName, "sd%ldp%ld", drives.size() - 1, partition->Index);
|
||||
|
||||
/*
|
||||
----> Add to devfs the disk
|
||||
|
@ -57,7 +57,7 @@ namespace GraphicalUserInterface
|
||||
if (!this->Maximized)
|
||||
{
|
||||
char buf[256];
|
||||
sprintf_(buf, "Left:\eAA11FF%ld\eFFFFFF Top:\eAA11FF%ld\eFFFFFF W:\eAA11FF%ld\eFFFFFF H:\eAA11FF%ld\eFFFFFF", this->Position.Left, this->Position.Top, this->Position.Width, this->Position.Height);
|
||||
sprintf(buf, "Left:\eAA11FF%ld\eFFFFFF Top:\eAA11FF%ld\eFFFFFF W:\eAA11FF%ld\eFFFFFF H:\eAA11FF%ld\eFFFFFF", this->Position.Left, this->Position.Top, this->Position.Width, this->Position.Height);
|
||||
// Display->DrawString(buf, this->Position.Left + 20, this->Position.Top + 25, 200);
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ EXTERNC void fprintf(FILE *stream, const char *Format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, Format);
|
||||
vprintf_(Format, args);
|
||||
vprintf(Format, args);
|
||||
va_end(args);
|
||||
UNUSED(stream);
|
||||
}
|
||||
@ -19,7 +19,7 @@ EXTERNC void fprintf(FILE *stream, const char *Format, ...)
|
||||
// TODO: Implement proper fputs
|
||||
EXTERNC void fputs(const char *s, FILE *stream)
|
||||
{
|
||||
printf_("%s", s);
|
||||
printf("%s", s);
|
||||
UNUSED(stream);
|
||||
}
|
||||
|
||||
|
@ -108,10 +108,10 @@ EXTERNC void KPrint(const char *Format, ...)
|
||||
{
|
||||
SmartLock(KernelLock);
|
||||
Time::Clock tm = Time::ReadClock();
|
||||
printf_("\eCCCCCC[\e00AEFF%02ld:%02ld:%02ld\eCCCCCC] ", tm.Hour, tm.Minute, tm.Second);
|
||||
printf("\eCCCCCC[\e00AEFF%02ld:%02ld:%02ld\eCCCCCC] ", tm.Hour, tm.Minute, tm.Second);
|
||||
va_list args;
|
||||
va_start(args, Format);
|
||||
vprintf_(Format, args);
|
||||
vprintf(Format, args);
|
||||
va_end(args);
|
||||
putchar('\n');
|
||||
Display->SetBuffer(0);
|
||||
@ -124,7 +124,7 @@ EXTERNC __no_instrument_function void Main(BootInfo *Info)
|
||||
memcpy(bInfo, Info, sizeof(BootInfo));
|
||||
debug("BootInfo structure is at %p", bInfo);
|
||||
Display = new Video::Display(bInfo->Framebuffer[0]);
|
||||
printf_("\eFFFFFF%s - %s [\e058C19%s\eFFFFFF]\n", KERNEL_NAME, KERNEL_VERSION, GIT_COMMIT_SHORT);
|
||||
printf("\eFFFFFF%s - %s [\e058C19%s\eFFFFFF]\n", KERNEL_NAME, KERNEL_VERSION, GIT_COMMIT_SHORT);
|
||||
/**************************************************************************************/
|
||||
KPrint("Time: \e8888FF%02d:%02d:%02d %02d/%02d/%02d UTC",
|
||||
BootClock.Hour, BootClock.Minute, BootClock.Second,
|
||||
|
@ -16,13 +16,13 @@ static inline void print_wrapper(char c, void *unused)
|
||||
UNUSED(unused);
|
||||
}
|
||||
|
||||
int vprintf(const char *format, va_list list) { return vfctprintf(print_wrapper, NULL, format, list); }
|
||||
int vprintf_dumper(const char *format, va_list list) { return vfctprintf(print_wrapper, NULL, format, list); }
|
||||
|
||||
void WriteRaw(const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vprintf(format, args);
|
||||
vprintf_dumper(format, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
@ -54,12 +54,12 @@
|
||||
#endif // __cplusplus
|
||||
|
||||
#if PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
|
||||
#define printf_ printf
|
||||
#define sprintf_ sprintf
|
||||
#define vsprintf_ vsprintf
|
||||
#define printf printf
|
||||
#define sprintf sprintf
|
||||
#define vsprintf vsprintf
|
||||
#define snprintf_ snprintf
|
||||
#define vsnprintf_ vsnprintf
|
||||
#define vprintf_ vprintf
|
||||
#define vsnprintf vsnprintf
|
||||
#define vprintf vprintf
|
||||
#endif
|
||||
|
||||
// 'ntoa' conversion buffer size, this must be big enough to hold one converted
|
||||
@ -1528,21 +1528,21 @@ static __no_instrument_function int vsnprintf_impl(output_gadget_t *output, cons
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__no_instrument_function int vprintf_(const char *format, va_list arg)
|
||||
__no_instrument_function int vprintf(const char *format, va_list arg)
|
||||
{
|
||||
output_gadget_t gadget = extern_putchar_gadget();
|
||||
return vsnprintf_impl(&gadget, format, arg);
|
||||
}
|
||||
|
||||
__no_instrument_function int vsnprintf_(char *s, size_t n, const char *format, va_list arg)
|
||||
__no_instrument_function int vsnprintf(char *s, size_t n, const char *format, va_list arg)
|
||||
{
|
||||
output_gadget_t gadget = buffer_gadget(s, n);
|
||||
return vsnprintf_impl(&gadget, format, arg);
|
||||
}
|
||||
|
||||
__no_instrument_function int vsprintf_(char *s, const char *format, va_list arg)
|
||||
__no_instrument_function int vsprintf(char *s, const char *format, va_list arg)
|
||||
{
|
||||
return vsnprintf_(s, PRINTF_MAX_POSSIBLE_BUFFER_SIZE, format, arg);
|
||||
return vsnprintf(s, PRINTF_MAX_POSSIBLE_BUFFER_SIZE, format, arg);
|
||||
}
|
||||
|
||||
__no_instrument_function int vfctprintf(void (*out)(char c, void *extra_arg), void *extra_arg, const char *format, va_list arg)
|
||||
@ -1551,20 +1551,20 @@ __no_instrument_function int vfctprintf(void (*out)(char c, void *extra_arg), vo
|
||||
return vsnprintf_impl(&gadget, format, arg);
|
||||
}
|
||||
|
||||
__no_instrument_function int printf_(const char *format, ...)
|
||||
__no_instrument_function int printf(const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
const int ret = vprintf_(format, args);
|
||||
const int ret = vprintf(format, args);
|
||||
va_end(args);
|
||||
return ret;
|
||||
}
|
||||
|
||||
__no_instrument_function int sprintf_(char *s, const char *format, ...)
|
||||
__no_instrument_function int sprintf(char *s, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
const int ret = vsprintf_(s, format, args);
|
||||
const int ret = vsprintf(s, format, args);
|
||||
va_end(args);
|
||||
return ret;
|
||||
}
|
||||
@ -1573,7 +1573,7 @@ __no_instrument_function int snprintf_(char *s, size_t n, const char *format, ..
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
const int ret = vsnprintf_(s, n, format, args);
|
||||
const int ret = vsnprintf(s, n, format, args);
|
||||
va_end(args);
|
||||
return ret;
|
||||
}
|
||||
|
@ -596,16 +596,16 @@ namespace Tasking
|
||||
foreach (auto var in ListProcess)
|
||||
{
|
||||
int Status = var->Status;
|
||||
printf_("\e%s-> \eAABBCC%s\eCCCCCC[%d] \e00AAAA%s\n",
|
||||
printf("\e%s-> \eAABBCC%s\eCCCCCC[%d] \e00AAAA%s\n",
|
||||
Statuses[Status], var->Name, Status, StatusesSign[Status]);
|
||||
foreach (auto var2 in var->Threads)
|
||||
{
|
||||
Status = var2->Status;
|
||||
printf_(" \e%s-> \eAABBCC%s\eCCCCCC[%d] \e00AAAA%s\n\eAABBCC",
|
||||
printf(" \e%s-> \eAABBCC%s\eCCCCCC[%d] \e00AAAA%s\n\eAABBCC",
|
||||
Statuses[Status], var2->Name, Status, StatusesSign[Status]);
|
||||
}
|
||||
}
|
||||
printf_("%d - SOURCE: %s", sanity++, SuccessSourceStrings[SuccessSource]);
|
||||
printf("%d - SOURCE: %s", sanity++, SuccessSourceStrings[SuccessSource]);
|
||||
if (sanity > 1000)
|
||||
sanity = 0;
|
||||
Display->SetBufferCursor(0, tmpX, tmpY);
|
||||
@ -1278,7 +1278,7 @@ namespace Tasking
|
||||
Vector<AuxiliaryVector> auxv;
|
||||
IdleThread = CreateThread(IdleProcess, reinterpret_cast<uintptr_t>(IdleProcessLoop), nullptr, nullptr, auxv);
|
||||
char IdleName[16];
|
||||
sprintf_(IdleName, "Idle Thread %d", i);
|
||||
sprintf(IdleName, "Idle Thread %d", i);
|
||||
IdleThread->Rename(IdleName);
|
||||
IdleThread->SetPriority(1);
|
||||
break;
|
||||
|
@ -60,12 +60,12 @@ extern "C"
|
||||
#endif
|
||||
|
||||
#if PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
|
||||
#define printf_ printf
|
||||
#define sprintf_ sprintf
|
||||
#define vsprintf_ vsprintf
|
||||
#define printf printf
|
||||
#define sprintf sprintf
|
||||
#define vsprintf vsprintf
|
||||
#define snprintf_ snprintf
|
||||
#define vsnprintf_ vsnprintf
|
||||
#define vprintf_ vprintf
|
||||
#define vsnprintf vsnprintf
|
||||
#define vprintf vprintf
|
||||
#endif
|
||||
|
||||
// If you want to include this implementation file directly rather than
|
||||
@ -112,9 +112,9 @@ extern "C"
|
||||
*/
|
||||
///@{
|
||||
PRINTF_VISIBILITY
|
||||
int printf_(const char *format, ...) ATTR_PRINTF(1, 2);
|
||||
int printf(const char *format, ...) ATTR_PRINTF(1, 2);
|
||||
PRINTF_VISIBILITY
|
||||
int vprintf_(const char *format, va_list arg) ATTR_VPRINTF(1);
|
||||
int vprintf(const char *format, va_list arg) ATTR_VPRINTF(1);
|
||||
///@}
|
||||
|
||||
/**
|
||||
@ -132,9 +132,9 @@ extern "C"
|
||||
*/
|
||||
///@{
|
||||
PRINTF_VISIBILITY
|
||||
int sprintf_(char *s, const char *format, ...) ATTR_PRINTF(2, 3);
|
||||
int sprintf(char *s, const char *format, ...) ATTR_PRINTF(2, 3);
|
||||
PRINTF_VISIBILITY
|
||||
int vsprintf_(char *s, const char *format, va_list arg) ATTR_VPRINTF(2);
|
||||
int vsprintf(char *s, const char *format, va_list arg) ATTR_VPRINTF(2);
|
||||
///@}
|
||||
|
||||
/**
|
||||
@ -156,13 +156,13 @@ extern "C"
|
||||
PRINTF_VISIBILITY
|
||||
int snprintf_(char *s, size_t count, const char *format, ...) ATTR_PRINTF(3, 4);
|
||||
PRINTF_VISIBILITY
|
||||
int vsnprintf_(char *s, size_t count, const char *format, va_list arg) ATTR_VPRINTF(3);
|
||||
int vsnprintf(char *s, size_t count, const char *format, va_list arg) ATTR_VPRINTF(3);
|
||||
///@}
|
||||
|
||||
/**
|
||||
* printf/vprintf with user-specified output function
|
||||
*
|
||||
* An alternative to @ref printf_, in which the output function is specified dynamically
|
||||
* An alternative to @ref printf, in which the output function is specified dynamically
|
||||
* (rather than @ref putchar_ being used)
|
||||
*
|
||||
* @param out An output function which takes one character and a type-erased additional parameters
|
||||
@ -179,12 +179,12 @@ extern "C"
|
||||
int vfctprintf(void (*out)(char c, void *extra_arg), void *extra_arg, const char *format, va_list arg) ATTR_VPRINTF(3);
|
||||
|
||||
#if PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
|
||||
#undef printf_
|
||||
#undef sprintf_
|
||||
#undef vsprintf_
|
||||
#undef printf
|
||||
#undef sprintf
|
||||
#undef vsprintf
|
||||
#undef snprintf_
|
||||
#undef vsnprintf_
|
||||
#undef vprintf_
|
||||
#undef vsnprintf
|
||||
#undef vprintf
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Loading…
x
Reference in New Issue
Block a user