fix some msvc64bit warnings
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3217
This commit is contained in:
parent
a94ef4eddc
commit
c994a9a25e
23 changed files with 145 additions and 128 deletions
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: shell.cpp,v 1.93 2008-09-06 14:47:15 c2woody Exp $ */
|
||||
/* $Id: shell.cpp,v 1.94 2008-09-07 10:55:16 c2woody Exp $ */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
@ -99,7 +99,7 @@ void AutoexecObject::CreateAutoexec(void) {
|
|||
}
|
||||
sprintf((autoexec_data+auto_len),"%s\r\n",(*it).c_str());
|
||||
}
|
||||
if(first_shell) VFILE_Register("AUTOEXEC.BAT",(Bit8u *)autoexec_data,strlen(autoexec_data));
|
||||
if(first_shell) VFILE_Register("AUTOEXEC.BAT",(Bit8u *)autoexec_data,(Bit32u)strlen(autoexec_data));
|
||||
}
|
||||
|
||||
AutoexecObject::~AutoexecObject(){
|
||||
|
@ -430,7 +430,7 @@ public:
|
|||
}
|
||||
}
|
||||
nomount:
|
||||
VFILE_Register("AUTOEXEC.BAT",(Bit8u *)autoexec_data,strlen(autoexec_data));
|
||||
VFILE_Register("AUTOEXEC.BAT",(Bit8u *)autoexec_data,(Bit32u)strlen(autoexec_data));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -598,14 +598,14 @@ void SHELL_Init() {
|
|||
|
||||
/* Setup environment */
|
||||
PhysPt env_write=PhysMake(env_seg,0);
|
||||
MEM_BlockWrite(env_write,path_string,strlen(path_string)+1);
|
||||
env_write+=strlen(path_string)+1;
|
||||
MEM_BlockWrite(env_write,comspec_string,strlen(comspec_string)+1);
|
||||
env_write+=strlen(comspec_string)+1;
|
||||
MEM_BlockWrite(env_write,path_string,(Bitu)(strlen(path_string)+1));
|
||||
env_write += (PhysPt)(strlen(path_string)+1);
|
||||
MEM_BlockWrite(env_write,comspec_string,(Bitu)(strlen(comspec_string)+1));
|
||||
env_write += (PhysPt)(strlen(comspec_string)+1);
|
||||
mem_writeb(env_write++,0);
|
||||
mem_writew(env_write,1);
|
||||
env_write+=2;
|
||||
MEM_BlockWrite(env_write,full_name,strlen(full_name)+1);
|
||||
MEM_BlockWrite(env_write,full_name,(Bitu)(strlen(full_name)+1));
|
||||
|
||||
DOS_PSP psp(psp_seg);
|
||||
psp.MakeNew(0);
|
||||
|
@ -629,7 +629,7 @@ void SHELL_Init() {
|
|||
psp.SetEnvironment(env_seg);
|
||||
/* Set the command line for the shell start up */
|
||||
CommandTail tail;
|
||||
tail.count=strlen(init_line);
|
||||
tail.count=(Bit8u)strlen(init_line);
|
||||
strcpy(tail.buffer,init_line);
|
||||
MEM_BlockWrite(PhysMake(psp_seg,128),&tail,128);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: shell_cmds.cpp,v 1.83 2008-08-11 12:54:57 qbix79 Exp $ */
|
||||
/* $Id: shell_cmds.cpp,v 1.84 2008-09-07 10:55:16 c2woody Exp $ */
|
||||
|
||||
#include "dosbox.h"
|
||||
#include "shell.h"
|
||||
|
@ -413,7 +413,7 @@ void DOS_Shell::CMD_DIR(char * args) {
|
|||
|
||||
char buffer[CROSS_LEN];
|
||||
args = trim(args);
|
||||
Bit32u argLen = strlen(args);
|
||||
size_t argLen = strlen(args);
|
||||
if (argLen == 0) {
|
||||
strcpy(args,"*.*"); //no arguments.
|
||||
} else {
|
||||
|
@ -481,7 +481,10 @@ void DOS_Shell::CMD_DIR(char * args) {
|
|||
if (attr & DOS_ATTR_DIRECTORY) {
|
||||
if (optW) {
|
||||
WriteOut("[%s]",name);
|
||||
for (Bitu i=14-strlen(name);i>0;i--) WriteOut(" ");
|
||||
size_t namelen = strlen(name);
|
||||
if ((namelen>=0) && (namelen<=14)) {
|
||||
for (Bitu i=14-(Bitu)namelen;i>0;i--) WriteOut(" ");
|
||||
}
|
||||
} else {
|
||||
WriteOut("%-8s %-3s %-16s %02d-%02d-%04d %2d:%02d\n",name,ext,"<DIR>",day,month,year,hour,minute);
|
||||
}
|
||||
|
@ -1003,7 +1006,7 @@ void DOS_Shell::CMD_CHOICE(char * args){
|
|||
} while (!c || !(ptr = strchr(rem,(optS?c:toupper(c)))));
|
||||
c = optS?c:toupper(c);
|
||||
DOS_WriteFile (STDOUT,&c, &n);
|
||||
dos.return_code = ptr-rem+1;
|
||||
dos.return_code = (Bit8u)(ptr-rem+1);
|
||||
}
|
||||
|
||||
void DOS_Shell::CMD_ATTRIB(char *args){
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2002-2007 The DOSBox Team
|
||||
* Copyright (C) 2002-2008 The DOSBox Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: shell_misc.cpp,v 1.52 2008-03-02 11:13:47 qbix79 Exp $ */
|
||||
/* $Id: shell_misc.cpp,v 1.53 2008-09-07 10:55:16 c2woody Exp $ */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -78,7 +78,7 @@ void DOS_Shell::InputCommand(char * line) {
|
|||
line[str_index ++] = c;
|
||||
DOS_WriteFile(STDOUT,&c,&n);
|
||||
}
|
||||
str_len = str_index = it_history->length();
|
||||
str_len = str_index = (Bitu)it_history->length();
|
||||
size = CMD_MAXLINE - str_index - 2;
|
||||
line[str_len] = 0;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ void DOS_Shell::InputCommand(char * line) {
|
|||
outc(8); outc(' '); outc(8);
|
||||
}
|
||||
strcpy(line, it_history->c_str());
|
||||
len = it_history->length();
|
||||
len = (Bit16u)it_history->length();
|
||||
str_len = str_index = len;
|
||||
size = CMD_MAXLINE - str_index - 2;
|
||||
DOS_WriteFile(STDOUT, (Bit8u *)line, &len);
|
||||
|
@ -153,7 +153,7 @@ void DOS_Shell::InputCommand(char * line) {
|
|||
outc(8); outc(' '); outc(8);
|
||||
}
|
||||
strcpy(line, it_history->c_str());
|
||||
len = it_history->length();
|
||||
len = (Bit16u)it_history->length();
|
||||
str_len = str_index = len;
|
||||
size = CMD_MAXLINE - str_index - 2;
|
||||
DOS_WriteFile(STDOUT, (Bit8u *)line, &len);
|
||||
|
@ -224,15 +224,15 @@ void DOS_Shell::InputCommand(char * line) {
|
|||
|
||||
if (p_completion_start) {
|
||||
p_completion_start ++;
|
||||
completion_index = str_len - strlen(p_completion_start);
|
||||
completion_index = (Bit16u)(str_len - strlen(p_completion_start));
|
||||
} else {
|
||||
p_completion_start = line;
|
||||
completion_index = 0;
|
||||
}
|
||||
|
||||
char *path;
|
||||
if ((path = strrchr(line+completion_index,'\\'))) completion_index = path-line+1;
|
||||
if ((path = strrchr(line+completion_index,'/'))) completion_index = path-line+1;
|
||||
if ((path = strrchr(line+completion_index,'\\'))) completion_index = (Bit16u)(path-line+1);
|
||||
if ((path = strrchr(line+completion_index,'/'))) completion_index = (Bit16u)(path-line+1);
|
||||
|
||||
// build the completion list
|
||||
char mask[DOS_PATHLENGTH];
|
||||
|
@ -295,7 +295,7 @@ void DOS_Shell::InputCommand(char * line) {
|
|||
}
|
||||
|
||||
strcpy(&line[completion_index], it_completion->c_str());
|
||||
len = it_completion->length();
|
||||
len = (Bit16u)it_completion->length();
|
||||
str_len = str_index = completion_index + len;
|
||||
size = CMD_MAXLINE - str_index - 2;
|
||||
DOS_WriteFile(STDOUT, (Bit8u *)it_completion->c_str(), &len);
|
||||
|
@ -448,7 +448,7 @@ bool DOS_Shell::Execute(char * name,char * args) {
|
|||
block.Clear();
|
||||
//Add a filename
|
||||
RealPt file_name=RealMakeSeg(ss,reg_sp+0x20);
|
||||
MEM_BlockWrite(Real2Phys(file_name),fullname,strlen(fullname)+1);
|
||||
MEM_BlockWrite(Real2Phys(file_name),fullname,(Bitu)(strlen(fullname)+1));
|
||||
|
||||
/* HACK: Store full commandline for mount and imgmount */
|
||||
full_arguments.assign(line);
|
||||
|
@ -458,7 +458,7 @@ bool DOS_Shell::Execute(char * name,char * args) {
|
|||
cmdtail.count = 0;
|
||||
memset(&cmdtail.buffer,0,126); //Else some part of the string is unitialized (valgrind)
|
||||
if (strlen(line)>126) line[126]=0;
|
||||
cmdtail.count=strlen(line);
|
||||
cmdtail.count=(Bit8u)strlen(line);
|
||||
memcpy(cmdtail.buffer,line,strlen(line));
|
||||
cmdtail.buffer[strlen(line)]=0xd;
|
||||
/* Copy command line in stack block too */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue