Clean old .source directive out of asm code

This commit is contained in:
Justine Tunney 2022-03-18 12:43:21 -07:00
parent b149a9bcc4
commit 6c2fd9ecc6
269 changed files with 59 additions and 303 deletions

View file

@ -125,8 +125,8 @@ static int __fmt_atoi(const char **str) {
* @note implementation detail of printf(), snprintf(), etc.
* @see printf() for wordier documentation
* @note netlib.org is so helpful
* @asyncsignalsafe
* @vforksafe
* @asyncsignalsafe if floating point isn't used
* @vforksafe if floating point isn't used
*/
hidden int __fmt(void *fn, void *arg, const char *format, va_list va) {
union {

View file

@ -27,6 +27,7 @@
.endm
.section .rodata
.underrun
kDos2Errno:
.e kNtErrorModNotFound,ENOSYS
.e kNtErrorBadCommand,EACCES
@ -100,3 +101,4 @@ kDos2Errno:
.e WSAVERNOTSUPPORTED,ENOSYS
.short 0
.endobj kDos2Errno,globl,hidden
.overrun

View file

@ -28,6 +28,7 @@
.section .rodata
.align 4
.underrun
kErrorNames:
.e EINVAL
.e ENOSYS
@ -116,3 +117,4 @@ kErrorNames:
.e ERESTART
.long 0
.endobj kErrorNames,globl,hidden
.overrun

View file

@ -28,6 +28,7 @@
.section .rodata
.align 4
.underrun
kErrorNamesLong:
.e EINVAL,"Invalid argument"
.e ENOSYS,"Function not implemented"
@ -116,3 +117,4 @@ kErrorNamesLong:
.e ERESTART,"Interrupted system call should be restarted"
.long 0
.endobj kErrorNamesLong,globl,hidden
.overrun

View file

@ -30,7 +30,7 @@ extern const struct Dos2Errno kDos2Errno[];
/**
* Translates Windows error using superset of consts.sh.
*/
textwindows errno_t __dos2errno(uint32_t error) {
privileged errno_t __dos2errno(uint32_t error) {
int i;
for (i = 0; kDos2Errno[i].doscode; ++i) {
if (error == kDos2Errno[i].doscode) {

View file

@ -19,6 +19,7 @@
#include "libc/alg/reverse.internal.h"
#include "libc/assert.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/divmod10.internal.h"
#include "libc/fmt/fmts.h"
#include "libc/fmt/internal.h"
#include "libc/limits.h"
@ -92,7 +93,6 @@ static int __fmt_ntoa_format(int out(const char *, void *, size_t), void *arg,
int __fmt_ntoa2(int out(const char *, void *, size_t), void *arg,
uintmax_t value, bool neg, unsigned log2base, unsigned prec,
unsigned width, unsigned flags, const char *alphabet) {
uint64_t u64;
uintmax_t remainder;
unsigned len, count, digit;
char buf[BUFFER_SIZE];
@ -103,9 +103,7 @@ int __fmt_ntoa2(int out(const char *, void *, size_t), void *arg,
do {
if (!log2base) {
if (value <= UINT64_MAX) {
u64 = value;
digit = u64 % 10;
value = u64 / 10;
value = DivMod10(value, &digit);
} else {
value = __udivmodti4(value, 10, &remainder);
digit = remainder;

View file

@ -16,6 +16,7 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/bits/safemacros.internal.h"
#include "libc/fmt/fmt.h"
/**
@ -23,7 +24,11 @@
* @see strerror_r()
*/
noasan char *strerror(int err) {
_Alignas(1) static char buf[512];
strerror_r(err, buf, sizeof(buf));
return buf;
if (IsTiny()) {
return firstnonnull(strerror_short(err), "EUNKNOWN");
} else {
_Alignas(1) static char buf[512];
strerror_r(err, buf, sizeof(buf));
return buf;
}
}