Fixed compiler warnings

svn path=/trunk/; revision=900
This commit is contained in:
Eric Kohl 1999-12-24 17:20:54 +00:00
parent a7a23b4dc3
commit 128cfc8af0
8 changed files with 70 additions and 247 deletions

View file

@ -5,7 +5,7 @@ double atan2 (double __y, double __x)
register double __value;
__asm __volatile__
("fpatan\n\t"
"fldl %%st(0)"
"fld %%st(0)"
: "=t" (__value) : "0" (__x), "u" (__y));
return __value;

View file

@ -27,7 +27,7 @@ double exp (double __x)
__asm __volatile__
("fldl2e # e^x = 2^(x * log2(e))\n\t"
"fmul %%st(1) # x * log2(e)\n\t"
"fstl %%st(1)\n\t"
"fst %%st(1)\n\t"
"frndint # int(x * log2(e))\n\t"
"fxch\n\t"
"fsub %%st(1) # fract(x * log2(e))\n\t"

View file

@ -64,7 +64,7 @@ double pow (double __x, double __y)
}
__asm __volatile__
("fmul %%st(1) # y * log2(x)\n\t"
"fstl %%st(1)\n\t"
"fst %%st(1)\n\t"
"frndint # int(y * log2(x))\n\t"
"fxch\n\t"
"fsub %%st(1) # fract(y * log2(x))\n\t"

View file

@ -1,4 +1,4 @@
/* $Id: init.c,v 1.6 1999/12/06 00:25:14 ekohl Exp $
/* $Id: init.c,v 1.7 1999/12/24 17:17:51 ekohl Exp $
*
* init.c - Session Manager initialization
*
@ -87,9 +87,9 @@ InitSessionManager (
NULL);
Status = NtCreatePort (&SmApiPort,
0,
&ObjectAttributes,
0,
0,
0);
if (!NT_SUCCESS(Status))
@ -243,9 +243,9 @@ InitSessionManager (
NULL);
Status = NtCreatePort (&DbgSsApiPort,
0,
&ObjectAttributes,
0,
0,
0);
if (!NT_SUCCESS(Status))
@ -266,9 +266,9 @@ InitSessionManager (
NULL);
Status = NtCreatePort (&DbgUiApiPort,
0,
&ObjectAttributes,
0,
0,
0);
if (!NT_SUCCESS(Status))

View file

@ -1,2 +1,2 @@
#define CMD_VER "0.1 pre 6"
#define CMD_VER "0.1 pre 7"
#define CMD_VER_RC CMD_VER"\0"

View file

@ -1,4 +1,5 @@
/*
/* $Id: copy.c,v 1.6 1999/12/24 17:20:54 ekohl Exp $
*
* COPY.C -- copy internal command.
*
*
@ -18,7 +19,7 @@
* Replaced CRT io functions by Win32 io functions.
*
* 27-Oct-1998 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
* Disabled prompting then used in batch mode.
* Disabled prompting when used in batch mode.
*/
#include "config.h"
@ -283,7 +284,8 @@ ParseCommand (LPFILES f, int argc, char **arg, LPDWORD lpdwFlags)
}
static VOID DeleteFileList (LPFILES f)
static VOID
DeleteFileList (LPFILES f)
{
LPFILES temp;
@ -738,11 +740,12 @@ INT cmd_copy (LPTSTR first, LPTSTR rest)
copied = setup_copy (sources->next, p, bMultiple, drive_d, dir_d, file_d, ext_d, &append, &dwFlags) + 1;
}
// DeleteFileList (start);
DeleteFileList (sources);
DeleteFileList (sources);
freep (p);
ConOutPrintf (_T(" %d file(s) copied\n"), copied);
return 1;
}
#endif /* INCLUDE_CMD_COPY */
/* EOF */

View file

@ -42,7 +42,6 @@ VOID CompleteFilename (LPTSTR str, INT charcount)
TCHAR directory[MAX_PATH];
LPCOMMAND cmds_ptr;
/* expand current file name */
count = charcount - 1;
if (count < 0)
@ -95,7 +94,7 @@ VOID CompleteFilename (LPTSTR str, INT charcount)
do
{
/* ignore "." and ".." */
if (!_tcscmp (file.cFileName, _T(".")) ||
if (!_tcscmp (file.cFileName, _T(".")) ||
!_tcscmp (file.cFileName, _T("..")))
continue;
@ -139,24 +138,19 @@ VOID CompleteFilename (LPTSTR str, INT charcount)
}
else
{
/* no match found */
/*interanl commands serch*/
for(cmds_ptr=cmds;cmds_ptr->name;cmds_ptr++)
/* no match found - search for internal command */
for (cmds_ptr = cmds; cmds_ptr->name; cmds_ptr++)
{
if(!_tcsnicmp(&str[start],cmds_ptr->name,
_tcslen(&str[start])))
if (!_tcsnicmp (&str[start], cmds_ptr->name,
_tcslen (&str[start])))
{
/*return the mach only if it is uniq*/
if(_tcsnicmp(&str[start],(cmds_ptr+1)->name,_tcslen(&str[start])))
_tcscpy(&str[start],cmds_ptr->name);
/* return the mach only if it is unique */
if (_tcsnicmp (&str[start], (cmds_ptr+1)->name, _tcslen (&str[start])))
_tcscpy (&str[start], cmds_ptr->name);
break;
}
}
#ifdef __REACTOS__
Beep (440, 50);
#else
@ -181,8 +175,6 @@ BOOL ShowCompletionMatches (LPTSTR str, INT charcount)
TCHAR path[MAX_PATH];
TCHAR fname[MAX_PATH];
TCHAR directory[MAX_PATH];
LPCOMMAND cmds_ptr;
/* expand current file name */
count = charcount - 1;
@ -265,8 +257,6 @@ BOOL ShowCompletionMatches (LPTSTR str, INT charcount)
else
{
/* no match found */
#ifdef __REACTOS__
Beep (440, 50);
#else

View file

@ -1,4 +1,5 @@
/*
/* $Id: history.c,v 1.8 1999/12/24 17:19:20 ekohl Exp $
*
* HISTORY.C - command line history.
*
*
@ -24,8 +25,6 @@
*
*/
/*
* HISTORY.C - command line history. Second version
*
@ -35,18 +34,11 @@
* 06/12/99 (Paolo Pantaleo <paolopan@freemail.it>)
* started.
*
*/
*/
#include "config.h"
#ifdef FEATURE_HISTORY
#include <windows.h>
#include <tchar.h>
#include <string.h>
@ -62,70 +54,51 @@ typedef struct tagHISTORY
LPTSTR string;
} HIST_ENTRY, * LPHIST_ENTRY;
static INT size,
max_size=10;
/*for now not configurable*/
static INT size;
static INT max_size=10; /* for now not configurable */
static LPHIST_ENTRY Top;
static LPHIST_ENTRY Bottom;
static LPHIST_ENTRY curr_ptr=0;
VOID InitHistory(VOID);
VOID History_move_to_bottom(VOID);
VOID History (INT dir, LPTSTR commandline);
VOID CleanHistory(VOID);
VOID History_del_current_entry(LPTSTR str);
/*service functions*/
VOID del(LPHIST_ENTRY item);
VOID add_at_bottom(LPTSTR string);
/* service functions */
static VOID del (LPHIST_ENTRY item);
static VOID add_at_bottom (LPTSTR string);
VOID InitHistory(VOID)
VOID InitHistory (VOID)
{
size=0;
Top = malloc(sizeof(HIST_ENTRY));
Bottom = malloc(sizeof(HIST_ENTRY));
Top = malloc(sizeof(HIST_ENTRY));
Bottom = malloc(sizeof(HIST_ENTRY));
Top->prev = Bottom;
Top->next = NULL;
Top->string = NULL;
Bottom->prev = NULL;
Bottom->next = Top;
Bottom->next = Top;
Bottom->string = NULL;
curr_ptr=Bottom;
}
VOID CleanHistory(VOID)
VOID CleanHistory (VOID)
{
while (Bottom->next!=Top)
del(Bottom->next);
free(Top);
free(Bottom);
del (Bottom->next);
free (Top);
free (Bottom);
}
VOID History_del_current_entry(LPTSTR str)
{
LPHIST_ENTRY tmp;
if (size==0)
return;
@ -135,100 +108,77 @@ VOID History_del_current_entry(LPTSTR str)
if(curr_ptr==Top)
curr_ptr=Top->prev;
tmp=curr_ptr;
tmp=curr_ptr;
curr_ptr=curr_ptr->prev;
del(tmp);
History(-1,str);
}
static
VOID del(LPHIST_ENTRY item)
{
if( item==NULL || item==Top || item==Bottom )
{
#ifdef _DEBUG
DebugPrintf("del in " __FILE__ ": retrning\n"
"item is 0x%08x (Bottom is0x%08x)\n",
item, Bottom);
item, Bottom);
#endif
return;
}
/*free string's mem*/
if (item->string)
free(item->string);
/*set links in prev and next item*/
item->next->prev=item->prev;
item->prev->next=item->next;
item->prev->next=item->next;
free(item);
size--;
}
static
VOID add_at_bottom(LPTSTR string)
{
{
{
LPHIST_ENTRY tmp;
LPHIST_ENTRY tmp;
/*delete first entry if maximum number of entries is reached*/
if(size==max_size)
del(Top->prev);
/*delete first entry if maximum number of entries is reached*/
if(size==max_size)
del(Top->prev);
/*fill bottom with string*/
Bottom->string=malloc(_tcslen(string)+1);
_tcscpy(Bottom->string,string);
/*save Bottom value*/
tmp=Bottom;
/*fill bottom with string*/
Bottom->string=malloc(_tcslen(string)+1);
_tcscpy(Bottom->string,string);
/*create new void Bottom*/
Bottom=malloc(sizeof(HIST_ENTRY));
Bottom->next=tmp;
Bottom->prev=NULL;
Bottom->string=NULL;
/*save Bottom value*/
tmp=Bottom;
/*create new void Bottom*/
Bottom=malloc(sizeof(HIST_ENTRY));
Bottom->next=tmp;
Bottom->prev=NULL;
Bottom->string=NULL;
tmp->prev=Bottom;
/*set new size*/
size++;
}
tmp->prev=Bottom;
/*set new size*/
size++;
}
VOID History_move_to_bottom(VOID)
{
curr_ptr=Bottom;
}
VOID History (INT dir, LPTSTR commandline)
{
if(dir==0)
{
add_at_bottom(commandline);
@ -242,37 +192,29 @@ VOID History (INT dir, LPTSTR commandline)
return;
}
if(dir<0)/*key up*/
{
if (curr_ptr->next==Top || curr_ptr==Top)
{
#ifdef WRAP_HISTORY
curr_ptr=Bottom;
#else
#ifdef WRAP_HISTORY
curr_ptr=Bottom;
#else
curr_ptr=Top;
commandline[0]=_T('\0');
return;
#endif
}
curr_ptr = curr_ptr->next;
if(curr_ptr->string)
_tcscpy(commandline,curr_ptr->string);
}
if(dir>0)
{
if (curr_ptr->prev==Bottom || curr_ptr==Bottom)
{
#ifdef WRAP_HISTORY
#ifdef WRAP_HISTORY
curr_ptr=Top;
#else
curr_ptr=Bottom;
@ -281,123 +223,11 @@ VOID History (INT dir, LPTSTR commandline)
#endif
}
curr_ptr=curr_ptr->prev;
curr_ptr=curr_ptr->prev;
if(curr_ptr->string)
_tcscpy(commandline,curr_ptr->string);
_tcscpy(commandline,curr_ptr->string);
}
}
#endif /* FEATURE_HISTORY */
#if 0
LPTSTR history = NULL; /*buffer to sotre all the lines*/
LPTSTR lines[MAXLINES]; /*array of pointers to each line(entry)*/
/*located in history buffer*/
INT curline = 0; /*the last line recalled by user*/
INT numlines = 0; /*number of entries, included the last*/
/*empty one*/
INT maxpos = 0; /*index of last byte of last entry*/
VOID History (INT dir, LPTSTR commandline)
{
INT count; /*used in for loops*/
INT length; /*used in the same loops of count*/
/*both to make room when is full
either history or lines*/
/*first time History is called allocate mem*/
if (!history)
{
history = malloc (history_size * sizeof (TCHAR));
lines[0] = history;
history[0] = 0;
}
if (dir > 0)
{
/* next command */
if (curline < numlines)
{
curline++;
}
if (curline == numlines)
{
commandline[0] = 0;
}
else
{
_tcscpy (commandline, lines[curline]);
}
}
else if (dir < 0)
{
/* prev command */
if (curline > 0)
{
curline--;
}
_tcscpy (commandline, lines[curline]);
}
else
{
/* add to history */
/* remove oldest string until there's enough room for next one */
/* strlen (commandline) must be less than history_size! */
while ((maxpos + (INT)_tcslen (commandline) + 1 > history_size) || (numlines >= MAXLINES))
{
length = _tcslen (lines[0]) + 1;
for (count = 0; count < maxpos && count + (lines[1] - lines[0]) < history_size; count++)
{
history[count] = history[count + length];
}
maxpos -= length;
for (count = 0; count <= numlines && count < MAXLINES; count++)
{
lines[count] = lines[count + 1] - length;
}
numlines--;
#ifdef DEBUG
ConOutPrintf (_T("Reduced size: %ld lines\n"), numlines);
for (count = 0; count < numlines; count++)
{
ConOutPrintf (_T("%d: %s\n"), count, lines[count]);
}
#endif
}
/*copy entry in the history bufer*/
_tcscpy (lines[numlines], commandline);
numlines++;
/*set last lines[numlines] pointer next the end of last, valid,
just setted entry (the two lines above)*/
lines[numlines] = lines[numlines - 1] + _tcslen (commandline) + 1;
maxpos += _tcslen (commandline) + 1;
/* last line, empty */
curline = numlines;
}
return;
}
#endif
#endif //#if 0
/* EOF */