diff libinterp/dldfcn/__init_fltk__.cc @ 23807:336f89b6208b

Use character literals 'c' rather than string literals "c" when possible. Better performance when string constructor isn't required. * Figure.cc, __init_qt__.cc, files-dock-widget.cc, file-editor-tab.cc, file-editor.cc, octave-qscintilla.cc, main-window.cc, octave-dock-widget.cc, octave-qt-link.cc, parser.cc, webinfo.cc, resource-manager.cc, settings-dialog.cc, workspace-view.cc, __magick_read__.cc, balance.cc, debug.cc, dynamic-ld.cc, ft-text-renderer.cc, gl-render.cc, gl2ps-print.cc, graphics.cc, hook-fcn.h, input.cc, load-path.cc, load-save.cc, ls-hdf5.cc, oct-hist.cc, oct-stream.cc, pager.cc, pr-output.cc, qz.cc, symtab.cc, symtab.h, tril.cc, __delaunayn__.cc, __init_fltk__.cc, __voronoi__.cc, audioread.cc, ccolamd.cc, colamd.cc, convhulln.cc, ov-base-int.cc, ov-base-mat.cc, ov-base-scalar.cc, ov-base.cc, ov-bool-mat.cc, ov-cell.cc, ov-class.cc, ov-classdef.cc, ov-colon.cc, ov-complex.cc, ov-cx-mat.cc, ov-fcn-handle.cc, ov-fcn-inline.cc, ov-fcn.h, ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-java.cc, ov-oncleanup.cc, ov-range.cc, ov-re-mat.cc, ov-re-sparse.cc, ov-str-mat.cc, ov-struct.cc, ov-usr-fcn.cc, ov.cc, octave.cc, bp-table.cc, jit-ir.cc, jit-ir.h, jit-typeinfo.cc, pt-funcall.cc, pt-idx.cc, pt-pr-code.cc, pt.h, Array.cc, CDiagMatrix.cc, CMatrix.cc, CNDArray.cc, CRowVector.cc, CSparse.cc, Range.cc, boolSparse.cc, dDiagMatrix.cc, dMatrix.cc, dNDArray.cc, dRowVector.cc, dSparse.cc, fCDiagMatrix.cc, fCMatrix.cc, fCNDArray.cc, fCRowVector.cc, fDiagMatrix.cc, fMatrix.cc, fNDArray.cc, fRowVector.cc, idx-vector.cc, intNDArray.cc, CollocWt.cc, DASPK.cc, DASRT.cc, DASSL.cc, LSODE.cc, oct-time.cc, cmd-hist.cc, kpse.cc, lo-array-errwarn.cc, lo-regexp.cc, lo-utils.cc, str-vec.cc, url-transfer.cc, main-cli.cc, main-gui.cc, mkoctfile.in.cc: Replace 1-character string literals "c" with the character literal 'c'.
author Rik <rik@octave.org>
date Fri, 28 Jul 2017 15:40:00 -0700
parents 3f7226b07a38
children dbbc7e5e2294
line wrap: on
line diff
--- a/libinterp/dldfcn/__init_fltk__.cc	Fri Jul 28 11:45:07 2017 -0700
+++ b/libinterp/dldfcn/__init_fltk__.cc	Fri Jul 28 15:40:00 2017 -0700
@@ -148,7 +148,7 @@
 
   void print (const std::string& cmd, const std::string& term)
   {
-    //std::cout << "OpenGL_fltk::print(cmd=" << cmd << ", term=" << term << ") canvas size = " << w () << "x" << h () << std::endl;
+    //std::cout << "OpenGL_fltk::print(cmd=" << cmd << ", term=" << term << ") canvas size = " << w () << 'x' << h () << std::endl;
 
     octave::gl2ps_print (gh_manager::get_object (m_number), cmd, term);
   }
@@ -380,7 +380,7 @@
             // End of submenu? Pop back one level.
             if (! m->label ())
               {
-                size_t idx = menupath.find_last_of ("/");
+                size_t idx = menupath.find_last_of ('/');
                 if (idx != std::string::npos)
                   menupath.erase (idx);
                 else
@@ -600,8 +600,8 @@
             if (item)
               {
                 //avoid duplicate menulabels
-                size_t idx1 = fltk_label.find_last_of ("(");
-                size_t idx2 = fltk_label.find_last_of (")");
+                size_t idx1 = fltk_label.find_last_of ('(');
+                size_t idx2 = fltk_label.find_last_of (')');
                 int len = idx2 - idx1;
                 int val = 1;
                 if (len > 0)
@@ -614,7 +614,7 @@
                   }
                 std::ostringstream valstream;
                 valstream << val;
-                fltk_label += "(" + valstream.str () + ")";
+                fltk_label += '(' + valstream.str () + ')';
               }
             else
               {
@@ -1242,11 +1242,11 @@
     cbuf.precision (4);
     cbuf.width (6);
     pixel2pos (ax, px0, py0, x0, y0);
-    cbuf << "[" << x0 << ", " << y0 << "]";
+    cbuf << '[' << x0 << ", " << y0 << ']';
     if (px1 >= 0)
       {
         pixel2pos (ax, px1, py1, x1, y1);
-        cbuf << " -> ["<< x1 << ", " << y1 << "]";
+        cbuf << " -> ["<< x1 << ", " << y1 << ']';
       }
 
     m_status->value (cbuf.str ().c_str ());
@@ -1263,7 +1263,7 @@
         cbuf.width (6);
         Matrix v (1,2,0);
         v = ap.get ("view").matrix_value ();
-        cbuf << "[azimuth: " << v(0) << ", elevation: " << v(1) << "]";
+        cbuf << "[azimuth: " << v(0) << ", elevation: " << v(1) << ']';
 
         m_status->value (cbuf.str ().c_str ());
       }
@@ -1393,7 +1393,7 @@
       }
     else if (e_key >= (FL_F + 1) && e_key <= (FL_F + 12))
       {
-        tmp_str << "f" << (e_key - FL_F);
+        tmp_str << 'f' << (e_key - FL_F);
         key_str = tmp_str.str ();
       }
     else if (e_key == ',')
@@ -2299,7 +2299,7 @@
         if (go.isa ("uimenu"))
           fltk_label = dynamic_cast<const uimenu::properties&>
                        (go.get_properties ()).get___fltk_label__ ()
-                       + "/"
+                       + '/'
                        + fltk_label;
         else if (go.isa ("figure") || go.isa ("uicontextmenu"))
           ;