git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Kernel/PTYs - Add initial dims/mode to PTY_Create
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
lib.c
diff --git
a/KernelLand/Kernel/lib.c
b/KernelLand/Kernel/lib.c
index
68d2032
..
d0c6de6
100644
(file)
--- a/
KernelLand/Kernel/lib.c
+++ b/
KernelLand/Kernel/lib.c
@@
-124,7
+124,7
@@
int strpos8(const char *str, Uint32 Search)
{
// ASCII Range
if(Search < 128) {
- if(str[pos] ==
Search)
return pos;
+ if(str[pos] ==
(char)Search)
return pos;
continue;
}
if(*(Uint8*)(str+pos) < 128) continue;
@@
-180,7
+180,7
@@
int ReadUTF8(const Uint8 *str, Uint32 *Val)
}
// Four Byte
- if( (*str & 0xF
1
) == 0xF0 ) {
+ if( (*str & 0xF
8
) == 0xF0 ) {
outval = (*str & 0x07) << 18; // Upper 3 Bits
str ++;
if( (*str & 0xC0) != 0x80) return 2; // Validity check
@@
-287,23
+287,23
@@
Sint64 timestamp(int sec, int min, int hrs, int day, int month, int year)
return stamp * 1000;
}
+static Sint64 DivMod64(Sint64 N, Sint64 D, Sint64 *R);
+
+static Sint64 DivMod64(Sint64 N, Sint64 D, Sint64 *R)
+{
+ int sign = (N < 0) != (D < 0);
+ if(N < 0) N = -N;
+ if(D < 0) D = -D;
+ if(sign)
+ return -DivMod64U(N, D, (Uint64*)R);
+ else
+ return DivMod64U(N, D, (Uint64*)R);
+}
+
void format_date(tTime TS, int *year, int *month, int *day, int *hrs, int *mins, int *sec, int *ms)
{
int is_leap = 0, i;
- auto Sint64 DivMod64(Sint64 N, Sint64 D, Sint64 *R);
-
- Sint64 DivMod64(Sint64 N, Sint64 D, Sint64 *R)
- {
- int sign = (N < 0) != (D < 0);
- if(N < 0) N = -N;
- if(D < 0) D = -D;
- if(sign)
- return -DivMod64U(N, D, (Uint64*)R);
- else
- return DivMod64U(N, D, (Uint64*)R);
- }
-
// Get time
// TODO: Leap-seconds?
{
@@
-387,7
+387,7
@@
int ModUtil_SetIdent(char *Dest, const char *Value)
int Hex(char *Dest, size_t Size, const Uint8 *SourceData)
{
-
int
i;
+
size_t
i;
for( i = 0; i < Size; i ++ )
{
sprintf(Dest + i*2, "%02x", SourceData[i]);
@@
-400,8
+400,7
@@
int Hex(char *Dest, size_t Size, const Uint8 *SourceData)
*/
int UnHex(Uint8 *Dest, size_t DestSize, const char *SourceString)
{
- int i;
-
+ size_t i;
for( i = 0; i < DestSize*2; i += 2 )
{
Uint8 val = 0;
UCC
git Repository :: git.ucc.asn.au