mirror of
https://git.planet-casio.com/Vhex-Kernel-Core/fxlibc.git
synced 2024-12-28 04:23:38 +01:00
fix compilation error (common)
This commit is contained in:
parent
aeedfcdb02
commit
3764de9a27
10 changed files with 32 additions and 13 deletions
|
@ -73,7 +73,7 @@ extern ssize_t pwrite (int __fd, const void *__buf, size_t __n, off_t __offset);
|
|||
** or the end of the file (if WHENCE is SEEK_END).
|
||||
** Return the new file position.
|
||||
*/
|
||||
extern __off_t lseek (int __fd, off_t __offset, int __whence);
|
||||
extern off_t lseek (int __fd, off_t __offset, int __whence);
|
||||
|
||||
/* Close the file descriptor FD */
|
||||
extern int close(int __fd);
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#---
|
||||
MAJOR := 0
|
||||
MINOR := 2
|
||||
PATCH := 0
|
||||
PATCH := 1
|
||||
EXTRAVERSION := -alpha
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include __SUPPORT_VHEX_KERNEL
|
||||
#ifdef __SUPPORT_VHEX_KERNEL
|
||||
#include <asm/unistd_32.h>
|
||||
.text
|
||||
.global _kill
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef _SRC_STDIO_PRINTF_H__
|
||||
# define _SRC_STDIO_PRINTF_H__
|
||||
#ifndef _SRC_STDIO_INTERNAL_PRINTF_H__
|
||||
# define _SRC_STDIO_INTERNAL_PRINTF_H__
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
@ -55,4 +55,4 @@ struct printf_opt
|
|||
// Internal symbols used to define all actions possibility
|
||||
extern void (*action[26])(struct printf_opt *opt, char n);
|
||||
|
||||
#endif /*_SRC_STDIO_PRINTF_H__*/
|
||||
#endif /*_SRC_STDIO_INTERNAL_PRINTF_H__*/
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#include <stdio.h>
|
||||
|
||||
// internal depency
|
||||
// TODO: update path detection
|
||||
#include "../src/stdio/internal/printf.h"
|
||||
|
||||
// Define all actions
|
||||
static void action_str(struct printf_opt *op, char n);
|
||||
static void action_ptr(struct printf_opt *op, char n);
|
||||
|
@ -25,7 +29,7 @@ void (*action[26])(struct printf_opt *opt, char n) = {
|
|||
static void base_to_str(struct printf_opt *opt, uint32_t num, int base, int digits)
|
||||
{
|
||||
char *hexa = (opt->uppercase == 1) ? "0123456789ABCDEF" : "0123456789abcdef";
|
||||
|
||||
|
||||
opt->digits = 0;
|
||||
while (num != 0 || opt->digits < digits)
|
||||
{
|
||||
|
@ -131,7 +135,7 @@ static void action_ptr(struct printf_opt *opt, char n)
|
|||
opt->sign = '@';
|
||||
opt->base[0] = '0';
|
||||
opt->base[1] = 'x';
|
||||
base_to_str(opt, (uint32_t)va_arg(opt->ap, void*), 16, 8);
|
||||
base_to_str(opt, (uintptr_t)va_arg(opt->ap, void*), 16, 8);
|
||||
disp_format(opt);
|
||||
}
|
||||
|
||||
|
@ -150,7 +154,7 @@ static void action_int(struct printf_opt *opt, char n)
|
|||
opt->sign = (opt->flags.plus == 1) ? '+' : ' ';
|
||||
}
|
||||
|
||||
// Generate / display number
|
||||
// Generate / display number
|
||||
base_to_str(opt, num, 10, 1);
|
||||
disp_format(opt);
|
||||
}
|
||||
|
@ -169,8 +173,7 @@ static void action_uint(struct printf_opt *opt, char n)
|
|||
}
|
||||
|
||||
// Display extra symbols if needed
|
||||
if (opt->flags.diez == 1)
|
||||
{
|
||||
if (opt->flags.diez == 1) {
|
||||
if (n == 'o') {
|
||||
opt->base[0] = '0';
|
||||
} else if (n == 'x') {
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#include <stdio.h>
|
||||
|
||||
// internal depency
|
||||
// TODO: update path detection
|
||||
#include "../src/stdio/internal/printf.h"
|
||||
|
||||
//TODO: precision handling
|
||||
int printf_common(struct printf_opt *opt, const char *restrict format)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#include <stdio.h>
|
||||
|
||||
// internal depency
|
||||
// TODO: update path detection
|
||||
#include "../src/stdio/internal/printf.h"
|
||||
|
||||
static int get_flags(struct printf_opt *opt, const char *restrict format)
|
||||
{
|
||||
int i;
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
// internal depency
|
||||
// TODO: update path detection
|
||||
#include "../src/stdio/internal/printf.h"
|
||||
|
||||
// FIXME:
|
||||
// if the writte syscall do not return the same
|
||||
// number of bytes that requested, stop the function !
|
||||
|
@ -31,5 +35,5 @@ int vdprintf(int fd, const char *restrict format, va_list ap)
|
|||
opt.disp_char = &disp_char;
|
||||
opt.disp_fflush = &disp_fflush;
|
||||
va_copy(opt.ap, ap);
|
||||
return (printf_common(&opt, format));
|
||||
return (printf_common(&opt, format));
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#include <stdio.h>
|
||||
|
||||
// internal depency
|
||||
// TODO: update path detection
|
||||
#include "../src/stdio/internal/printf.h"
|
||||
|
||||
static void disp_char(struct printf_opt *opt, char n)
|
||||
{
|
||||
// Check write possibility
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include __SUPPORT_VHEX_KERNEL
|
||||
#ifdef __SUPPORT_VHEX_KERNEL
|
||||
#include <asm/unistd_32.h>
|
||||
.text
|
||||
.global _fork_execve
|
||||
|
|
Loading…
Reference in a new issue