diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2021-08-30 22:00:59 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2021-08-30 23:45:16 +0200 |
| commit | 1a8b94162da0a9eab88813d6b1928b483b7990eb (patch) | |
| tree | 5b46e2e0ef435d32c5e8bf9e6806275434c1d9f4 /fluid/ExternalCodeEditor_WIN32.cxx | |
| parent | ed3ec2d036675601f612bb9f45ad9e9b731699f3 (diff) | |
Fix Windows (VS) compiler warnings in fluid
Diffstat (limited to 'fluid/ExternalCodeEditor_WIN32.cxx')
| -rw-r--r-- | fluid/ExternalCodeEditor_WIN32.cxx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/fluid/ExternalCodeEditor_WIN32.cxx b/fluid/ExternalCodeEditor_WIN32.cxx index 06d68689d..a137b3e6f 100644 --- a/fluid/ExternalCodeEditor_WIN32.cxx +++ b/fluid/ExternalCodeEditor_WIN32.cxx @@ -1,6 +1,19 @@ // -// External code editor management class for Windows +// External code editor management class for Windows // +// Copyright 1998-2021 by Bill Spitzak and others. +// +// This library is free software. Distribution and use rights are outlined in +// the file "COPYING" which should have been included with this file. If this +// file is missing or damaged, see the license at: +// +// https://www.fltk.org/COPYING.php +// +// Please see the following page on how to report bugs and issues: +// +// https://www.fltk.org/bugs.php +// + // Note: This entire file Windows only. #include <FL/Fl.H> // Fl_Timeout_Handler.. @@ -243,8 +256,8 @@ int ExternalCodeEditor::handle_changes(const char **code, int force) { // Changes? Load file. Be sure to fallthru to CloseHandle() int ret = 0; if ( changed || force ) { - size_t buflen = size_t(fsize.QuadPart); - char *buf = (char*)malloc(buflen + 1); + DWORD buflen = (DWORD)fsize.QuadPart; + char *buf = (char*)malloc((size_t)buflen + 1); DWORD count; if ( ReadFile(fh, buf, buflen, &count, 0) == 0 ) { fl_alert("ERROR: ReadFile() failed for %s: %s", @@ -378,7 +391,7 @@ static int save_file(const char *filename, return(-1); } // Write the file, being careful to CloseHandle() even on errs - DWORD clen = strlen(code); + DWORD clen = (DWORD)strlen(code); DWORD count = 0; int ret = 0; if ( WriteFile(fh, code, clen, &count, NULL) == 0 ) { |
