diff options
Diffstat (limited to 'src/Fl_File_Chooser2.cxx')
| -rw-r--r-- | src/Fl_File_Chooser2.cxx | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index 60ea840f6..7abc48bc0 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -896,7 +896,7 @@ Fl_File_Chooser::fileNameCB() // Other key pressed - do filename completion as possible... num_files = fileList->size(); - min_match = strlen(filename); + min_match = (int) strlen(filename); max_match = min_match + 1; first_line = 0; @@ -912,7 +912,7 @@ Fl_File_Chooser::fileNameCB() if (!first_line) { // First match; copy stuff over... strlcpy(matchname, file, sizeof(matchname)); - max_match = strlen(matchname); + max_match = (int) strlen(matchname); // Strip trailing /, if any... if (matchname[max_match - 1] == '/') { @@ -950,14 +950,17 @@ Fl_File_Chooser::fileNameCB() fileList->redraw(); } else if (max_match > min_match && first_line) { // Add the matching portion... - fileName->replace(filename - pathname, filename - pathname + min_match, - matchname); + fileName->replace( + (int) (filename - pathname), + (int) (filename - pathname + min_match), + matchname); // Highlight it with the cursor at the end of the selection so // s/he can press the right arrow to accept the selection // (Tab and End also do this for both cases.) - fileName->position(filename - pathname + max_match, - filename - pathname + min_match); + fileName->position( + (int) (filename - pathname + max_match), + (int) (filename - pathname + min_match)); } else if (max_match == 0) { fileList->deselect(0); fileList->redraw(); @@ -1346,7 +1349,7 @@ Fl_File_Chooser::update_preview() if (fp != NULL) { // Try reading the first 1k of data for a label... - bytes = fread(preview_text_, 1, sizeof(preview_text_) - 1, fp); + bytes = (int) fread(preview_text_, 1, sizeof(preview_text_) - 1, fp); preview_text_[bytes] = '\0'; fclose(fp); } else { @@ -1544,7 +1547,7 @@ Fl_File_Chooser::value(const char *filename) if (slash > pathname) slash[-1] = '/'; fileName->value(pathname); - fileName->position(0, strlen(pathname)); + fileName->position(0, (int) strlen(pathname)); okButton->activate(); // Then find the file in the file list and select it... @@ -1610,8 +1613,8 @@ compare_dirnames(const char *a, const char *b) { int alen, blen; // Get length of each string... - alen = strlen(a) - 1; - blen = strlen(b) - 1; + alen = (int) (strlen(a) - 1); + blen = (int) (strlen(b) - 1); if (alen < 0 || blen < 0) return alen - blen; |
