diff options
Diffstat (limited to 'src/Fl_Help_View.cxx')
| -rw-r--r-- | src/Fl_Help_View.cxx | 181 |
1 files changed, 89 insertions, 92 deletions
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); } |
