diff win/browser.c @ 2034:89d62197124b

Visual C in C++ mode complains about missing const declarations in paramaters. So adding const to any string parameters which are not written to. Probably going to require changes to the other platforms due to header changes.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 17 Nov 2019 03:13:37 +0000
parents 8a11bb8ec347
children cb195d76de8e
line wrap: on
line diff
--- a/win/browser.c	Sat Nov 16 09:43:17 2019 +0000
+++ b/win/browser.c	Sun Nov 17 03:13:37 2019 +0000
@@ -32,8 +32,8 @@
 #include "dw.h"
 
 /* Import the character conversion functions from dw.c */
-LPWSTR _myUTF8toWide(char *utf8string, void *outbuf);
-char *_myWideToUTF8(LPWSTR widestring, void *outbuf);
+LPWSTR _myUTF8toWide(const char *utf8string, void *outbuf);
+char *_myWideToUTF8(LPCWSTR widestring, void *outbuf);
 #define UTF8toWide(a) _myUTF8toWide(a, a ? _alloca(MultiByteToWideChar(CP_UTF8, 0, a, -1, NULL, 0) * sizeof(WCHAR)) : NULL)
 #define WideToUTF8(a) _myWideToUTF8(a, a ? _alloca(WideCharToMultiByte(CP_UTF8, 0, a, -1, NULL, 0, NULL, NULL)) : NULL)
 LRESULT CALLBACK _wndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2);
@@ -1362,7 +1362,7 @@
  * this function to display numerous pages in the specified window.
  */
 
-int _dw_html_raw(HWND hwnd, char *string)
+int _dw_html_raw(HWND hwnd, const char *string)
 {	
 	IWebBrowser2	*webBrowser2;
 	LPDISPATCH		lpDispatch;
@@ -1487,7 +1487,7 @@
  * this function to display numerous pages in the specified window.
  */
 
-int _dw_html_url(HWND hwnd, char *url)
+int _dw_html_url(HWND hwnd, const char *url)
 {
 	IWebBrowser2	*webBrowser2;
 	VARIANT			myURL;
@@ -1557,7 +1557,7 @@
  * RETURNS: 0 if success, or non-zero if an error.
  */
 
-int _dw_html_javascript_run(HWND hwnd, char *script, void *scriptdata)
+int _dw_html_javascript_run(HWND hwnd, const char *script, void *scriptdata)
 {
 	IWebBrowser2	*webBrowser2;
 	IHTMLWindow2	*htmlWindow2;