From f09e17c3c564e8310125a10c03397cbf473ff643 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Wed, 1 Jul 2020 18:03:10 +0200 Subject: Remove $Id$ tags, update URL's, and more - remove obsolete svn '$Id$' tags from all source files - update .fl files and generated files accordingly - replace 'http://www.fltk.org' URL's with 'https://...' - replace bug report URL 'str.php' with 'bugs.php' - remove trailing whitespace - fix other whitespace errors flagged by Git - add and/or fix missing or wrong standard headers - convert tabs to spaces in all source files The only relevant code changes are in the fluid/ folder where some .fl files and other source files were used to generate the '$Id' headers and footers. --- src/drivers/Android/Fl_Android_System_Driver.cxx | 114 +++++++++++------------ 1 file changed, 54 insertions(+), 60 deletions(-) (limited to 'src/drivers/Android/Fl_Android_System_Driver.cxx') diff --git a/src/drivers/Android/Fl_Android_System_Driver.cxx b/src/drivers/Android/Fl_Android_System_Driver.cxx index 0c7185370..e6aa970e4 100644 --- a/src/drivers/Android/Fl_Android_System_Driver.cxx +++ b/src/drivers/Android/Fl_Android_System_Driver.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Definition of Android system driver. // // Copyright 2018 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "../../config_lib.h" @@ -95,12 +93,12 @@ extern "C" { Pseudo doxygen docs (static function intentionally not documented): - param[in] utf8 input string (UTF-8) - param[in,out] wbuf in: pointer to output string buffer - out: new string (the pointer may be changed) - param[in] lg optional: input string length (default = -1) + param[in] utf8 input string (UTF-8) + param[in,out] wbuf in: pointer to output string buffer + out: new string (the pointer may be changed) + param[in] lg optional: input string length (default = -1) - returns pointer to string buffer + returns pointer to string buffer */ static wchar_t *utf8_to_wchar(const char *utf8, wchar_t *&wbuf, int lg = -1) { unsigned len = (lg >= 0) ? (unsigned)lg : (unsigned)strlen(utf8); @@ -132,11 +130,11 @@ static wchar_t *utf8_to_wchar(const char *utf8, wchar_t *&wbuf, int lg = -1) { Pseudo doxygen docs (static function intentionally not documented): - param[in] wstr input string (wide character, UTF-16) - param[in,out] utf8 in: pointer to output string buffer - out: new string (pointer may be changed) + param[in] wstr input string (wide character, UTF-16) + param[in,out] utf8 in: pointer to output string buffer + out: new string (pointer may be changed) - returns pointer to string buffer + returns pointer to string buffer */ static char *wchar_to_utf8(const wchar_t *wstr, char *&utf8) { unsigned len = (unsigned)wcslen(wstr); @@ -152,7 +150,7 @@ static char *wchar_to_utf8(const wchar_t *wstr, char *&utf8) { /* Creates a driver that manages all system related calls. - + This function must be implemented once for every platform. */ Fl_System_Driver *Fl_System_Driver::newSystemDriver() @@ -237,7 +235,7 @@ int Fl_WinAPI_System_Driver::execvp(const char *file, char *const *argv) { # else wchar_t **ar; utf8_to_wchar(file, wbuf); - + int i = 0, n = 0; while (argv[i]) {i++; n++;} ar = (wchar_t **)malloc(sizeof(wchar_t *) * (n + 1)); @@ -252,14 +250,14 @@ int Fl_WinAPI_System_Driver::execvp(const char *file, char *const *argv) { i++; } ar[n] = NULL; - _wexecvp(wbuf, ar); // STR #3040 + _wexecvp(wbuf, ar); // STR #3040 i = 0; while (i < n) { free(ar[i]); i++; } free(ar); - return -1; // STR #3040 + return -1; // STR #3040 #endif } @@ -360,7 +358,7 @@ char *fl_locale_to_utf8(const char *s, int len, UINT codepage) } if (codepage < 1) codepage = fl_codepage; buf[l] = 0; - + l = MultiByteToWideChar(codepage, 0, s, len, (WCHAR*)wbufa, buf_len); if (l < 0) l = 0; wbufa[l] = 0; @@ -501,16 +499,16 @@ int Fl_WinAPI_System_Driver::filename_expand(char *to, int tolen, const char *fr char *start = temp; char *end = temp+strlen(temp); int ret = 0; - for (char *a=temp; a from) slash --; if (isdirsep(*slash)) slash ++; - + // do the same for the current dir if (isdirsep(*newslash)) newslash --; if (*newslash != '\0') while (!isdirsep(*newslash) && newslash > cwd) newslash --; - + // prepare the destination buffer to[0] = '\0'; to[tolen - 1] = '\0'; - + // now add a "previous dir" sequence for every following slash in the cwd while (*newslash != '\0') { if (isdirsep(*newslash)) strlcat(to, "../", tolen); newslash ++; } - + // finally add the differing path from "from" strlcat(to, slash, tolen); - + free(cwd_buf); return 1; } @@ -666,9 +664,9 @@ int Fl_WinAPI_System_Driver::filename_absolute(char *to, int tolen, const char * int Fl_WinAPI_System_Driver::filename_isdir(const char *n) { - struct _stat s; - char fn[FL_PATH_MAX]; - int length; + struct _stat s; + char fn[FL_PATH_MAX]; + int length; length = (int) strlen(n); // This workaround brought to you by the fine folks at Microsoft! // (read lots of sarcasm in that...) @@ -709,7 +707,7 @@ const char *Fl_WinAPI_System_Driver::filename_ext(const char *buf) { int Fl_WinAPI_System_Driver::open_uri(const char *uri, char *msg, int msglen) { - if (msg) snprintf(msg, msglen, "open %s", uri); + if (msg) snprintf(msg, msglen, "open %s", uri); return (int)(ShellExecute(HWND_DESKTOP, "open", uri, NULL, NULL, SW_SHOW) > (void *)32); } @@ -732,7 +730,7 @@ int Fl_WinAPI_System_Driver::file_browser_load_filesystem(Fl_File_Browser *brows // // Normal Windows code uses drive bits... // - DWORD drives; // Drive available bits + DWORD drives; // Drive available bits drives = GetLogicalDrives(); for (int i = 'A'; i <= 'Z'; i ++, drives >>= 1) if (drives & 1) @@ -771,19 +769,19 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) UUID ud; UUID *pu = &ud; int got_uuid = 0; - - if (!hMod) { // first time in? + + if (!hMod) { // first time in? hMod = LoadLibrary("Rpcrt4.dll"); } - - if (hMod) { // do we have a usable handle to Rpcrt4.dll? + + if (hMod) { // do we have a usable handle to Rpcrt4.dll? uuid_func uuid_crt = (uuid_func)GetProcAddress(hMod, "UuidCreate"); if (uuid_crt != NULL) { RPC_STATUS rpc_res = uuid_crt(pu); if ( // is the return status OK for our needs? - (rpc_res == RPC_S_OK) || // all is well + (rpc_res == RPC_S_OK) || // all is well (rpc_res == RPC_S_UUID_LOCAL_ONLY) || // only unique to this machine - (rpc_res == RPC_S_UUID_NO_ADDRESS) // probably only locally unique + (rpc_res == RPC_S_UUID_NO_ADDRESS) // probably only locally unique ) { got_uuid = -1; sprintf(uuidBuffer, "%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", @@ -793,14 +791,14 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) } } } - if (got_uuid == 0) { // did not make a UUID - use fallback logic + if (got_uuid == 0) { // did not make a UUID - use fallback logic unsigned char b[16]; - time_t t = time(0); // first 4 byte + time_t t = time(0); // first 4 byte b[0] = (unsigned char)t; b[1] = (unsigned char)(t>>8); b[2] = (unsigned char)(t>>16); b[3] = (unsigned char)(t>>24); - int r = rand(); // four more bytes + int r = rand(); // four more bytes b[4] = (unsigned char)r; b[5] = (unsigned char)(r>>8); b[6] = (unsigned char)(r>>16); @@ -834,8 +832,8 @@ void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer) char *Fl_WinAPI_System_Driver::preference_rootnode(Fl_Preferences *prefs, Fl_Preferences::Root root, const char *vendor, const char *application) { -# define FLPREFS_RESOURCE "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" -# define FLPREFS_RESOURCEW L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" +# define FLPREFS_RESOURCE "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" +# define FLPREFS_RESOURCEW L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" static char filename[ FL_PATH_MAX ]; filename[0] = 0; size_t appDataLen = strlen(vendor) + strlen(application) + 8; @@ -941,7 +939,3 @@ void Fl_WinAPI_System_Driver::gettime(time_t *sec, int *usec) { } #endif - -// -// End of "$Id$". -// -- cgit v1.2.3