Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 6443 → Rev 6442

/programs/develop/ktcc/trunk/libc/include/stdio.h
90,13 → 90,6
int vsprintf (char * s, const char * format, va_list arg );
int vfprintf ( FILE * stream, const char * format, va_list arg );
 
 
int tiny_sprintf (char * s, const char * format, ... );
int tiny_snprintf (char * s, size_t n, const char * format, ... );
int tiny_vsnprintf (char * s, size_t n, const char * format, va_list args );
// support %c, %s, %d, %x, %u, %% for 32-bit values only. no width specs, left align
// always zero-ended
 
extern int errno;
/* errors codes from KOS, but minus */
#ifndef E_SUCCESS
/programs/develop/ktcc/trunk/libc/include/stdlib.h
12,8 → 12,8
 
extern int atoib(char *s,int b);
extern int atoi(char *s);
extern char *itoab(unsigned int n,char* s,int b);
extern char *__itoa(int n,char* s);
extern char *itoab(int n,char* s,int b);
extern char *itoa(int n,char* s);
 
extern void* stdcall malloc(dword size);
extern void stdcall free(void *pointer);
25,8 → 25,6
double strtod (const char* str, char** endptr);
long double strtold (const char* str, char** endptr);
float strtof (const char* str, char** endptr);
long int strtol (const char* str, char** endptr, int base);
#define strtoul(s, ep, b) ((unsigned long int)strtol(s, ep, b))
 
void* calloc (size_t num, size_t size);
 
43,8 → 41,5
div_t div (int numer, int denom);
#define ldiv(a, b) div(a, b)
#define atol(a) atoi(a)
#define atof(a) strtod(a, NULL)
 
 
 
#endif
/programs/develop/ktcc/trunk/libc/stdio/sprintf_tiny.c
File deleted
/programs/develop/ktcc/trunk/libc/stdio/scanf.c
47,7 → 47,7
return format_scan(NULL, format, arg, &virtual_getc_con, &virtual_ungetc_con);
};
 
int scanf ( const char * format, ...)
int kos_scanf ( const char * format, ...)
{
va_list arg;
int n;
/programs/develop/ktcc/trunk/libc/stdlib/strtol.c
File deleted
/programs/develop/ktcc/trunk/libc/stdlib/itoa.c
6,15 → 6,11
/*
** itoa(n,s) - Convert n to characters in s
*/
char* __itoa(int n,char* s)
char* itoa(int n,char* s)
{
int sign;
char *ptr;
ptr = s;
 
if(n == (int)0x80000000)
return strcpy(s, "-2147483648"); // overflowed -n
 
if ((sign = n) < 0) n = -n;
do {
*ptr++ = n % 10 + '0';
/programs/develop/ktcc/trunk/libc/stdlib/itoab.c
7,7 → 7,7
** itoab(n,s,b) - Convert "unsigned" n to characters in s using base b.
** NOTE: This is a non-standard function.
*/
char* itoab(unsigned int n, char* s, int b)
char* itoab(int n,char* s,int b)
{
char *ptr;
int lowbit;
15,7 → 15,7
b >>= 1;
do {
lowbit = n & 1;
n = (n >> 1) & 0x7FFFFFFF;
n = (n >> 1) & 32767;
*ptr = ((n % b) << 1) + lowbit;
if(*ptr < 10) *ptr += '0'; else *ptr += 55;
++ptr;
/programs/develop/ktcc/trunk/libc/string/memcmp.c
10,8 → 10,6
return -1;
if (*(uc*)buf1>*(uc*)buf2)
return 1;
(uc*)buf1++;
(uc*)buf2++;
}
return 0;
}
/programs/develop/ktcc/trunk/libc/start/start.asm
28,10 → 28,9
 
;DEBUGF ' path "%s"\n params "%s"\n', .path, .params
; check for overflow
;; that not work
; mov al, [path+buf_len-1]
; or al, [params+buf_len-1]
; jnz .crash
mov al, [path+buf_len-1]
or al, [params+buf_len-1]
jnz .crash
; check if path written by OS
mov eax, [hparams]
test eax, eax
/programs/develop/ktcc/trunk/source/readme_kos32.txt
18,6 → 18,8
-silent (kos) -> writes to debugboard
-impossible using with mingw-gcc compiled lib, incompatible library format:
.o is PE-format from gcc but ELF from tcc, may be linux-gcc does it ok
-no symbols (mapfile) for debug, see howtodebugtcc
-no debug info for -g (kos32 linker imperfection)
-__fastcall incompatible with other compilers. now stack freed by caller.
must fix i386-gen.c@490,572 (fixed in other branch https://github.com/mirror/tinycc)
 
28,6 → 30,8
-not working: default search path are ./include ./lib from executable
--under KOS need to use -Bpath_to_ktcc
--start.o not found using -B (kos) - put near your.c file
-if static var sized more than 14096+ -> crash compiled .exe (kos)
---^ stack size set in menuet header at compile time tccmeos.c:177 about 4k
-bench timing coarse (0s or 1s), no usec in newlib gettimeofday. OK
 
Tests status:
89,6 → 93,9
 
 
stdlib.h:
atof
atol
strtol, strtoul
atexit
getenv
system
107,12 → 114,13
Status or libc tests
 
---FAILED---
strtoul incorrect work with big unsigned > MAX_LONG
tstring - need to fix
 
 
---NOT TESTED---
no library fns realized
qsort
strtol
time
 
---HANG---
121,9 → 129,9
 
 
---STACK IS SMALL---
use new -stack=1280000 option to pass test
tstring
strtodlong
use new -stack=1280000 option
 
 
--other--
133,7 → 141,6
 
snprintf
-some format misturbances
-may incorrect prints unsigned > 2147483647L
 
ungetc
-ungetc fails if filepos == 0 - no tricks
/programs/develop/ktcc/trunk/source/tccmeos.c
358,8 → 358,7
// return 1 on error
{
FILE *fdbg;
char fname[400],
buf[80]; // no more fits in mtdbg string
char fname[400], buf[200];
 
strcpy(fname, filename);
strcat(fname, ".dbg");
/programs/develop/ktcc/trunk/samples/files.c
File deleted
\ No newline at end of file
/programs/develop/ktcc/trunk/samples/winbasics.c
File deleted
/programs/develop/ktcc/trunk/samples/simplewin_old.c
File deleted
/programs/develop/ktcc/trunk/samples/consoleio.c
File deleted
\ No newline at end of file