Fixed some compiler errors and warnings.

This commit is contained in:
Niels Kristian Bech Jensen 2000-03-19 21:49:49 +00:00 committed by Alexandre Julliard
parent c1a700c4da
commit 52be93cbb4
16 changed files with 40 additions and 25 deletions

View File

@ -181,7 +181,7 @@ VOID LANGUAGE_Init(VOID)
CHAR szBuffer[MAX_PATHNAME_LEN]; CHAR szBuffer[MAX_PATHNAME_LEN];
#ifdef WINELIB #ifdef WINELIB
Globals.lpszLanguage = Languages[Options.language].name; Globals.lpszLanguage = (LPSTR)Languages[Options.language].name;
#endif #endif
if (Globals.lpszLanguage == "En") { if (Globals.lpszLanguage == "En") {

View File

@ -28,7 +28,7 @@ typedef struct
HMENU hPopupMenu1; HMENU hPopupMenu1;
LPCSTR lpszIniFile; LPCSTR lpszIniFile;
LPCSTR lpszIcoFile; LPCSTR lpszIcoFile;
LPCSTR lpszLanguage; LPSTR lpszLanguage;
UINT wStringTableOffset; UINT wStringTableOffset;
BOOL bAnalog; BOOL bAnalog;

View File

@ -65,8 +65,6 @@ static OPENFILENAME ofn;
static HWND findDialogBox = 0; static HWND findDialogBox = 0;
static UINT findMessageId = 0; static UINT findMessageId = 0;
static int findDialogBoxInit = 0;
static int findDialogStructInit = 0;
static FINDREPLACE frS; static FINDREPLACE frS;
static char fromstring[1024], tostring[1024]; static char fromstring[1024], tostring[1024];
@ -390,9 +388,9 @@ void mw_PrintSetup(HWND hWnd)
// Escape(tmp.hDC, NEWFRAME, 0, NULL, NULL); // Escape(tmp.hDC, NEWFRAME, 0, NULL, NULL);
// Escape(tmp.hDC, ENDDOC, 0, NULL, NULL); // Escape(tmp.hDC, ENDDOC, 0, NULL, NULL);
// DeleteDC(tmp.hDC); // DeleteDC(tmp.hDC);
if (pd.hDevMode != NULL) if (pd.hDevMode != 0)
GlobalFree(pd.hDevMode); GlobalFree(pd.hDevMode);
if (pd.hDevNames != NULL) if (pd.hDevNames != 0)
GlobalFree(pd.hDevNames); GlobalFree(pd.hDevNames);
pd.hDevMode = 0; pd.hDevMode = 0;

View File

@ -47,7 +47,7 @@ int AlertIDS(UINT ids_message, UINT ids_caption, WORD type) {
return (MessageBox(Globals.hMainWnd, szMessage, szCaption, type)); return (MessageBox(Globals.hMainWnd, szMessage, szCaption, type));
} }
void AlertFileNotFound(LPCSTR szFileName) { void AlertFileNotFound(LPSTR szFileName) {
int nResult; int nResult;
CHAR szMessage[MAX_STRING_LEN]; CHAR szMessage[MAX_STRING_LEN];
@ -65,7 +65,7 @@ void AlertFileNotFound(LPCSTR szFileName) {
} }
int AlertFileNotSaved(LPCSTR szFileName) { int AlertFileNotSaved(LPSTR szFileName) {
int nResult; int nResult;
CHAR szMessage[MAX_STRING_LEN]; CHAR szMessage[MAX_STRING_LEN];
@ -373,14 +373,14 @@ VOID DIALOG_FilePrint(VOID)
*/ */
/* Let commdlg manage copy settings */ /* Let commdlg manage copy settings */
printer.nCopies = PD_USEDEVMODECOPIES; printer.nCopies = (WORD)PD_USEDEVMODECOPIES;
if (PrintDlg(&printer)) { if (PrintDlg(&printer)) {
/* initialize DOCINFO */ /* initialize DOCINFO */
di.cbSize = sizeof(DOCINFO); di.cbSize = sizeof(DOCINFO);
lstrcpy(di.lpszDocName, szDocumentName); lstrcpy((LPSTR)di.lpszDocName, szDocumentName);
lstrcpy(di.lpszOutput, szOutput); lstrcpy((LPSTR)di.lpszOutput, szOutput);
hContext = printer.hDC; hContext = printer.hDC;
assert(hContext!=0); assert(hContext!=0);
@ -627,7 +627,7 @@ VOID DIALOG_PageSetup(VOID)
WNDPROC lpfnDlg; WNDPROC lpfnDlg;
lpfnDlg = MakeProcInstance(DIALOG_PAGESETUP_DlgProc, Globals.hInstance); lpfnDlg = MakeProcInstance(DIALOG_PAGESETUP_DlgProc, Globals.hInstance);
DialogBox(Globals.hInstance, STRING_PAGESETUP_Xx, Globals.hMainWnd, lpfnDlg); DialogBox(Globals.hInstance, STRING_PAGESETUP_Xx, Globals.hMainWnd, (DLGPROC)lpfnDlg);
FreeProcInstance(lpfnDlg); FreeProcInstance(lpfnDlg);
} }

View File

@ -17,6 +17,9 @@
#include "dialog.h" #include "dialog.h"
#include "language.h" #include "language.h"
extern BOOL DoCloseFile(void);
extern void DoOpenFile(LPCSTR szFileName);
NOTEPAD_GLOBALS Globals; NOTEPAD_GLOBALS Globals;
/*********************************************************************** /***********************************************************************

View File

@ -32,7 +32,7 @@
} }
for (i=0; i<nSPLen; i++) { for (i=0; i<nSPLen; i++) {
delta[szSP[i]] = (nSPLen - rightmostpos(szSP[i], szSP, nSPLen)); delta[(int)szSP[i]] = (nSPLen - rightmostpos(szSP[i], szSP, nSPLen));
} }
} }
@ -41,13 +41,13 @@
int j = nSPLen; int j = nSPLen;
do { do {
if (szBuf[i] = szSP[j]) { if ((szBuf[i] = szSP[j])) {
i--; j--; i--; j--;
} else { } else {
if ((nSPLen-j+1) > delta[szBuf[i]]) { if ((nSPLen-j+1) > delta[(int)szBuf[i]]) {
i+= (nSPLen-j+1); i+= (nSPLen-j+1);
} else { } else {
i+= delta[szBuf[i]]; i+= delta[(int)szBuf[i]];
} }
} }
} while (j>0 && i<=nBufLen); } while (j>0 && i<=nBufLen);

View File

@ -35,7 +35,7 @@ INT DIALOG_New(INT nDefault)
New.nDefault = nDefault; New.nDefault = nDefault;
ret = DialogBox(Globals.hInstance, STRING_NEW_Xx, ret = DialogBox(Globals.hInstance, STRING_NEW_Xx,
Globals.hMainWnd, lpfnDlg); Globals.hMainWnd, (DLGPROC)lpfnDlg);
FreeProcInstance(lpfnDlg); FreeProcInstance(lpfnDlg);
return ret; return ret;
} }
@ -97,7 +97,7 @@ HLOCAL DIALOG_CopyMove(LPCSTR lpszProgramName, LPCSTR lpszFromGroupName,
ret = DialogBox(Globals.hInstance, ret = DialogBox(Globals.hInstance,
bMove ? STRING_MOVE_Xx : STRING_COPY_Xx, bMove ? STRING_MOVE_Xx : STRING_COPY_Xx,
Globals.hMainWnd, lpfnDlg); Globals.hMainWnd, (DLGPROC)lpfnDlg);
FreeProcInstance(lpfnDlg); FreeProcInstance(lpfnDlg);
return((ret == IDOK) ? CopyMove.hToGroup : 0); return((ret == IDOK) ? CopyMove.hToGroup : 0);
@ -186,7 +186,7 @@ BOOL DIALOG_GroupAttributes(LPSTR lpszTitle, LPSTR lpszGrpFile, INT nSize)
GroupAttributes.lpszGrpFile = lpszGrpFile; GroupAttributes.lpszGrpFile = lpszGrpFile;
ret = DialogBox(Globals.hInstance, STRING_GROUP_Xx, ret = DialogBox(Globals.hInstance, STRING_GROUP_Xx,
Globals.hMainWnd, lpfnDlg); Globals.hMainWnd, (DLGPROC)lpfnDlg);
FreeProcInstance(lpfnDlg); FreeProcInstance(lpfnDlg);
return(ret == IDOK); return(ret == IDOK);
} }
@ -269,7 +269,7 @@ BOOL DIALOG_ProgramAttributes(LPSTR lpszTitle, LPSTR lpszCmdLine,
lstrcpyn(ProgramAttributes.lpszTmpIconFile, lpszIconFile, MAX_PATHNAME_LEN); lstrcpyn(ProgramAttributes.lpszTmpIconFile, lpszIconFile, MAX_PATHNAME_LEN);
ret = DialogBox(Globals.hInstance, STRING_PROGRAM_Xx, ret = DialogBox(Globals.hInstance, STRING_PROGRAM_Xx,
Globals.hMainWnd, lpfnDlg); Globals.hMainWnd, (DLGPROC)lpfnDlg);
FreeProcInstance(lpfnDlg); FreeProcInstance(lpfnDlg);
return(ret == IDOK); return(ret == IDOK);
@ -391,7 +391,7 @@ VOID DIALOG_Symbol(HICON *lphIcon, LPSTR lpszIconFile,
Symbol.lpnIconIndex = lpnIconIndex; Symbol.lpnIconIndex = lpnIconIndex;
DialogBox(Globals.hInstance, STRING_SYMBOL_Xx, DialogBox(Globals.hInstance, STRING_SYMBOL_Xx,
Globals.hMainWnd, lpfnDlg); Globals.hMainWnd, (DLGPROC)lpfnDlg);
FreeProcInstance(lpfnDlg); FreeProcInstance(lpfnDlg);
} }
@ -476,7 +476,7 @@ VOID DIALOG_Execute()
{ {
WNDPROC lpfnDlg = MakeProcInstance(DIALOG_EXECUTE_DlgProc, Globals.hInstance); WNDPROC lpfnDlg = MakeProcInstance(DIALOG_EXECUTE_DlgProc, Globals.hInstance);
DialogBox(Globals.hInstance, STRING_EXECUTE_Xx, DialogBox(Globals.hInstance, STRING_EXECUTE_Xx,
Globals.hMainWnd, lpfnDlg); Globals.hMainWnd, (DLGPROC)lpfnDlg);
FreeProcInstance(lpfnDlg); FreeProcInstance(lpfnDlg);
} }

View File

@ -5,7 +5,9 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "windows.h" #include "windows.h"
#include "windowsx.h"
#include "progman.h" #include "progman.h"
/*********************************************************************** /***********************************************************************

View File

@ -5,7 +5,9 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "windows.h" #include "windows.h"
#include "windowsx.h"
#include "license.h" #include "license.h"
#include "progman.h" #include "progman.h"
@ -15,6 +17,8 @@
GLOBALS Globals; GLOBALS Globals;
VOID WINAPI WriteOutProfiles16(void);
static VOID MAIN_CreateGroups(void); static VOID MAIN_CreateGroups(void);
static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam); static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
static ATOM MAIN_RegisterMainWinClass(void); static ATOM MAIN_RegisterMainWinClass(void);

View File

@ -4,7 +4,9 @@
* Copyright 1996 Ulrich Schmid * Copyright 1996 Ulrich Schmid
*/ */
#include <string.h>
#include "windows.h" #include "windows.h"
#include "windowsx.h"
#include "progman.h" #include "progman.h"
/*********************************************************************** /***********************************************************************

View File

@ -1,5 +1,6 @@
#include <windows.h> #include <windows.h>
#include "globals.h" #include "globals.h"
#include "resource.h"
/* global variables */ /* global variables */

View File

@ -1,4 +1,5 @@
#include <windows.h> #include <windows.h>
#include "resource.h"
/* /*
#include <windowsx.h> #include <windowsx.h>
@ -183,7 +184,7 @@ HMETAFILE GetPlaceableMetaFile( HWND hwnd, LPCSTR szFileName )
_llseek(fh, sizeof(APMFILEHEADER), 0); _llseek(fh, sizeof(APMFILEHEADER), 0);
if (!_lread(fh, lpData, (UINT)(mfHeader.mtSize * 2L))) if (!_lread(fh, lpData, (UINT)(mfHeader.mtSize * 2L)))
{ {
GlobalFree(lpData); GlobalFree((HGLOBAL)lpData);
_lclose(fh); _lclose(fh);
return 0; return 0;
} }

View File

@ -5,7 +5,9 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "windows.h" #include "windows.h"
#include "windowsx.h"
#include "winhelp.h" #include "winhelp.h"
static void Report(LPCSTR str) static void Report(LPCSTR str)

View File

@ -482,7 +482,7 @@ VOID MACRO_Print(VOID)
printer.hPrintTemplate = 0; printer.hPrintTemplate = 0;
printer.hSetupTemplate = 0; printer.hSetupTemplate = 0;
if (PrintDlg16(&printer)) { if (PrintDlg16((LPPRINTDLG16)&printer)) {
fprintf(stderr, "Print()\n"); fprintf(stderr, "Print()\n");
}; };
} }

View File

@ -177,7 +177,7 @@ VOID MACRO_ExecuteMacro(LPCSTR macro)
if (!lstrcmpi(macro, "MacroTest")) if (!lstrcmpi(macro, "MacroTest"))
{ {
WNDPROC lpfnDlg = MakeProcInstance(MACRO_TestDialogProc, Globals.hInstance); WNDPROC lpfnDlg = MakeProcInstance(MACRO_TestDialogProc, Globals.hInstance);
DialogBox(Globals.hInstance, STRING_DIALOG_TEST, Globals.active_win->hMainWnd, lpfnDlg); DialogBox(Globals.hInstance, STRING_DIALOG_TEST, Globals.active_win->hMainWnd, (DLGPROC)lpfnDlg);
FreeProcInstance(lpfnDlg); FreeProcInstance(lpfnDlg);
macro = szTestMacro; macro = szTestMacro;
} }

View File

@ -5,7 +5,9 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "windows.h" #include "windows.h"
#include "windowsx.h"
#include "winhelp.h" #include "winhelp.h"
#ifdef WINELIB #ifdef WINELIB