mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-15 07:09:43 +03:00
AK: Make the return type of dbgputstr consistent.
This commit is contained in:
parent
4cf3a1eb41
commit
59e7ffa86d
Notes:
sideshowbarker
2024-07-19 02:04:12 +09:00
Author: https://github.com/asynts Commit: https://github.com/SerenityOS/serenity/commit/59e7ffa86d5 Pull-request: https://github.com/SerenityOS/serenity/pull/3682
@ -585,7 +585,7 @@ void vwarn(StringView fmtstr, TypeErasedFormatParams params, bool newline)
|
||||
void raw_dbg(StringView string)
|
||||
{
|
||||
const auto retval = dbgputstr(string.characters_without_null_termination(), string.length());
|
||||
ASSERT(static_cast<size_t>(retval) == string.length());
|
||||
ASSERT(retval == 0);
|
||||
}
|
||||
void vdbg(StringView fmtstr, TypeErasedFormatParams params, bool newline)
|
||||
{
|
||||
|
@ -35,7 +35,7 @@
|
||||
extern "C" {
|
||||
int vdbgprintf(const char* fmt, va_list);
|
||||
int dbgprintf(const char* fmt, ...);
|
||||
ssize_t dbgputstr(const char*, ssize_t);
|
||||
int dbgputstr(const char*, ssize_t);
|
||||
int sprintf(char* buf, const char* fmt, ...);
|
||||
int snprintf(char* buffer, size_t, const char* fmt, ...);
|
||||
}
|
||||
@ -44,9 +44,10 @@ int snprintf(char* buffer, size_t, const char* fmt, ...);
|
||||
# include <stdio.h>
|
||||
# define kprintf printf
|
||||
# define dbgprintf(...) fprintf(stderr, __VA_ARGS__)
|
||||
inline size_t dbgputstr(const char* characters, ssize_t length)
|
||||
inline int dbgputstr(const char* characters, ssize_t length)
|
||||
{
|
||||
return fwrite(characters, 1, length, stderr);
|
||||
fwrite(characters, 1, length, stderr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
template<size_t N>
|
||||
|
@ -193,6 +193,8 @@ int main(int argc, char** argv)
|
||||
|
||||
new_tab.load(url);
|
||||
|
||||
dbgln("Added new tab {:p}, loading {}", &new_tab, url);
|
||||
|
||||
if (activate)
|
||||
tab_widget.set_active_widget(&new_tab);
|
||||
};
|
||||
|
@ -1044,7 +1044,7 @@ void dbgputch(char ch)
|
||||
syscall(SC_dbgputch, ch);
|
||||
}
|
||||
|
||||
ssize_t dbgputstr(const char* characters, ssize_t length)
|
||||
int dbgputstr(const char* characters, ssize_t length)
|
||||
{
|
||||
int rc = syscall(SC_dbgputstr, characters, length);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
|
@ -93,7 +93,7 @@ int fprintf(FILE*, const char* fmt, ...);
|
||||
int printf(const char* fmt, ...);
|
||||
int dbgprintf(const char* fmt, ...);
|
||||
void dbgputch(char);
|
||||
ssize_t dbgputstr(const char*, ssize_t);
|
||||
int dbgputstr(const char*, ssize_t);
|
||||
int sprintf(char* buffer, const char* fmt, ...);
|
||||
int snprintf(char* buffer, size_t, const char* fmt, ...);
|
||||
int putchar(int ch);
|
||||
|
Loading…
Reference in New Issue
Block a user