mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
compilation fixes for compaq cxx + small things
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2079 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b5311a0004
commit
07ea5f51f0
@ -10,8 +10,8 @@ src/CutAndPaste.C
|
||||
src/debug.C
|
||||
src/exporter.C
|
||||
src/ext_l10n.h
|
||||
src/figure_form.C
|
||||
src/figureForm.C
|
||||
src/figure_form.C
|
||||
src/FontLoader.C
|
||||
src/frontends/controllers/ButtonController.h
|
||||
src/frontends/controllers/character.C
|
||||
@ -90,67 +90,67 @@ src/frontends/qt2/paragraphdlgimpl.C
|
||||
src/frontends/qt2/tabularcreatedlgimpl.C
|
||||
src/frontends/xforms/combox.C
|
||||
src/frontends/xforms/FileDialog.C
|
||||
src/frontends/xforms/form_bibitem.C
|
||||
src/frontends/xforms/FormBibitem.C
|
||||
src/frontends/xforms/form_bibtex.C
|
||||
src/frontends/xforms/form_bibitem.C
|
||||
src/frontends/xforms/FormBibtex.C
|
||||
src/frontends/xforms/form_bibtex.C
|
||||
src/frontends/xforms/form_browser.C
|
||||
src/frontends/xforms/form_character.C
|
||||
src/frontends/xforms/FormCharacter.C
|
||||
src/frontends/xforms/form_citation.C
|
||||
src/frontends/xforms/form_character.C
|
||||
src/frontends/xforms/FormCitation.C
|
||||
src/frontends/xforms/form_copyright.C
|
||||
src/frontends/xforms/form_citation.C
|
||||
src/frontends/xforms/FormCopyright.C
|
||||
src/frontends/xforms/form_credits.C
|
||||
src/frontends/xforms/form_copyright.C
|
||||
src/frontends/xforms/FormCredits.C
|
||||
src/frontends/xforms/form_document.C
|
||||
src/frontends/xforms/form_credits.C
|
||||
src/frontends/xforms/FormDocument.C
|
||||
src/frontends/xforms/form_error.C
|
||||
src/frontends/xforms/form_document.C
|
||||
src/frontends/xforms/FormError.C
|
||||
src/frontends/xforms/form_external.C
|
||||
src/frontends/xforms/form_error.C
|
||||
src/frontends/xforms/FormExternal.C
|
||||
src/frontends/xforms/form_filedialog.C
|
||||
src/frontends/xforms/form_external.C
|
||||
src/frontends/xforms/FormFiledialog.C
|
||||
src/frontends/xforms/form_graphics.C
|
||||
src/frontends/xforms/form_filedialog.C
|
||||
src/frontends/xforms/FormGraphics.C
|
||||
src/frontends/xforms/form_include.C
|
||||
src/frontends/xforms/form_graphics.C
|
||||
src/frontends/xforms/FormInclude.C
|
||||
src/frontends/xforms/form_index.C
|
||||
src/frontends/xforms/form_include.C
|
||||
src/frontends/xforms/FormIndex.C
|
||||
src/frontends/xforms/form_index.C
|
||||
src/frontends/xforms/FormLog.C
|
||||
src/frontends/xforms/FormMathsBitmap.C
|
||||
src/frontends/xforms/form_maths_deco.C
|
||||
src/frontends/xforms/FormMathsDeco.C
|
||||
src/frontends/xforms/form_maths_delim.C
|
||||
src/frontends/xforms/form_maths_deco.C
|
||||
src/frontends/xforms/FormMathsDelim.C
|
||||
src/frontends/xforms/form_maths_matrix.C
|
||||
src/frontends/xforms/form_maths_delim.C
|
||||
src/frontends/xforms/FormMathsMatrix.C
|
||||
src/frontends/xforms/form_maths_panel.C
|
||||
src/frontends/xforms/form_maths_matrix.C
|
||||
src/frontends/xforms/FormMathsPanel.C
|
||||
src/frontends/xforms/form_maths_space.C
|
||||
src/frontends/xforms/form_maths_panel.C
|
||||
src/frontends/xforms/FormMathsSpace.C
|
||||
src/frontends/xforms/form_minipage.C
|
||||
src/frontends/xforms/form_maths_space.C
|
||||
src/frontends/xforms/FormMinipage.C
|
||||
src/frontends/xforms/form_paragraph.C
|
||||
src/frontends/xforms/form_minipage.C
|
||||
src/frontends/xforms/FormParagraph.C
|
||||
src/frontends/xforms/form_preamble.C
|
||||
src/frontends/xforms/form_paragraph.C
|
||||
src/frontends/xforms/FormPreamble.C
|
||||
src/frontends/xforms/form_preferences.C
|
||||
src/frontends/xforms/form_preamble.C
|
||||
src/frontends/xforms/FormPreferences.C
|
||||
src/frontends/xforms/form_print.C
|
||||
src/frontends/xforms/form_preferences.C
|
||||
src/frontends/xforms/FormPrint.C
|
||||
src/frontends/xforms/form_ref.C
|
||||
src/frontends/xforms/form_print.C
|
||||
src/frontends/xforms/FormRef.C
|
||||
src/frontends/xforms/form_search.C
|
||||
src/frontends/xforms/form_ref.C
|
||||
src/frontends/xforms/FormSearch.C
|
||||
src/frontends/xforms/form_tabular.C
|
||||
src/frontends/xforms/form_search.C
|
||||
src/frontends/xforms/FormTabular.C
|
||||
src/frontends/xforms/form_tabular_create.C
|
||||
src/frontends/xforms/form_tabular.C
|
||||
src/frontends/xforms/FormTabularCreate.C
|
||||
src/frontends/xforms/form_toc.C
|
||||
src/frontends/xforms/form_tabular_create.C
|
||||
src/frontends/xforms/FormToc.C
|
||||
src/frontends/xforms/form_url.C
|
||||
src/frontends/xforms/form_toc.C
|
||||
src/frontends/xforms/FormUrl.C
|
||||
src/frontends/xforms/form_url.C
|
||||
src/frontends/xforms/FormVCLog.C
|
||||
src/frontends/xforms/input_validators.C
|
||||
src/frontends/xforms/Menubar_pimpl.C
|
||||
|
@ -1,3 +1,21 @@
|
||||
2001-06-01 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* lyxfont.C:
|
||||
* tabular.C:
|
||||
* tabular-old.C:
|
||||
* FontInfo.C: bring C functions into global namespace when
|
||||
necessary
|
||||
|
||||
2001-05-30 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* LString.h: make sure config.h has been loaded before LString.h.
|
||||
|
||||
* lyxlex_pimpl.C (EatLine): comment out annoying debug messages
|
||||
(one for each char read by EatLine!).
|
||||
|
||||
* lyx_main.C (init): constify lyxdir. Lowercase the name of some
|
||||
variables.
|
||||
|
||||
2001-06-01 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* paragraph.C (BreakParagraph): set the inset_owner in the new par
|
||||
|
@ -25,6 +25,10 @@
|
||||
|
||||
using std::endl;
|
||||
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
using std::fabs;
|
||||
#endif
|
||||
|
||||
/// Load font close to this size
|
||||
string const FontInfo::getFontname(int size)
|
||||
{
|
||||
@ -41,8 +45,8 @@ string const FontInfo::getFontname(int size)
|
||||
lyxerr[Debug::FONT] << "Exact font match with\n"
|
||||
<< strings[i] << endl;
|
||||
return strings[i];
|
||||
} else if (std::fabs(sizes[i] - size - 0.1) < error) {
|
||||
error = std::fabs(sizes[i] - size - 0.1);
|
||||
} else if (fabs(sizes[i] - size - 0.1) < error) {
|
||||
error = fabs(sizes[i] - size - 0.1);
|
||||
closestind = i;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,10 @@
|
||||
#ifndef LSTRING_H
|
||||
#define LSTRING_H
|
||||
|
||||
#ifndef _CONFIG_H
|
||||
#error The <config.h> header should always be included before LString.h
|
||||
#endif
|
||||
|
||||
#ifndef USE_INCLUDED_STRING
|
||||
#include <string>
|
||||
using std::string;
|
||||
|
@ -1,3 +1,9 @@
|
||||
2001-06-01 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* MathsSymbols.C:
|
||||
* FormMathsMatrix.C: bring C functions into global namespace if
|
||||
necessary.
|
||||
|
||||
2001-05-31 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* MathsSymbols.C (pixmapFromBitmapData): add std::
|
||||
|
@ -23,6 +23,11 @@
|
||||
#include "lyxfunc.h"
|
||||
#include "support/LAssert.h"
|
||||
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
using std::strlen;
|
||||
#endif
|
||||
|
||||
|
||||
static char h_align_str[80] = "c";
|
||||
static char v_align_c[] = "tcb";
|
||||
|
||||
@ -106,7 +111,7 @@ bool FormMathsMatrix::input(FL_OBJECT * ob, long)
|
||||
int FormMathsMatrix::AlignFilter(char const * cur, int c)
|
||||
{
|
||||
int const n = int(fl_get_slider_value(dialog_->slider_columns) + 0.5) -
|
||||
int(std::strlen(cur));
|
||||
int(strlen(cur));
|
||||
if (n < 0)
|
||||
return FL_INVALID;
|
||||
|
||||
|
@ -26,6 +26,11 @@ using std::max;
|
||||
using std::endl;
|
||||
using std::ostream;
|
||||
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
using std::strstr;
|
||||
#endif
|
||||
|
||||
|
||||
/* Latex code for those bitmaps */
|
||||
|
||||
#include "greek.xbm"
|
||||
@ -268,7 +273,7 @@ static char const ** pixmapFromBitmapData(char const * s, int wx, int hx)
|
||||
XpmCreateDataFromImage(fl_get_display(), const_cast<char***>(&data), sbima, sbima, 0);
|
||||
|
||||
// Dirty hack to get blue symbols quickly
|
||||
char * sx = const_cast<char*>(std::strstr(data[2], "FFFFFFFF"));
|
||||
char * sx = const_cast<char*>(strstr(data[2], "FFFFFFFF"));
|
||||
if (sx) {
|
||||
for (int k = 0; k < 8; ++k) sx[k] = '0';
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
2001-05-31 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* figinset.C: add using std:: directive for the C functions which
|
||||
need that.
|
||||
|
||||
2001-05-31 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* insetfloat.C (Write): write out wide info
|
||||
|
@ -80,6 +80,15 @@ using std::copy;
|
||||
using std::pair;
|
||||
using std::make_pair;
|
||||
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
using std::memcopy;
|
||||
using std::sin;
|
||||
using std::cos;
|
||||
using std::fabs;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
extern BufferView * current_view;
|
||||
extern FL_OBJECT * figinset_canvas;
|
||||
|
||||
@ -632,8 +641,8 @@ void runqueue()
|
||||
env[0] = new char[tmp.size() + 1];
|
||||
std::copy(tmp.begin(), tmp.end(), env[0]);
|
||||
env[0][tmp.size()] = '\0';
|
||||
std::memcpy(&env[1], environ,
|
||||
sizeof(char*) * (ne + 1));
|
||||
memcpy(&env[1], environ,
|
||||
sizeof(char*) * (ne + 1));
|
||||
environ = env;
|
||||
|
||||
// now make gs command
|
||||
@ -1437,10 +1446,10 @@ void InsetFig::Recompute()
|
||||
|
||||
if (changed) GetPSSizes();
|
||||
|
||||
float sin_a = std::sin (angle / DEG2PI); /* rotation; H. Zeller 021296 */
|
||||
float cos_a = std::cos (angle / DEG2PI);
|
||||
int frame_wid = int(ceil(std::fabs(cos_a * pswid) + std::fabs(sin_a * pshgh)));
|
||||
int frame_hgh= int(ceil(std::fabs(cos_a * pshgh) + std::fabs(sin_a * pswid)));
|
||||
float sin_a = sin(angle / DEG2PI); /* rotation; H. Zeller 021296 */
|
||||
float cos_a = cos(angle / DEG2PI);
|
||||
int frame_wid = int(ceil(fabs(cos_a * pswid) + fabs(sin_a * pshgh)));
|
||||
int frame_hgh= int(ceil(fabs(cos_a * pshgh) + fabs(sin_a * pswid)));
|
||||
|
||||
string lfname = fname;
|
||||
if (GetExtension(fname).empty())
|
||||
|
@ -235,7 +235,7 @@ void LyX::init(bool gui)
|
||||
searchpath= MakeAbsPath(system_lyxdir) + ';';
|
||||
|
||||
// LYX_DIR_11x environment variable
|
||||
string lyxdir = GetEnvPath("LYX_DIR_11x");
|
||||
string const lyxdir = GetEnvPath("LYX_DIR_11x");
|
||||
|
||||
if (!lyxdir.empty()) {
|
||||
lyxerr[Debug::INIT] << "LYX_DIR_11x: " << lyxdir << endl;
|
||||
@ -256,7 +256,7 @@ void LyX::init(bool gui)
|
||||
build_lyxdir.erase();
|
||||
}
|
||||
|
||||
bool FollowLink;
|
||||
bool followlink;
|
||||
do {
|
||||
// Path of binary/../share/name of binary/
|
||||
searchpath += NormalizePath(AddPath(binpath, "../share/") +
|
||||
@ -264,18 +264,18 @@ void LyX::init(bool gui)
|
||||
|
||||
// Follow Symlinks
|
||||
FileInfo file(fullbinpath, true);
|
||||
FollowLink = file.isLink();
|
||||
if (FollowLink) {
|
||||
string Link;
|
||||
if (LyXReadLink(fullbinpath, Link)) {
|
||||
fullbinpath = Link;
|
||||
followlink = file.isLink();
|
||||
if (followlink) {
|
||||
string link;
|
||||
if (LyXReadLink(fullbinpath, link)) {
|
||||
fullbinpath = link;
|
||||
binpath = MakeAbsPath(OnlyPath(fullbinpath));
|
||||
}
|
||||
else {
|
||||
FollowLink = false;
|
||||
followlink = false;
|
||||
}
|
||||
}
|
||||
} while (FollowLink);
|
||||
} while (followlink);
|
||||
|
||||
// Hardcoded dir
|
||||
searchpath += LYX_DIR;
|
||||
|
@ -29,6 +29,11 @@
|
||||
using std::ostream;
|
||||
using std::endl;
|
||||
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
using std::strlen;
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// Names for the GUI
|
||||
//
|
||||
@ -841,21 +846,21 @@ int LyXFont::latexWriteStartChanges(ostream & os, LyXFont const & base,
|
||||
os << '\\'
|
||||
<< LaTeXFamilyNames[f.family()]
|
||||
<< '{';
|
||||
count += std::strlen(LaTeXFamilyNames[f.family()]) + 2;
|
||||
count += strlen(LaTeXFamilyNames[f.family()]) + 2;
|
||||
env = true; //We have opened a new environment
|
||||
}
|
||||
if (f.series() != INHERIT_SERIES) {
|
||||
os << '\\'
|
||||
<< LaTeXSeriesNames[f.series()]
|
||||
<< '{';
|
||||
count += std::strlen(LaTeXSeriesNames[f.series()]) + 2;
|
||||
count += strlen(LaTeXSeriesNames[f.series()]) + 2;
|
||||
env = true; //We have opened a new environment
|
||||
}
|
||||
if (f.shape() != INHERIT_SHAPE) {
|
||||
os << '\\'
|
||||
<< LaTeXShapeNames[f.shape()]
|
||||
<< '{';
|
||||
count += std::strlen(LaTeXShapeNames[f.shape()]) + 2;
|
||||
count += strlen(LaTeXShapeNames[f.shape()]) + 2;
|
||||
env = true; //We have opened a new environment
|
||||
}
|
||||
if (f.color() != LColor::inherit && f.color() != LColor::ignore) {
|
||||
@ -890,7 +895,7 @@ int LyXFont::latexWriteStartChanges(ostream & os, LyXFont const & base,
|
||||
os << '\\'
|
||||
<< LaTeXSizeNames[f.size()]
|
||||
<< ' ';
|
||||
count += std::strlen(LaTeXSizeNames[f.size()]) + 2;
|
||||
count += strlen(LaTeXSizeNames[f.size()]) + 2;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
@ -397,8 +397,8 @@ bool LyXLex::Pimpl::EatLine()
|
||||
while(is && c != '\n' && i != (LEX_MAX_BUFF - 1)) {
|
||||
is.get(cc);
|
||||
c = cc;
|
||||
lyxerr[Debug::LYXLEX] << "LyXLex::EatLine read char: `"
|
||||
<< c << "'" << endl;
|
||||
//lyxerr[Debug::LYXLEX] << "LyXLex::EatLine read char: `"
|
||||
// << c << "'" << endl;
|
||||
if (c != '\r')
|
||||
buff[i++] = c;
|
||||
}
|
||||
|
@ -1,3 +1,7 @@
|
||||
2001-05-31 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* array.C: bring memmove into main namespace if necessary
|
||||
|
||||
2001-05-31 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* math_parser.C (yylex): use contains instead of strchr
|
||||
|
@ -16,6 +16,11 @@
|
||||
using std::ostream;
|
||||
using std::endl;
|
||||
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
using std::memmove;
|
||||
#endif
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
inline
|
||||
@ -227,7 +232,7 @@ void MathedArray::move(int p, int shift)
|
||||
{
|
||||
if (p <= last_) {
|
||||
need_size(last_ + shift);
|
||||
std::memmove(&bf_[p + shift], &bf_[p], last_ - p);
|
||||
memmove(&bf_[p + shift], &bf_[p], last_ - p);
|
||||
last_ += shift;
|
||||
bf_[last_] = 0;
|
||||
}
|
||||
|
@ -57,6 +57,11 @@ using std::endl;
|
||||
using std::vector;
|
||||
using std::max;
|
||||
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
using std::strlen;
|
||||
#endif
|
||||
|
||||
|
||||
extern string mathed_label;
|
||||
|
||||
extern char const * latex_special_chars;
|
||||
@ -982,7 +987,7 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
|
||||
|
||||
if (mathcursor) {
|
||||
MathMatrixInset * p = new MathMatrixInset(m, n);
|
||||
if (k > 2 && int(std::strlen(s)) > m)
|
||||
if (k > 2 && int(strlen(s)) > m)
|
||||
p->SetAlign(s[0], &s[1]);
|
||||
mathcursor->insertInset(p, LM_TC_ACTIVE_INSET);
|
||||
// Andre:
|
||||
|
@ -1,3 +1,14 @@
|
||||
2001-06-01 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* lstrings.C:
|
||||
* syscall.C:
|
||||
* syscontr.C:
|
||||
* LSubstring.C: bring C functions in global namespace if
|
||||
necessary.
|
||||
|
||||
* lstrings.h (compare): use the std:: version of str[n]cmp only
|
||||
when it exists.
|
||||
|
||||
2001-05-31 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* syscontr.C: add std::
|
||||
|
@ -18,6 +18,11 @@
|
||||
|
||||
#include "LSubstring.h"
|
||||
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
using std::strlen;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
LSubstring::LSubstring(string & s, size_type i, size_type l)
|
||||
: ps(&s), pos(i), n(l)
|
||||
@ -35,7 +40,7 @@ LSubstring::LSubstring(string & s, string const & s2)
|
||||
LSubstring::LSubstring(string & s, string::value_type const * p)
|
||||
: ps(&s)
|
||||
{
|
||||
n = std::strlen(p);
|
||||
n = strlen(p);
|
||||
pos = s.find(p);
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,7 @@ using std::transform;
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
using std::tolower;
|
||||
using std::toupper;
|
||||
using std::strlen;
|
||||
#endif
|
||||
|
||||
|
||||
@ -232,7 +233,7 @@ bool prefixIs(string const & a, char const * pre)
|
||||
{
|
||||
lyx::Assert(pre);
|
||||
|
||||
size_t const l = std::strlen(pre);
|
||||
size_t const l = strlen(pre);
|
||||
string::size_type const alen = a.length();
|
||||
|
||||
if (l > alen || a.empty())
|
||||
@ -280,7 +281,7 @@ bool suffixIs(string const & a, char const * suf)
|
||||
{
|
||||
lyx::Assert(suf);
|
||||
|
||||
size_t const suflen = std::strlen(suf);
|
||||
size_t const suflen = strlen(suf);
|
||||
string::size_type const alen = a.length();
|
||||
|
||||
if (suflen > alen)
|
||||
@ -478,7 +479,7 @@ string const subst(string const & a,
|
||||
|
||||
string lstr(a);
|
||||
string::size_type i = 0;
|
||||
string::size_type olen = std::strlen(oldstr);
|
||||
string::size_type olen = strlen(oldstr);
|
||||
while((i = lstr.find(oldstr, i)) != string::npos) {
|
||||
lstr.replace(i, olen, newstr);
|
||||
i += newstr.length(); // We need to be sure that we dont
|
||||
|
@ -34,14 +34,22 @@ int compare_no_case(string const & s, string const & s2, unsigned int len);
|
||||
inline
|
||||
int compare(char const * a, char const * b)
|
||||
{
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
return std::strcmp(a, b);
|
||||
#else
|
||||
return strcmp(a, b);
|
||||
#endif
|
||||
}
|
||||
|
||||
///
|
||||
inline
|
||||
int compare(char const * a, char const * b, unsigned int len)
|
||||
{
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
return std::strncmp(a, b, len);
|
||||
#else
|
||||
return strncmp(a, b, len);
|
||||
#endif
|
||||
}
|
||||
|
||||
///
|
||||
|
@ -20,6 +20,10 @@
|
||||
|
||||
using std::endl;
|
||||
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
using std::strerror;
|
||||
#endif
|
||||
|
||||
|
||||
Systemcalls::Systemcalls() {
|
||||
pid = 0; // No child yet
|
||||
@ -111,7 +115,7 @@ void Systemcalls::waitForChild() {
|
||||
pid_t waitrpid = waitpid(pid, &status, WUNTRACED);
|
||||
if (waitrpid == -1) {
|
||||
lyxerr << "LyX: Error waiting for child:"
|
||||
<< std::strerror(errno) << endl;
|
||||
<< strerror(errno) << endl;
|
||||
wait = false;
|
||||
} else if (WIFEXITED(status)) {
|
||||
// Child exited normally. Update return value.
|
||||
@ -178,14 +182,14 @@ pid_t Systemcalls::fork()
|
||||
execvp(syscmd, argv);
|
||||
// If something goes wrong, we end up here:
|
||||
lyxerr << "LyX: execvp failed: "
|
||||
<< std::strerror(errno) << endl;
|
||||
<< strerror(errno) << endl;
|
||||
} else if (cpid < 0) { // error
|
||||
#else
|
||||
pid_t cpid = spawnvp(P_SESSION|P_DEFAULT|P_MINIMIZE|P_BACKGROUND, syscmd, argv);
|
||||
if (cpid < 0) { // error
|
||||
#endif
|
||||
lyxerr << "LyX: Could not fork: "
|
||||
<< std::strerror(errno) << endl;
|
||||
<< strerror(errno) << endl;
|
||||
} else { // parent
|
||||
return cpid;
|
||||
}
|
||||
|
@ -15,6 +15,10 @@
|
||||
|
||||
using std::endl;
|
||||
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
using std::strerror;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Default constructor
|
||||
//
|
||||
@ -76,7 +80,7 @@ SystemcallsSingletoncontroller::timer() {
|
||||
int waitrpid = waitpid(pid, &stat_loc, WNOHANG);
|
||||
if (waitrpid == -1) {
|
||||
lyxerr << "LyX: Error waiting for child:"
|
||||
<< std::strerror(errno) << endl;
|
||||
<< strerror(errno) << endl;
|
||||
} else if (WIFEXITED(stat_loc) || WIFSIGNALED(stat_loc)) {
|
||||
if (WIFEXITED(stat_loc)) {
|
||||
// Ok, the return value goes into retval.
|
||||
|
@ -20,12 +20,15 @@ using std::istream;
|
||||
using std::getline;
|
||||
using std::endl;
|
||||
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
using std::strlen;
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
bool getTokenValue(string const & str, const char * token, string & ret)
|
||||
{
|
||||
size_t token_length = std::strlen(token);
|
||||
size_t token_length = strlen(token);
|
||||
string::size_type pos = str.find(token);
|
||||
|
||||
if (pos == string::npos || pos + token_length + 1 >= str.length()
|
||||
@ -48,12 +51,12 @@ bool getTokenValue(string const & str, const char * token, string & ret)
|
||||
bool getTokenValue(string const & str, const char * token, int & num)
|
||||
{
|
||||
string::size_type pos = str.find(token);
|
||||
char ch = str[pos + std::strlen(token)];
|
||||
char ch = str[pos + strlen(token)];
|
||||
|
||||
if ((pos == string::npos) || (ch != '='))
|
||||
return false;
|
||||
string ret;
|
||||
pos += std::strlen(token) + 1;
|
||||
pos += strlen(token) + 1;
|
||||
ch = str[pos];
|
||||
if ((ch != '"') && (ch != '\'')) { // only read till next space
|
||||
if (!isdigit(ch))
|
||||
@ -101,12 +104,12 @@ bool getTokenValue(string const & str, const char * token,
|
||||
bool getTokenValue(string const & str, const char * token, bool & flag)
|
||||
{
|
||||
string::size_type pos = str.find(token);
|
||||
char ch = str[pos + std::strlen(token)];
|
||||
char ch = str[pos + strlen(token)];
|
||||
|
||||
if ((pos == string::npos) || (ch != '='))
|
||||
return false;
|
||||
string ret;
|
||||
pos += std::strlen(token) + 1;
|
||||
pos += strlen(token) + 1;
|
||||
ch = str[pos];
|
||||
if ((ch != '"') && (ch != '\'')) { // only read till next space
|
||||
if (!isdigit(ch))
|
||||
|
@ -41,6 +41,10 @@ using std::max;
|
||||
using std::endl;
|
||||
using std::vector;
|
||||
|
||||
#ifndef CXX_GLOBAL_CSTD
|
||||
using std::strlen;
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
int const WIDTH_OF_LINE = 5;
|
||||
@ -1149,7 +1153,7 @@ bool string2type(string const str, bool & num)
|
||||
|
||||
bool getTokenValue(string const & str, const char * token, string & ret)
|
||||
{
|
||||
size_t token_length = std::strlen(token);
|
||||
size_t token_length = strlen(token);
|
||||
string::size_type pos = str.find(token);
|
||||
|
||||
if (pos == string::npos || pos + token_length + 1 >= str.length()
|
||||
|
Loading…
Reference in New Issue
Block a user