diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_Help_View.cxx | 181 | ||||
| -rw-r--r-- | src/Fl_Image.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_JPEG_Image.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_Menu.cxx | 94 | ||||
| -rw-r--r-- | src/Fl_Menu_.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_Tooltip.cxx | 10 | ||||
| -rw-r--r-- | src/Fl_Widget.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_add_idle.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_lock.cxx | 8 | ||||
| -rw-r--r-- | src/drivers/Base/Fl_Base_Pen_Events.cxx | 10 | ||||
| -rw-r--r-- | src/drivers/Posix/Fl_Posix_System_Driver.cxx | 2 | ||||
| -rw-r--r-- | src/fl_utf8.cxx | 4 |
13 files changed, 163 insertions, 166 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index 07e107b1d..368e330a6 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -642,7 +642,7 @@ void (*Fl::Private::idle_)(); // see Fl::add_idle.cxx for the add/remove functio \retval false No idle callback is currently set. */ bool Fl::idle() { - return (Private::idle_ != nullptr); + return (Private::idle_ != 0); } /* diff --git a/src/Fl_Help_View.cxx b/src/Fl_Help_View.cxx index 8ebcceecc..0b55393ee 100644 --- a/src/Fl_Help_View.cxx +++ b/src/Fl_Help_View.cxx @@ -66,7 +66,7 @@ // Constants // -static constexpr int MAX_COLUMNS = 200; +static const int MAX_COLUMNS = 200; // // Implementation class @@ -86,7 +86,7 @@ public: linkcolor_ = FL_SELECTION_COLOR; textfont_ = FL_TIMES; textsize_ = 12; - value_ = nullptr; + value_ = 0; blocks_.clear(); @@ -102,7 +102,7 @@ public: size_ = 0; hsize_ = 0; - selection_mode_ = Mode::DRAW; + selection_mode_ = MODE_DRAW; selected_ = false; selection_first_ = 0; selection_last_ = 0; @@ -185,8 +185,8 @@ public: std::vector<Font_Style> elts_; ///< font elements }; - enum class Align { RIGHT = -1, CENTER, LEFT }; ///< Alignments - enum class Mode { DRAW, PUSH, DRAG }; ///< Draw modes + enum { ALIGN_RIGHT = -1, ALIGN_CENTER, ALIGN_LEFT }; ///< Alignments + enum { MODE_DRAW, MODE_PUSH, MODE_DRAG }; ///< Draw modes private: // data members @@ -220,7 +220,7 @@ public: // Text selection and mouse handling - Mode selection_mode_; ///< Remember election mode between FL_PUSH, FL_DRAG, and FL_RELEASE + int selection_mode_; ///< Remember election mode between FL_PUSH, FL_DRAG, and FL_RELEASE bool selected_; ///< True if there is text selected int selection_first_; ///< First character of selection, offset in value_ int selection_last_; ///< Last character of selection, offset in value_ @@ -231,7 +231,7 @@ public: static int selection_push_last_; ///< Last character of selection during mouse down static int selection_drag_first_; ///< First character of selection during mouse drag static int selection_drag_last_; ///< Last character of selection during mouse drag - static Mode draw_mode_; ///< Temporarily modify `draw()` method to measure selection start or end during `handle()` + static int draw_mode_; ///< Temporarily modify `draw()` method to measure selection start or end during `handle()` static int current_pos_; ///< Temporarily store text offset while measuring during `handle()` // Callback @@ -255,10 +255,10 @@ public: Text_Block *add_block(const char *s, int xx, int yy, int ww, int hh, uchar border = 0); void add_link(const std::string &link, int xx, int yy, int ww, int hh); void add_target(const std::string &n, int yy); - int do_align(Text_Block *block, int line, int xx, Align a, int &l); + int do_align(Text_Block *block, int line, int xx, int a, int &l); void format(); void format_table(int *table_width, int *columns, const char *table); - Align get_align(const char *p, Align a); + int get_align(const char *p, int a); const char *get_attr(const char *p, const char *n, char *buf, int bufsize); Fl_Color get_color(const char *n, Fl_Color c); Fl_Shared_Image *get_image(const char *name, int W, int H); @@ -361,7 +361,7 @@ int Fl_Help_View::Impl::selection_push_first_ = 0; int Fl_Help_View::Impl::selection_push_last_ = 0; int Fl_Help_View::Impl::selection_drag_first_ = 0; int Fl_Help_View::Impl::selection_drag_last_ = 0; -Fl_Help_View::Impl::Mode Fl_Help_View::Impl::draw_mode_ = Mode::DRAW; +int Fl_Help_View::Impl::draw_mode_ = MODE_DRAW; int Fl_Help_View::Impl::current_pos_ = 0; // @@ -374,10 +374,7 @@ static size_t url_scheme(const std::string &url, bool skip_slashes=false); static const char *vanilla(const char *p, const char *end); static uint32_t command(const char *cmd); -static constexpr uint32_t CMD(char a, char b, char c, char d) -{ - return ((a<<24)|(b<<16)|(c<<8)|d); -} +#define CMD(a, b, c, d) (((uint32_t)(a)<<24)|((uint32_t)(b)<<16)|((uint32_t)(c)<<8)|(uint32_t)(d)) // // Static data. @@ -416,7 +413,7 @@ static const char * const broken_xpm[] = "@ @", "@ @", "@@@@@@@@@@@@@@@@", - nullptr + 0 }; static Fl_Pixmap broken_image(broken_xpm); @@ -425,8 +422,8 @@ static Fl_Pixmap broken_image(broken_xpm); const char *Fl_Help_View::copy_menu_text = "Copy"; static Fl_Menu_Item rmb_menu[] = { - { nullptr, 0, nullptr, (void*)1 }, // Copy - { nullptr } + { 0, 0, 0, (void*)1 }, // Copy + { 0 } }; // @@ -618,7 +615,7 @@ void Fl_Help_View::Impl::free_data() { { // Comment... ptr += 3; - if ((ptr = strstr(ptr, "-->")) != nullptr) + if ((ptr = strstr(ptr, "-->")) != 0) { ptr += 3; continue; @@ -676,7 +673,7 @@ void Fl_Help_View::Impl::free_data() { /** \brief Find out if the mouse is over a hyperlink and return the link data. \parm[in] xx, yy Pixel coordinates inside the widget. - \return Shared pointer to the link if found, nullptr otherwise. + \return Shared pointer to the link if found, 0 otherwise. */ std::shared_ptr<Fl_Help_View::Impl::Link> Fl_Help_View::Impl::find_link(int xx, int yy) { @@ -685,7 +682,7 @@ std::shared_ptr<Fl_Help_View::Impl::Link> Fl_Help_View::Impl::find_link(int xx, return link; } } - return nullptr; + return 0; } @@ -840,17 +837,17 @@ int Fl_Help_View::Impl::do_align( Text_Block *block, int line, int xx, - Align a, + int a, int &l) { int offset; // Alignment offset switch (a) { - case Align::RIGHT: // Right align + case ALIGN_RIGHT: // Right align offset = block->w - xx; break; - case Align::CENTER: // Center + case ALIGN_CENTER: // Center offset = (block->w - xx) / 2; break; default: // Left align @@ -886,7 +883,7 @@ int Fl_Help_View::Impl::do_align( void Fl_Help_View::Impl::format() { int i; // Looping var int done; // Are we done yet? - Text_Block *block = nullptr, // Current block + Text_Block *block = 0, // Current block *cell; // Current table cell int cells[MAX_COLUMNS], // Cells in the current row... @@ -906,8 +903,8 @@ void Fl_Help_View::Impl::format() { Fl_Fontsize fsize; // Current font and size Fl_Color fcolor; // Current font color unsigned char border; // Draw border? - Align talign; // Current alignment - Align newalign; // New alignment + int talign; // Current alignment + int newalign; // New alignment int head, // In the <HEAD> section? pre, // <PRE> text? needspace; // Do we need whitespace? @@ -966,8 +963,8 @@ void Fl_Help_View::Impl::format() { row = 0; head = 0; pre = 0; - talign = Align::LEFT; - newalign = Align::LEFT; + talign = ALIGN_LEFT; + newalign = ALIGN_LEFT; needspace = 0; linkdest[0] = '\0'; table_offset = 0; @@ -1074,7 +1071,7 @@ void Fl_Help_View::Impl::format() { { // Comment... ptr += 3; - if ((ptr = strstr(ptr, "-->")) != nullptr) + if ((ptr = strstr(ptr, "-->")) != 0) { ptr += 3; continue; @@ -1108,10 +1105,10 @@ void Fl_Help_View::Impl::format() { } else if (buf.cmp("A")) { - if (get_attr(attrs, "NAME", attr, sizeof(attr)) != nullptr) + if (get_attr(attrs, "NAME", attr, sizeof(attr)) != 0) add_target(attr, yy - fsize - 2); - if (get_attr(attrs, "HREF", attr, sizeof(attr)) != nullptr) + if (get_attr(attrs, "HREF", attr, sizeof(attr)) != 0) strlcpy(linkdest, attr, sizeof(linkdest)); } else if (buf.cmp("/A")) @@ -1153,13 +1150,13 @@ void Fl_Help_View::Impl::format() { { block->end = start; line = do_align(block, line, xx, newalign, links); - newalign = buf.cmp("CENTER") ? Align::CENTER : Align::LEFT; + newalign = buf.cmp("CENTER") ? ALIGN_CENTER : ALIGN_LEFT; xx = block->x; block->h += hh; if (buf.cmp("OL")) { int ol_num = 1; - if (get_attr(attrs, "START", attr, sizeof(attr)) != nullptr) { + if (get_attr(attrs, "START", attr, sizeof(attr)) != 0) { errno = 0; char *endptr = 0; ol_num = (int)strtol(attr, &endptr, 10); @@ -1207,11 +1204,11 @@ void Fl_Help_View::Impl::format() { table_offset = 0; break; - case Align::CENTER : + case ALIGN_CENTER : table_offset = (hsize_ - table_width) / 2 - textsize_; break; - case Align::RIGHT : + case ALIGN_RIGHT : table_offset = hsize_ - table_width - textsize_; break; } @@ -1275,7 +1272,7 @@ void Fl_Help_View::Impl::format() { line = 0; if (buf.cmp("CENTER")) - newalign = talign = Align::CENTER; + newalign = talign = ALIGN_CENTER; else newalign = get_align(attrs, talign); } @@ -1320,7 +1317,7 @@ void Fl_Help_View::Impl::format() { hh = 0; } else if (buf.cmp("/CENTER")) - talign = Align::LEFT; + talign = ALIGN_LEFT; popfont(font, fsize, fcolor); @@ -1390,7 +1387,7 @@ void Fl_Help_View::Impl::format() { line = do_align(block, line, xx, newalign, links); block->end = start; block->h += hh; - talign = Align::LEFT; + talign = ALIGN_LEFT; xx = blocks_[row].x; yy = blocks_[row].y + blocks_[row].h; @@ -1439,7 +1436,7 @@ void Fl_Help_View::Impl::format() { margins.push(xx - margins.current()); - if (get_attr(attrs, "COLSPAN", attr, sizeof(attr)) != nullptr) + if (get_attr(attrs, "COLSPAN", attr, sizeof(attr)) != 0) colspan = atoi(attr); else colspan = 1; @@ -1460,7 +1457,7 @@ void Fl_Help_View::Impl::format() { block = add_block(start, xx, yy, xx + ww, 0, border); needspace = 0; line = 0; - newalign = get_align(attrs, tolower(buf[1]) == 'h' ? Align::CENTER : Align::LEFT); + newalign = get_align(attrs, tolower(buf[1]) == 'h' ? ALIGN_CENTER : ALIGN_LEFT); talign = newalign; cells[column] = (int) (block - &blocks_[0]); @@ -1476,11 +1473,11 @@ void Fl_Help_View::Impl::format() { line = do_align(block, line, xx, newalign, links); popfont(font, fsize, fcolor); xx = margins.pop(); - talign = Align::LEFT; + talign = ALIGN_LEFT; } else if (buf.cmp("FONT")) { - if (get_attr(attrs, "FACE", attr, sizeof(attr)) != nullptr) { + if (get_attr(attrs, "FACE", attr, sizeof(attr)) != 0) { if (!strncasecmp(attr, "helvetica", 9) || !strncasecmp(attr, "arial", 5) || !strncasecmp(attr, "sans", 4)) font = FL_HELVETICA; @@ -1490,7 +1487,7 @@ void Fl_Help_View::Impl::format() { else font = FL_COURIER; } - if (get_attr(attrs, "SIZE", attr, sizeof(attr)) != nullptr) { + if (get_attr(attrs, "SIZE", attr, sizeof(attr)) != 0) { if (isdigit(attr[0] & 255)) { // Absolute size fsize = (int)(textsize_ * pow(1.2, atoi(attr) - 3.0)); @@ -1932,7 +1929,7 @@ void Fl_Help_View::Impl::format_table( else column ++; - if (get_attr(attrs, "COLSPAN", attr, sizeof(attr)) != nullptr) + if (get_attr(attrs, "COLSPAN", attr, sizeof(attr)) != 0) colspan = atoi(attr); else colspan = 1; @@ -1956,7 +1953,7 @@ void Fl_Help_View::Impl::format_table( pushfont(font, fsize); - if (get_attr(attrs, "WIDTH", attr, sizeof(attr)) != nullptr) + if (get_attr(attrs, "WIDTH", attr, sizeof(attr)) != 0) max_width = get_length(attr); else max_width = 0; @@ -2150,19 +2147,19 @@ void Fl_Help_View::Impl::format_table( \param[in] a Default alignment. \return Alignment value, either CENTER, RIGHT, or LEFT. */ -Fl_Help_View::Impl::Align Fl_Help_View::Impl::get_align(const char *p, Align a) +int Fl_Help_View::Impl::get_align(const char *p, int a) { char buf[255]; // Alignment value - if (get_attr(p, "ALIGN", buf, sizeof(buf)) == nullptr) + if (get_attr(p, "ALIGN", buf, sizeof(buf)) == 0) return (a); if (strcasecmp(buf, "CENTER") == 0) - return Align::CENTER; + return ALIGN_CENTER; else if (strcasecmp(buf, "RIGHT") == 0) - return Align::RIGHT; + return ALIGN_RIGHT; else - return Align::LEFT; + return ALIGN_LEFT; } @@ -2172,7 +2169,7 @@ Fl_Help_View::Impl::Align Fl_Help_View::Impl::get_align(const char *p, Align a) \param[in] n Name of attribute. \param[out] buf Buffer for attribute value. \param[in] bufsize Size of buffer. - \return Pointer to buf or nullptr if not found. + \return Pointer to buf or 0 if not found. */ const char *Fl_Help_View::Impl::get_attr( const char *p, @@ -2193,7 +2190,7 @@ const char *Fl_Help_View::Impl::get_attr( p ++; if (*p == '>' || !*p) - return (nullptr); + return (0); for (ptr = name; *p && !isspace((*p)&255) && *p != '=' && *p != '>';) if (ptr < (name + sizeof(name) - 1)) @@ -2238,10 +2235,10 @@ const char *Fl_Help_View::Impl::get_attr( buf[0] = '\0'; if (*p == '>') - return (nullptr); + return (0); } - return (nullptr); + return (0); } @@ -2285,7 +2282,7 @@ Fl_Color Fl_Help_View::Impl::get_color(const char *n, Fl_Color c) if (n[0] == '#') { // Do hex color lookup - rgb = (int)strtol(n + 1, nullptr, 16); + rgb = (int)strtol(n + 1, 0, 16); if (strlen(n) > 4) { r = rgb >> 16; @@ -2392,7 +2389,7 @@ Fl_Shared_Image *Fl_Help_View::Impl::get_image(const char *name, int W, int H) } if (link_) { const char *n = (*link_)(&view, url.c_str()); - if (n == nullptr) + if (n == 0) return 0; url = n; } @@ -2404,11 +2401,11 @@ Fl_Shared_Image *Fl_Help_View::Impl::get_image(const char *name, int W, int H) } if (initial_load) { - if ((ip = Fl_Shared_Image::get(url.c_str(), W, H)) == nullptr) { + if ((ip = Fl_Shared_Image::get(url.c_str(), W, H)) == 0) { ip = (Fl_Shared_Image *)&broken_image; } } else { // draw or resize - if ((ip = Fl_Shared_Image::find(url.c_str(), W, H)) == nullptr) { + if ((ip = Fl_Shared_Image::find(url.c_str(), W, H)) == 0) { ip = (Fl_Shared_Image *)&broken_image; } else { ip->release(); @@ -2472,7 +2469,7 @@ int Fl_Help_View::Impl::get_length(const char *l) { */ void Fl_Help_View::Impl::hv_draw(const char *t, int x, int y, int entity_extra_length) { - if (draw_mode_ == Mode::DRAW) { + if (draw_mode_ == MODE_DRAW) { if (selected_ && current_pos_<selection_last_ && current_pos_>=selection_first_) { Fl_Color c = fl_color(); fl_color(tmp_selection_color_); @@ -2494,10 +2491,10 @@ void Fl_Help_View::Impl::hv_draw(const char *t, int x, int y, int entity_extra_l if ( (Fl::event_y() >= y-fl_height()+fl_descent()) && (Fl::event_y() <= y+fl_descent()) ) { int f = (int) current_pos_; int l = (int) (f+strlen(t)); // use 'quote_char' to calculate the true length of the HTML string - if (draw_mode_ == Mode::PUSH) { + if (draw_mode_ == MODE_PUSH) { selection_push_first_ = selection_drag_first_ = f; selection_push_last_ = selection_drag_last_ = l; - } else { // Mode::DRAG + } else { // MODE_DRAG selection_drag_first_ = f; selection_drag_last_ = l + entity_extra_length; } @@ -2524,13 +2521,13 @@ char Fl_Help_View::Impl::begin_selection() if (!fl_help_view_buffer) fl_help_view_buffer = fl_create_offscreen(1, 1); - draw_mode_ = Mode::PUSH; + draw_mode_ = MODE_PUSH; fl_begin_offscreen(fl_help_view_buffer); draw(); fl_end_offscreen(); - draw_mode_ = Mode::DRAW; + draw_mode_ = MODE_DRAW; if (selection_push_last_) return 1; else return 0; @@ -2559,13 +2556,13 @@ char Fl_Help_View::Impl::extend_selection() selected_ = true; - draw_mode_ = Mode::DRAG; + draw_mode_ = MODE_DRAG; fl_begin_offscreen(fl_help_view_buffer); draw(); fl_end_offscreen(); - draw_mode_ = Mode::DRAW; + draw_mode_ = MODE_DRAW; if (selection_push_first_ < selection_drag_first_) { selection_first_ = selection_push_first_; @@ -2817,7 +2814,7 @@ void Fl_Help_View::Impl::draw() { // Comment... ptr += 3; - if ((ptr = strstr(ptr, "-->")) != nullptr) + if ((ptr = strstr(ptr, "-->")) != 0) { ptr += 3; continue; @@ -2910,7 +2907,7 @@ void Fl_Help_View::Impl::draw() buf.clear(); } else if (buf.cmp("A") && - get_attr(attrs, "HREF", attr, sizeof(attr)) != nullptr) + get_attr(attrs, "HREF", attr, sizeof(attr)) != 0) { fl_color(linkcolor_); underline = 1; @@ -2922,11 +2919,11 @@ void Fl_Help_View::Impl::draw() } else if (buf.cmp("FONT")) { - if (get_attr(attrs, "COLOR", attr, sizeof(attr)) != nullptr) { + if (get_attr(attrs, "COLOR", attr, sizeof(attr)) != 0) { textcolor_ = get_color(attr, textcolor_); } - if (get_attr(attrs, "FACE", attr, sizeof(attr)) != nullptr) { + if (get_attr(attrs, "FACE", attr, sizeof(attr)) != 0) { if (!strncasecmp(attr, "helvetica", 9) || !strncasecmp(attr, "arial", 5) || !strncasecmp(attr, "sans", 4)) font = FL_HELVETICA; @@ -2936,7 +2933,7 @@ void Fl_Help_View::Impl::draw() else font = FL_COURIER; } - if (get_attr(attrs, "SIZE", attr, sizeof(attr)) != nullptr) { + if (get_attr(attrs, "SIZE", attr, sizeof(attr)) != 0) { if (isdigit(attr[0] & 255)) { // Absolute size fsize = (int)(textsize_ * pow(1.2, atof(attr) - 3.0)); @@ -3050,7 +3047,7 @@ void Fl_Help_View::Impl::draw() } if (!width || !height) { - if (get_attr(attrs, "ALT", attr, sizeof(attr)) == nullptr) { + if (get_attr(attrs, "ALT", attr, sizeof(attr)) == 0) { strcpy(attr, "IMG"); } } @@ -3179,7 +3176,7 @@ void Fl_Help_View::Impl::draw() /** \brief Creates the Fl_Help_View widget at the specified position and size. \param[in] xx, yy, ww, hh Position and size of the widget - \param[in] l Label for the widget, can be nullptr + \param[in] l Label for the widget, can be 0 */ Fl_Help_View::Fl_Help_View(int xx, int yy, int ww, int hh, const char *l) : Fl_Group(xx, yy, ww, hh, l), @@ -3237,7 +3234,7 @@ int Fl_Help_View::handle(int event) */ int Fl_Help_View::Impl::handle(int event) { - static std::shared_ptr<Link> linkp = nullptr; // currently clicked link + static std::shared_ptr<Link> linkp = 0; // currently clicked link int xx = Fl::event_x() - view.x() + leftline_; int yy = Fl::event_y() - view.y() + topline_; @@ -3292,7 +3289,7 @@ int Fl_Help_View::Impl::handle(int event) } // If nothing else, the user cancels the current selection and might start a new one if (begin_selection()) { - selection_mode_ = Mode::PUSH; + selection_mode_ = MODE_PUSH; fl_cursor(FL_CURSOR_INSERT); return 1; } @@ -3308,13 +3305,13 @@ int Fl_Help_View::Impl::handle(int event) // No longer just a click, so we cancel the link and start a drag selection linkp = 0; if (begin_selection()) { - selection_mode_ = Mode::PUSH; + selection_mode_ = MODE_PUSH; fl_cursor(FL_CURSOR_INSERT); } } } // If the FL_PUSH started a selection, we extend the selection - if (selection_mode_ == Mode::PUSH) { + if (selection_mode_ == MODE_PUSH) { if (extend_selection()) view.redraw(); fl_cursor(FL_CURSOR_INSERT); @@ -3334,9 +3331,9 @@ int Fl_Help_View::Impl::handle(int event) return 1; } // If in a selection process, end the selection. - if (selection_mode_ == Mode::PUSH) { + if (selection_mode_ == MODE_PUSH) { end_selection(); - selection_mode_ = Mode::DRAW; + selection_mode_ = MODE_DRAW; return 1; } // Nothing to do. @@ -3393,9 +3390,9 @@ void Fl_Help_View::Impl::resize(int xx, int yy, int ww, int hh) The provided character string \p val is copied internally and will be freed when value() is called again, or when the widget is destroyed. - If \p val is nullptr, then the widget is cleared. + If \p val is 0, then the widget is cleared. - \param[in] val Text to view, or nullptr to clear the widget, + \param[in] val Text to view, or 0 to clear the widget, Fl_Help_View will creat a local copy of the string. */ void Fl_Help_View::value(const char *val) { @@ -3484,7 +3481,7 @@ int Fl_Help_View::Impl::load(const char *f) if (link_) { const char *n = (*link_)(&view, newname.c_str()); - if (n == nullptr) + if (n == 0) return 0; localname = n; } else { @@ -3527,7 +3524,7 @@ int Fl_Help_View::Impl::load(const char *f) if (link_) { const char *n = (*link_)(&view, newname.c_str()); - if (n == nullptr) + if (n == 0) return -1; localname = n; } else { @@ -3553,7 +3550,7 @@ int Fl_Help_View::Impl::load(const char *f) } int ret = 0; - if ((fp = fl_fopen(localname.c_str(), "rb")) != nullptr) + if ((fp = fl_fopen(localname.c_str(), "rb")) != 0) { fseek(fp, 0, SEEK_END); len = ftell(fp); @@ -3677,7 +3674,7 @@ int Fl_Help_View::Impl::find(const char *s, int p) //printf("%ld text match %c/%c\n", bp-value_, *sp, c); sp++; bp = vanilla(bp+1, b->end); - } else if (is_html_entity && fl_utf8decode(sp, nullptr, &utf_len) == (unsigned int)c ) { + } else if (is_html_entity && fl_utf8decode(sp, 0, &utf_len) == (unsigned int)c ) { // Check if a < entity ini html matches a UTF-8 character in the // search string. //printf("%ld unicode match 0x%02X 0x%02X\n", bp-value_, *sp, c); @@ -3716,7 +3713,7 @@ int Fl_Help_View::Impl::find(const char *s, int p) The callback function receives a pointer to the Fl_Help_View widget and the URI or full pathname for the file in question. - It must return a pathname that can be opened as a local file or nullptr: + It must return a pathname that can be opened as a local file or 0: \code const char *fn(Fl_Widget *w, const char *uri); @@ -3724,12 +3721,12 @@ int Fl_Help_View::Impl::find(const char *s, int p) The link function can be used to retrieve remote or virtual documents, returning a temporary file that contains the actual - data. If the link function returns nullptr, the value of + data. If the link function returns 0, the value of the Fl_Help_View widget will remain unchanged. If the link callback cannot handle the URI scheme, it should return the uri value unchanged or set the value() of the widget - before returning nullptr. + before returning 0. \param[in] fn Pointer to the callback function */ @@ -3753,7 +3750,7 @@ void Fl_Help_View::Impl::link(Fl_Help_Func *fn) Fl_Help_View remains the owner of the allocated memory. If the filename changes, the returned pointer will become stale. - \return nullptr if the filename is empty + \return 0 if the filename is empty */ const char *Fl_Help_View::filename() const { return impl_->filename(); // Ensure the filename is up to date @@ -3765,7 +3762,7 @@ const char *Fl_Help_View::filename() const { */ const char *Fl_Help_View::Impl::filename() const { if (filename_.empty()) - return nullptr; + return 0; else return filename_.c_str(); } @@ -3777,7 +3774,7 @@ const char *Fl_Help_View::Impl::filename() const { Fl_Help_View remains the owner of the allocated memory. If the directory changes, the returned pointer will become stale. - \return nullptr if the directory name is empty + \return 0 if the directory name is empty */ const char *Fl_Help_View::directory() const { return impl_->directory(); // Ensure the directory is up to date @@ -3789,7 +3786,7 @@ const char *Fl_Help_View::directory() const { */ const char *Fl_Help_View::Impl::directory() const { if (directory_.empty()) - return nullptr; + return 0; else return directory_.c_str(); } @@ -4339,7 +4336,7 @@ static int quote_char(const char *p) { if (!strchr(p, ';')) return -1; if (*p == '#') { if (*(p+1) == 'x' || *(p+1) == 'X') { - return (int)strtol(p+2, nullptr, 16); + return (int)strtol(p+2, 0, 16); } else { return atoi(p+1); } diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx index 4727da018..aa4837d26 100644 --- a/src/Fl_Image.cxx +++ b/src/Fl_Image.cxx @@ -634,7 +634,7 @@ Fl_RGB_Image *Fl_RGB_Image::copy_scale_down_2h_() const { int H = data_h(); int D = d(); int LD = ld() ? ld() : data_w()*D; - if ((W==0) || (H==0) || (D==0)) return nullptr; + if ((W==0) || (H==0) || (D==0)) return 0; uchar *data = (uchar*)malloc(W*H*D); uchar *dst = data; for (int y = 0; y < H; y++) { @@ -680,7 +680,7 @@ Fl_RGB_Image *Fl_RGB_Image::copy_scale_down_2v_() const { int H = data_h()/2; int D = d(); int LD = ld() ? ld() : data_w()*D; - if ((W==0) || (H==0) || (D==0)) return nullptr; + if ((W==0) || (H==0) || (D==0)) return 0; uchar *data = (uchar*)malloc(W*H*D); uchar *dst = data; for (int y = 0; y < H; y++) { @@ -726,7 +726,7 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) const { return copy_optimize_(W, H); } // Negative scaling returns no image - if (W <= 0 || H <= 0) return nullptr; + if (W <= 0 || H <= 0) return 0; if (Fl_Image::RGB_scaling() == FL_RGB_SCALING_NEAREST) { return copy_nearest_neighbor_(W, H); } else { diff --git a/src/Fl_JPEG_Image.cxx b/src/Fl_JPEG_Image.cxx index 6f1e260f3..b7bb59729 100644 --- a/src/Fl_JPEG_Image.cxx +++ b/src/Fl_JPEG_Image.cxx @@ -219,7 +219,7 @@ struct load_stat { int max_destroy_decompress_err; // ... to avoid recursion and deadlock load_stat() { // c'tor - fp = nullptr; + fp = 0; max_finish_decompress_err = 5; max_destroy_decompress_err = 5; } diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index 94d7e952e..c574d32b1 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -48,7 +48,7 @@ extern char fl_draw_shortcut; // Local variables: // appearance of current menus are pulled from this parent widget: -static const Fl_Menu_* button = nullptr; +static const Fl_Menu_* button = 0; // // ==== Declarations =========================================================== @@ -73,11 +73,11 @@ static const Fl_Menu_* button = nullptr; // of windows is slow, and we don't want to fall behind the events. // values for Menu_State.state: -enum class State { - INIT = 0, // no mouse up or down since popup() called - PUSHED, // mouse has been pushed on a normal item - MENU_PUSHED, // mouse has been pushed on a menu title - DONE, // exit the popup, the current item was picked +enum { + MENU_STATE_INIT = 0, + MENU_STATE_PUSHED, + MENU_STATE_MENU_PUSHED, + MENU_STATE_DONE, }; /* @@ -85,8 +85,8 @@ enum class State { */ struct Menu_State { - // menu item under the mouse pinter or selected by keyboard, or nullptr - const Fl_Menu_Item* current_item = nullptr; + // menu item under the mouse pinter or selected by keyboard, or 0 + const Fl_Menu_Item* current_item = 0; // index of the menu window that contains the current_item menu_index_t current_menu_ix = 0; @@ -95,7 +95,7 @@ struct Menu_State item_index_t current_item_ix = -1; // pointers to open menu windows - Menu_Window* menu_window[20] { nullptr }; + Menu_Window* menu_window[20] { 0 }; // number of open menuwindows menu_index_t num_menus = 0; @@ -104,11 +104,11 @@ struct Menu_State // horizontally arranged level 0 menu item list bool in_menubar = false; - // State::INIT, etc. See above - State state = State::INIT; + // MENU_STATE_INIT, etc. See above + int state = MENU_STATE_INIT; // simulate a button in the top level of a menubar - Menu_Window* menubar_button_helper = nullptr; + Menu_Window* menubar_button_helper = 0; // check if mouse coordinates are inside any of the menu windows bool is_inside(int mx, int my); @@ -155,7 +155,7 @@ struct Menu_State }; // Global state of menu windows and popup windows. -static Menu_State* menu_state = nullptr; +static Menu_State* menu_state = 0; // @@ -188,10 +188,10 @@ protected: public: // Store a pointer to the first item in the menu array. - const Fl_Menu_Item* menu { nullptr }; + const Fl_Menu_Item* menu { 0 }; // Use this to check this is a Fl_Menu_Window or a derived window class. - virtual Menu_Window* as_menuwindow() { return nullptr; } + virtual Menu_Window* as_menuwindow() { return 0; } }; // @@ -204,7 +204,7 @@ public: class Menu_Title_Window : public Menu_Window_Basetype { /* Draw the contents of the menu title window. */ - void draw() override { + void draw() { menu->draw(0, 0, w(), h(), button, 2); } @@ -240,7 +240,7 @@ class Menu_Window : public Menu_Window_Basetype friend struct Fl_Menu_Item; // Draw this window, either entirely, or just the selected and deselect items. - void draw() override; + void draw(); // Draw a single menu item in this window void draw_entry(const Fl_Menu_Item*, int i, int erase); @@ -277,10 +277,10 @@ public: ~Menu_Window(); // Override to fixup the current selection - void hide() override; + void hide(); // Override to handle all incoming events - int handle(int) override; + int handle(int); // Change the index of the selected item, -1 for none. Trigger chatty callbacks // and marks the window area of the newly selected item for redraw. @@ -303,10 +303,10 @@ public: bool is_inside(int x, int y); // Fake runtime type information - Menu_Window* as_menuwindow() override { return this; } + Menu_Window* as_menuwindow() { return this; } // Optional title for menubar windows and floating menus - Menu_Title_Window* title { nullptr }; + Menu_Title_Window* title { 0 }; // Height of the tallest menu item in the array, zero == menubar. int item_height { 0 }; @@ -328,7 +328,7 @@ public: bool menubar_title { false }; // In a cascading window, this points to the menu window that opened this menu. - Menu_Window *origin { nullptr }; + Menu_Window *origin { 0 }; // Used by the window driver int offset_y { 0 }; @@ -441,7 +441,7 @@ int Menu_State::handle_shortcut() { if (m) { set_current_item(m, mymenu, item); if (!m->submenu()) - state = State::DONE; + state = MENU_STATE_DONE; return 1; } } @@ -490,7 +490,7 @@ int Menu_State::handle_select() { if (current_item && !current_item->selectable()) return 1; // Mark the menu 'done' which will trigger the callback - state = State::DONE; + state = MENU_STATE_DONE; return 1; } @@ -499,7 +499,7 @@ int Menu_State::handle_select() { */ int Menu_State::handle_cancel() { set_current_item(0, -1, 0); - state = State::DONE; + state = MENU_STATE_DONE; return 1; } @@ -556,7 +556,7 @@ int Menu_State::handle_mouse_events(int e) { switch (e) { case FL_MOVE: { static int use_part1_extra = Fl::screen_driver()->need_menu_handle_part1_extra(); - if (use_part1_extra && state == State::DONE) { + if (use_part1_extra && state == MENU_STATE_DONE) { return 1; // Fix for STR #2619 } } @@ -573,7 +573,7 @@ int Menu_State::handle_mouse_events(int e) { if ((!in_menubar || mymenu) && !is_inside(mx, my)) { set_current_item(0, -1, 0); if (e==FL_PUSH) - state = State::DONE; + state = MENU_STATE_DONE; return 1; } for (mymenu = num_menus-1; ; mymenu--) { @@ -583,12 +583,12 @@ int Menu_State::handle_mouse_events(int e) { if (mymenu <= 0) { // buttons in menubars must be deselected if we move outside of them! if (current_menu_ix==-1 && e==FL_PUSH) { - state = State::DONE; + state = MENU_STATE_DONE; return 1; } if (current_item && current_menu_ix==0 && !current_item->submenu()) { if (e==FL_PUSH) { - state = State::DONE; + state = MENU_STATE_DONE; set_current_item(0, -1, 0); } return 1; @@ -602,9 +602,9 @@ int Menu_State::handle_mouse_events(int e) { if (current_item && current_item->submenu() // this is a menu title && item != menu_window[mymenu]->selected // and it is not already on && !current_item->callback_) // and it does not have a callback - state = State::MENU_PUSHED; + state = MENU_STATE_MENU_PUSHED; else - state = State::PUSHED; + state = MENU_STATE_PUSHED; } } return 1; @@ -612,7 +612,7 @@ int Menu_State::handle_mouse_events(int e) { // Mouse must either be held down/dragged some, or this must be // the second click (not the one that popped up the menu): if ( !Fl::event_is_click() - || state == State::PUSHED + || state == MENU_STATE_PUSHED || (in_menubar && current_item && !current_item->submenu()) // button ) { #if 0 // makes the check/radio items leave the menu up @@ -625,7 +625,7 @@ int Menu_State::handle_mouse_events(int e) { // do nothing if they try to pick an inactive item, or a submenu with no callback if (!current_item || (current_item->selectable() && (!current_item->submenu() || current_item->callback_ || (in_menubar && current_menu_ix <= 0)))) - state = State::DONE; + state = MENU_STATE_DONE; } return 1; } @@ -690,7 +690,7 @@ bool Menu_State::create_submenu(const Fl_Rect &r, Menu_Window& cw, const Fl_Menu // delete all the old menus and create new one: while (num_menus > current_menu_ix+1) delete menu_window[--num_menus]; menu_window[num_menus++] = new Menu_Window(menutable, nX, nY, - title?1:0, 0, nullptr, title, false, (bool)menubar, + title?1:0, 0, 0, title, false, (bool)menubar, (title ? 0 : cw.x()) ); if (num_menus >= 2 && menu_window[num_menus-2]->item_height) { menu_window[num_menus-1]->origin = menu_window[num_menus-2]; @@ -710,10 +710,10 @@ void Menu_State::delete_unused_menus(Menu_Window& cw, const Fl_Menu_Item* m) { delete menu_window[--num_menus]; if (in_menubar && (current_menu_ix == 0)) { // kludge so "menubar buttons" turn "on" by using menu title: - menubar_button_helper = new Menu_Window(nullptr, + menubar_button_helper = new Menu_Window(0, cw.x()+cw.titlex(current_item_ix), cw.y()+cw.h(), 0, 0, - nullptr, m, false, true); + 0, m, false, true); menubar_button_helper->title->show(); } } @@ -723,7 +723,7 @@ void Menu_State::delete_unused_menus(Menu_Window& cw, const Fl_Menu_Item* m) { // // Static members: -Fl_Window *Menu_Window::parent_ = nullptr; +Fl_Window *Menu_Window::parent_ = 0; int Menu_Window::display_height_ = 0; @@ -733,7 +733,7 @@ int Menu_Window::display_height_ = 0; \param[in] X, Y position relative to parent_ \param[in] Wp, Hp initial minimum size; if Wp is 0, the window will open on the screen with X and Y, else it will open in the screen with the mouse pointer. - \param[in] picked pointer to the currently picked menu item, can be nullptr + \param[in] picked pointer to the currently picked menu item, can be 0 \param[in] t pointer to the menutitle window \param[in] in_menubar set if part of an Fl_Menu_Bar menu \param[in] mb_title set if the title window is also the button in Fl_Menu_Bar @@ -959,7 +959,7 @@ int Menu_Window::handle_part2(int e, int ret) { // now, so that Carbon can continue undisturbed with handling window // manager events, like dragging the application window. Menu_State &pp = *menu_state; - if (pp.state == State::DONE) { + if (pp.state == MENU_STATE_DONE) { hide(); if (pp.menubar_button_helper) { pp.menubar_button_helper->hide(); @@ -1249,7 +1249,7 @@ int Fl_Menu_Item::size() const { \param[in] m start from this menu item inside an array \return a pointer to the next menu item. If the label() of the returned - item is nullptr, the function reached the end of the array and + item is 0, the function reached the end of the array and no next item was found. */ static const Fl_Menu_Item* next_visible_or_not(const Fl_Menu_Item* m) { @@ -1274,7 +1274,7 @@ static const Fl_Menu_Item* next_visible_or_not(const Fl_Menu_Item* m) { \param[in] n advance by n items \return a pointer to the next menu item. If the label() of the returned - item is nullptr, the function reached the end of the array and + item is 0, the function reached the end of the array and no next item was found. */ const Fl_Menu_Item* Fl_Menu_Item::next(int n) const { @@ -1439,7 +1439,7 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown( goto STARTUP; } - pp.current_item = nullptr; + pp.current_item = 0; pp.current_menu_ix = 0; pp.current_item_ix = -1; if (menubar) { @@ -1458,7 +1458,7 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown( goto STARTUP; } - // the main loop: runs until p.state goes to State::DONE or the menu + // the main loop: runs until p.state goes to MENU_STATE_DONE or the menu // widget is deleted (e.g. from a timer callback, see STR #3503): for (;;) { @@ -1478,14 +1478,14 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown( Fl::wait(); if (pbutton && wp.deleted()) // menu widget has been deleted (STR #3503) break; - if (pp.state == State::DONE) break; // done. + if (pp.state == MENU_STATE_DONE) break; // done. if (pp.current_item == oldi) continue; } // only do rest if item changes: if (pp.menubar_button_helper) { delete pp.menubar_button_helper; - pp.menubar_button_helper = nullptr; + pp.menubar_button_helper = 0; } // turn off "menubar button" if (!pp.current_item) { // pointing at nothing @@ -1496,7 +1496,7 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown( if (pp.menubar_button_helper) { delete pp.menubar_button_helper; - pp.menubar_button_helper = nullptr; + pp.menubar_button_helper = 0; } initial_item = 0; // stop the startup code if (pp.current_menu_ix < 0 || pp.current_menu_ix >= pp.num_menus) { @@ -1658,7 +1658,7 @@ Fl_Window *Fl_Window_Driver::menu_parent(int *display_height) { /* Cast to menuwindow if win is of claa menuwindow and the driver is initialized. */ static Menu_Window *to_menuwindow(Fl_Window *win) { - if (!Fl_Window_Driver::driver(win)->popup_window() || !win->menu_window()) return nullptr; + if (!Fl_Window_Driver::driver(win)->popup_window() || !win->menu_window()) return 0; return ((Menu_Window_Basetype*)win)->as_menuwindow(); } diff --git a/src/Fl_Menu_.cxx b/src/Fl_Menu_.cxx index 0d10ef01c..bce89ef39 100644 --- a/src/Fl_Menu_.cxx +++ b/src/Fl_Menu_.cxx @@ -464,7 +464,7 @@ void Fl_Menu_::setonly(Fl_Menu_Item* item) { /** \deprecated Please use Fl_Menu_Item::setonly(Fl_Menu_Item const* first) instead. */ -void Fl_Menu_Item::setonly() { setonly(nullptr); } +void Fl_Menu_Item::setonly() { setonly(0); } /** Turns the radio item "on" for the menu item and turns "off" adjacent radio items set. diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx index 00c033b15..62c2f5ea1 100644 --- a/src/Fl_Tooltip.cxx +++ b/src/Fl_Tooltip.cxx @@ -41,7 +41,7 @@ int Fl_Tooltip::margin_width_ = 3; int Fl_Tooltip::margin_height_ = 3; int Fl_Tooltip::wrap_width_ = 400; const int Fl_Tooltip::draw_symbols_ = 1; -char *Fl_Tooltip::override_text_ = nullptr; +char *Fl_Tooltip::override_text_ = 0; static const char* tip; @@ -166,7 +166,7 @@ static void tooltip_hide_timeout(void*) { The provided text will be copied into a local buffer. To apply the override, the event handler must return 1. - To disable the tooltip for the current event, set the override text to nullptr + To disable the tooltip for the current event, set the override text to 0 or an empty string ("") and return 1. \param[in] new_text a C string that will be copied into a buffer @@ -179,10 +179,10 @@ static void tooltip_hide_timeout(void*) { int Fl_Tooltip::override_text(const char *new_text) { if (new_text != override_text_) { if (window && window->label()==override_text_) - ((Fl_Widget *) window)->label(nullptr); + ((Fl_Widget *) window)->label(0); if (override_text_) ::free(override_text_); - override_text_ = nullptr; + override_text_ = 0; if (new_text) override_text_ = fl_strdup(new_text); } @@ -355,7 +355,7 @@ void Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char* window->hide(); Fl::remove_timeout(tooltip_hide_timeout); } - tooltip_timeout_(nullptr); + tooltip_timeout_(0); } else { if (window && window->visible()) { window->hide(); diff --git a/src/Fl_Widget.cxx b/src/Fl_Widget.cxx index b8a65865b..4eee6ef39 100644 --- a/src/Fl_Widget.cxx +++ b/src/Fl_Widget.cxx @@ -222,7 +222,7 @@ Fl_Widget::Fl_Widget(int X, int Y, int W, int H, const char* L) { selection_color_ = FL_GRAY; when_ = FL_WHEN_RELEASE; - parent_ = nullptr; + parent_ = 0; if (Fl_Group::current()) Fl_Group::current()->add(this); } diff --git a/src/Fl_add_idle.cxx b/src/Fl_add_idle.cxx index fd2ab36a4..8c6fb93f6 100644 --- a/src/Fl_add_idle.cxx +++ b/src/Fl_add_idle.cxx @@ -88,7 +88,7 @@ void Fl::add_idle(Fl_Idle_Handler cb, void* data) { } void Fl::add_idle(Fl_Old_Idle_Handler cb) { - Fl::add_idle((Fl_Idle_Handler)cb, nullptr); + Fl::add_idle((Fl_Idle_Handler)cb, 0); } /** @@ -98,7 +98,7 @@ void Fl::add_idle(Fl_Old_Idle_Handler cb) { argument when the callback was installed. There is no "wildcard" search. \param[in] cb idle callback in question - \param[in] data optional data. Default: zero / nullptr. + \param[in] data optional data. Default: zero / 0. \returns Whether the given callback \p cb is queued with \p data. \retval 1 The callback is currently in the callback queue. @@ -148,7 +148,7 @@ int Fl::has_idle(Fl_Idle_Handler cb, void* data) { \endcode \param[in] cb idle callback in question - \param[in] data optional data. Default: zero / nullptr. + \param[in] data optional data. Default: zero / 0. */ void Fl::remove_idle(Fl_Idle_Handler cb, void* data) { idle_cb* p = first; diff --git a/src/Fl_lock.cxx b/src/Fl_lock.cxx index 8f2b2d4da..57d67766e 100644 --- a/src/Fl_lock.cxx +++ b/src/Fl_lock.cxx @@ -66,9 +66,9 @@ #ifndef FL_DOXYGEN -static constexpr int AWAKE_RING_SIZE = 1024; -Fl_Awake_Handler *Fl_System_Driver::awake_ring_ = nullptr; -void **Fl_System_Driver::awake_data_ = nullptr; +static const int AWAKE_RING_SIZE = 1024; +Fl_Awake_Handler *Fl_System_Driver::awake_ring_ = 0; +void **Fl_System_Driver::awake_data_ = 0; int Fl_System_Driver::awake_ring_size_ = 0; int Fl_System_Driver::awake_ring_head_ = 0; int Fl_System_Driver::awake_ring_tail_ = 0; @@ -202,7 +202,7 @@ bool Fl_System_Driver::awake_ring_empty() { \see Fl::awake_once(Fl_Awake_Handler, void*) */ void Fl::awake() { - Fl::system_driver()->awake(nullptr); + Fl::system_driver()->awake(0); } /** diff --git a/src/drivers/Base/Fl_Base_Pen_Events.cxx b/src/drivers/Base/Fl_Base_Pen_Events.cxx index f4ebbd8ad..12f207731 100644 --- a/src/drivers/Base/Fl_Base_Pen_Events.cxx +++ b/src/drivers/Base/Fl_Base_Pen_Events.cxx @@ -39,7 +39,7 @@ using namespace Fl::Pen; // ---- SubscriberList implementation ------------------------------------------ -/* Remove subscribers that have a nullptr as a widget */ +/* Remove subscribers that have a 0 as a widget */ void Fl::Pen::SubscriberList::cleanup() { for (auto it = begin(); it != end(); ) { if (!it->second->widget()) { @@ -76,18 +76,18 @@ void Fl::Pen::SubscriberList::remove(Fl_Widget *w) { // Override the methods below to handle subscriptions and queries by user apps. void Fl::Pen::Driver::subscribe(Fl_Widget* widget) { - if (widget == nullptr) return; + if (widget == 0) return; subscriber_list_.add(widget); } void Fl::Pen::Driver::unsubscribe(Fl_Widget* widget) { - if (widget == nullptr) return; + if (widget == 0) return; subscriber_list_.remove(widget); } void Fl::Pen::Driver::release() { - pushed_ = nullptr; - below_pen_ = nullptr; + pushed_ = 0; + below_pen_ = 0; } Trait Fl::Pen::Driver::traits() { diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.cxx b/src/drivers/Posix/Fl_Posix_System_Driver.cxx index 35d9b7703..299a1b901 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx +++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx @@ -371,7 +371,7 @@ static void unlock_function_rec() { # endif // HAVE_PTHREAD_MUTEX_RECURSIVE // -- Start of "awake" implementation -- -static void* thread_message_ = nullptr; +static void* thread_message_ = 0; static std::mutex pipe_mutex; void Fl_Posix_System_Driver::awake(void* msg) { diff --git a/src/fl_utf8.cxx b/src/fl_utf8.cxx index 7ba8102a5..c4d78b7db 100644 --- a/src/fl_utf8.cxx +++ b/src/fl_utf8.cxx @@ -70,7 +70,7 @@ static int Toupper(int ucs) { #include <FL/fl_utf8.h> bool test(const char *str) { - if (str == nullptr) return true; + if (str == 0) return true; const char *src = str; for (int p = 0; ; p++) { if (src == 0) return true; @@ -654,7 +654,7 @@ int fl_system(const char* cmd) \param[in] file path to the new process \param[in] argv array of command line arguments, last array member must - be a `nullptr`. + be a `0`. \return the result of `execvp` call. */ int fl_execvp(const char *file, char *const *argv) |
