Kaydet (Commit) 2659ded9 authored tarafından Thorsten Behrens's avatar Thorsten Behrens

#i80285# Initial import for the xpdf PDF parser

üst b7171963
#*************************************************************************
#
# OpenOffice.org - a multi-platform office productivity suite
#
# $RCSfile: makefile.mk,v $
#
# $Revision: 1.1 $
#
# last change: $Author: thb $ $Date: 2007-12-05 14:16:39 $
#
# The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1.
#
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2005 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#*************************************************************************
# dmake create_clean -- just unpacks
# dmake patch -- unpacks and applies patch file
# dmake create_patch -- creates a patch file
PRJ=.
PRJNAME=xpdf
TARGET=xpdflib
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
# --- Files --------------------------------------------------------
TARFILE_NAME=xpdf-3.02
PATCH_FILE_NAME=$(TARFILE_NAME).patch
CONFIGURE_DIR=
BUILD_DIR=$(CONFIGURE_DIR)
.IF "$(GUI)"=="UNX"
#CONFIGURE_ACTION=./configure
#CONFIGURE_ACTION=./configure --without-x --enable-multithreaded --enable-exceptions CFLAGS="-g -O0" CXXFLAGS="-g -O0"
CONFIGURE_ACTION=./configure --without-x --enable-multithreaded --enable-exceptions
BUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS)
.ELSE
CONFIGURE_ACTION=
BUILD_ACTION=ms_make
.ENDIF
CONVERTFILES=ms_make.bat
BUILD_FLAGS=
OUT2INC= \
fofi$/*.h \
goo$/*.h \
xpdf$/*.h \
aconf.h \
aconf2.h
.IF "$(GUI)"=="UNX"
OUT2LIB= \
fofi$/lib*.a \
goo$/lib*.a \
xpdf$/lib*.a
.ELSE
OUT2LIB= \
fofi$/*.lib \
goo$/*.lib \
xpdf$/*.lib
.ENDIF
# --- Targets ------------------------------------------------------
.INCLUDE : set_ext.mk
.INCLUDE : target.mk
.INCLUDE : tg_ext.mk
xp xpdf : solenv NULL
xp xpdf nmake - all xp_xpdf NULL
xp xpdf\wrapper nmake - all xp_xpdfwrap xp_xpdf NULL
xp xpdf\test nmake - all xp_parsetest xp_xpdfwrap NULL
mkdir: %_DEST%\inc%_EXT%\xpdf
..\%__SRC%\bin\xpdfimport.* %_DEST%\bin%_EXT%\xpdfimport.*
..\%__SRC%\bin\xpdfimport %_DEST%\bin%_EXT%\xpdfimport
#*************************************************************************
#
# OpenOffice.org - a multi-platform office productivity suite
#
# $RCSfile: makefile.mk,v $
#
# $Revision: 1.1 $
#
# last change: $Author: thb $ $Date: 2007-12-05 14:16:42 $
#
# The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1.
#
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2005 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#*************************************************************************
PRJ=..
PRJNAME=xpdf
TARGET=test
TARGETTYPE=CUI
ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
ALLTAR : $(MISC)$/test_0_succeeded $(MISC)$/test_1_succeeded
$(MISC)$/test_0_succeeded: $(BIN)$/xpdfimport$(EXECPOST) binary_0_out.def text_0_out.def testinput.pdf
$(BIN)$/xpdfimport -f $(MISC)$/binary_0_out testinput.pdf > $(MISC)$/text_0_out
diff $(MISC)$/binary_0_out binary_0_out.def
diff $(MISC)$/text_0_out text_0_out.def
$(TOUCH) $@
$(MISC)$/test_1_succeeded: $(BIN)$/xpdfimport$(EXECPOST) binary_1_out.def text_1_out.def book.pdf
$(BIN)$/xpdfimport -f $(MISC)$/binary_1_out book.pdf > $(MISC)$/text_1_out
diff $(MISC)$/binary_1_out binary_1_out.def
diff $(MISC)$/text_1_out text_1_out.def
$(TOUCH) $@
#*************************************************************************
#
# OpenOffice.org - a multi-platform office productivity suite
#
# $RCSfile: makefile.mk,v $
#
# $Revision: 1.1 $
#
# last change: $Author: thb $ $Date: 2007-12-05 14:16:44 $
#
# The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1.
#
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2005 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#*************************************************************************
PRJ=..
PRJNAME=xpdf
TARGET=xpdfimport
TARGETTYPE=CUI
ENABLE_EXCEPTIONS=TRUE
EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
# --- Files --------------------------------------------------------
APP1TARGET=$(TARGET)
APP1LIBSALCPPRT=
APP1OBJS= \
$(OBJ)$/wrapper_gpl.obj $(OBJ)/pdfioutdev_gpl.obj
.IF "$(GUI)" == "WNT"
APP1STDLIBS+=xpdf.lib fofi.lib Goo.lib gdi32.lib advapi32.lib
.ELSE
APP1STDLIBS+=-lxpdf -lfofi -lGoo
.ENDIF
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
This diff is collapsed.
This diff is collapsed.
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: wrapper_gpl.cxx,v $
*
* $Revision: 1.1 $
*
* last change: $Author: thb $ $Date: 2007-12-05 14:16:44 $
*
* The Contents of this file are made available subject to
* the terms of GNU General Public License Version 2.
*
*
* GNU General Public License, version 2
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
************************************************************************/
#include "pdfioutdev_gpl.hxx"
#ifdef WNT
# include <io.h>
# include <fcntl.h> /*_O_BINARY*/
#endif
static char ownerPassword[33] = "\001";
static char userPassword[33] = "\001";
static char outputFile[256] = "\001";
static char cfgFileName[256] = "";
FILE* g_binary_out=stderr;
static ArgDesc argDesc[] = {
{"-f", argString, outputFile, sizeof(outputFile),
"output file for binary streams"},
{"-opw", argString, ownerPassword, sizeof(ownerPassword),
"owner password (for encrypted files)"},
{"-upw", argString, userPassword, sizeof(userPassword),
"user password (for encrypted files)"},
{NULL, argString, NULL, 0, NULL }
};
int main(int argc, char **argv)
{
// parse args; initialize to defaults
if( !parseArgs(argDesc, &argc, argv) )
return 1;
if( argc < 2 )
return 1;
// read config file
globalParams = new GlobalParams(cfgFileName);
globalParams->setErrQuiet(gTrue);
globalParams->setupBaseFonts(NULL);
// PDFDoc takes over ownership for all strings below
GString* pFileName = new GString(argv[1]);
// check for password string(s)
GString* pOwnerPasswordStr(
ownerPassword[0] != '\001' ? new GString(ownerPassword)
: (GString *)NULL );
GString* pUserPasswordStr(
userPassword[0] != '\001' ? new GString(userPassword)
: (GString *)NULL );
if( outputFile[0] != '\001' )
g_binary_out = fopen(outputFile,"wb");
#ifdef WNT
// Win actually modifies output for O_TEXT file mode, so need to
// revert to binary here
_setmode( _fileno( g_binary_out ), _O_BINARY );
#endif
PDFDoc aDoc( pFileName,
pOwnerPasswordStr,
pUserPasswordStr );
if( !aDoc.isOk() )
return 1;
pdfi::PDFOutDev* pOutDev( new pdfi::PDFOutDev(&aDoc) );
// tell receiver early - needed for proper progress calculation
pOutDev->setPageNum( aDoc.getNumPages() );
// virtual resolution of the PDF OutputDev in dpi
static const int PDFI_OUTDEV_RESOLUTION=7200;
// do the conversion
const int nPages = aDoc.getNumPages();
for( int i=1; i<=nPages; ++i )
{
aDoc.displayPage( pOutDev,
i,
PDFI_OUTDEV_RESOLUTION,
PDFI_OUTDEV_RESOLUTION,
0, gTrue, gTrue, gTrue );
aDoc.processLinks( pOutDev, i );
}
return 0;
}
--- misc/patch/xpdf-3.02/aconf.h 1970-01-01 01:00:00.000000000 +0100
+++ misc/build/xpdf-3.02/aconf.h 2007-08-07 15:44:36.000000000 +0200
@@ -0,0 +1,104 @@
+/* aconf.h. Generated by configure. */
+/*
+ * aconf.h
+ *
+ * Copyright 2002-2003 Glyph & Cog, LLC
+ */
+
+#ifndef ACONF_H
+#define ACONF_H
+
+#include <aconf2.h>
+
+/*
+ * Use A4 paper size instead of Letter for PostScript output.
+ */
+/* #undef A4_PAPER */
+
+/*
+ * Do not allow text selection.
+ */
+/* #undef NO_TEXT_SELECT */
+
+/*
+ * Include support for OPI comments.
+ */
+/* #undef OPI_SUPPORT */
+
+/*
+ * Enable multithreading support.
+ */
+/* #undef MULTITHREADED */
+
+/*
+ * Enable word list support.
+ */
+/* #undef TEXTOUT_WORD_LIST */
+
+/*
+ * Directory with the Xpdf app-defaults file.
+ */
+/* #undef APPDEFDIR */
+
+/*
+ * Full path for the system-wide xpdfrc file.
+ */
+#define SYSTEM_XPDFRC "/usr/local/etc/xpdfrc"
+
+/*
+ * Various include files and functions.
+ */
+#define HAVE_DIRENT_H 1
+/* #undef HAVE_SYS_NDIR_H */
+/* #undef HAVE_SYS_DIR_H */
+/* #undef HAVE_NDIR_H */
+/* #undef HAVE_SYS_SELECT_H */
+/* #undef HAVE_SYS_BSDTYPES_H */
+#define HAVE_STRINGS_H 1
+/* #undef HAVE_BSTRING_H */
+#define HAVE_POPEN 1
+#define HAVE_MKSTEMP 1
+/* #undef HAVE_MKSTEMPS */
+/* #undef SELECT_TAKES_INT */
+#if ! defined WNT
+#define HAVE_FSEEKO 1
+#endif
+/* #undef HAVE_FSEEK64 */
+#define _FILE_OFFSET_BITS 64
+/* #undef _LARGE_FILES */
+#define _LARGEFILE_SOURCE 1
+/* #undef HAVE_XTAPPSETEXITFLAG 1 */
+
+/*
+ * This is defined if using libXpm.
+ */
+/* #undef HAVE_X11_XPM_H 1 */
+
+/*
+ * This is defined if using t1lib.
+ */
+/* #undef HAVE_T1LIB_H 1 */
+
+/*
+ * One of these is defined if using FreeType 2.
+ */
+/* #undef HAVE_FREETYPE_H */
+/* #undef HAVE_FREETYPE_FREETYPE_H 1 */
+
+/*
+ * This is defined if using libpaper.
+ */
+/* #undef HAVE_PAPER_H */
+
+/*
+ * Enable support for loading plugins.
+ */
+/* #undef ENABLE_PLUGINS */
+
+/*
+ * Enable support for CMYK output.
+ */
+/* #undef SPLASH_CMYK */
+
+
+#endif
*** misc/xpdf-3.02/ms_make.bat Tue Feb 27 23:05:51 2007
--- misc/build/xpdf-3.02/ms_make.bat Fri Sep 14 20:08:02 2007
***************
*** 1,5 ****
set CC=cl
! set CFLAGS=/DWIN32 /I.. /I..\goo /I..\fofi /O2 /nologo
set CXX=cl
set CXXFLAGS=%CFLAGS% /TP
set LIBPROG=lib
--- 1,5 ----
set CC=cl
! set CFLAGS=/DWIN32 /D_MT /I.. /I..\goo /I..\fofi /O2 /nologo
set CXX=cl
set CXXFLAGS=%CFLAGS% /TP
set LIBPROG=lib
***************
*** 70,75 ****
--- 70,77 ----
%CXX% %CXXFLAGS% /c pdffonts.cc
%CXX% %CXXFLAGS% /c pdfimages.cc
+ %LIBPROG% /nologo /out:xpdf.lib Annot.obj Array.obj BuiltinFont.obj BuiltinFontTables.obj Catalog.obj CharCodeToUnicode.obj CMap.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj Outline.obj OutputDev.obj Page.obj Parser.obj PDFDoc.obj PDFDocEncoding.obj PSTokenizer.obj SecurityHandler.obj Stream.obj UnicodeMap.obj XRef.obj
+
%CXX% %LINKFLAGS% /Fepdftops.exe Annot.obj Array.obj BuiltinFont.obj BuiltinFontTables.obj Catalog.obj CharCodeToUnicode.obj CMap.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj Outline.obj OutputDev.obj Page.obj Parser.obj PDFDoc.obj PDFDocEncoding.obj PSOutputDev.obj PSTokenizer.obj SecurityHandler.obj Stream.obj UnicodeMap.obj XRef.obj pdftops.obj ..\fofi\fofi.lib ..\goo\Goo.lib shell32.lib user32.lib gdi32.lib advapi32.lib
%CXX% %LINKFLAGS% /Fepdftotext.exe Annot.obj Array.obj BuiltinFont.obj BuiltinFontTables.obj Catalog.obj CharCodeToUnicode.obj CMap.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj Outline.obj OutputDev.obj Page.obj Parser.obj PDFDoc.obj PDFDocEncoding.obj PSTokenizer.obj SecurityHandler.obj Stream.obj TextOutputDev.obj UnicodeMap.obj UnicodeTypeTable.obj XRef.obj pdftotext.obj ..\fofi\fofi.lib ..\goo\Goo.lib shell32.lib user32.lib gdi32.lib advapi32.lib
***************
*** 82,118 ****
cd ..
- rem --- This part will only work if you have FreeType installed ---
-
- set FT2DIR=..\freetype-2.3.1
- set CXXFLAGS=%CXXFLAGS% /I..\splash /I%FT2DIR%\include
-
- cd splash
- %CXX% %CXXFLAGS% /c Splash.cc
- %CXX% %CXXFLAGS% /c SplashBitmap.cc
- %CXX% %CXXFLAGS% /c SplashClip.cc
- %CXX% %CXXFLAGS% /c SplashFTFont.cc
- %CXX% %CXXFLAGS% /c SplashFTFontEngine.cc
- %CXX% %CXXFLAGS% /c SplashFTFontFile.cc
- %CXX% %CXXFLAGS% /c SplashFont.cc
- %CXX% %CXXFLAGS% /c SplashFontEngine.cc
- %CXX% %CXXFLAGS% /c SplashFontFile.cc
- %CXX% %CXXFLAGS% /c SplashFontFileID.cc
- %CXX% %CXXFLAGS% /c SplashPath.cc
- %CXX% %CXXFLAGS% /c SplashPattern.cc
- %CXX% %CXXFLAGS% /c SplashScreen.cc
- %CXX% %CXXFLAGS% /c SplashState.cc
- %CXX% %CXXFLAGS% /c SplashT1Font.cc
- %CXX% %CXXFLAGS% /c SplashT1FontEngine.cc
- %CXX% %CXXFLAGS% /c SplashT1FontFile.cc
- %CXX% %CXXFLAGS% /c SplashXPath.cc
- %CXX% %CXXFLAGS% /c SplashXPathScanner.cc
- %LIBPROG% /nologo /out:splash.lib Splash.obj SplashBitmap.obj SplashClip.obj SplashFTFont.obj SplashFTFontEngine.obj SplashFTFontFile.obj SplashFont.obj SplashFontEngine.obj SplashFontFile.obj SplashFontFileID.obj SplashPath.obj SplashPattern.obj SplashScreen.obj SplashState.obj SplashT1Font.obj SplashT1FontEngine.obj SplashT1FontFile.obj SplashXPath.obj SplashXPathScanner.obj
-
- cd ..\xpdf
- %CXX% %CXXFLAGS% /c SplashOutputDev.cc
- %CXX% %CXXFLAGS% /c pdftoppm.cc
-
- %CXX% %LINKFLAGS% /Fepdftoppm.exe Annot.obj Array.obj BuiltinFont.obj BuiltinFontTables.obj Catalog.obj CharCodeToUnicode.obj CMap.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj Outline.obj OutputDev.obj Page.obj Parser.obj PDFDoc.obj PDFDocEncoding.obj PSTokenizer.obj SecurityHandler.obj SplashOutputDev.obj Stream.obj UnicodeMap.obj UnicodeTypeTable.obj XRef.obj pdftoppm.obj ..\splash\splash.lib ..\fofi\fofi.lib ..\goo\Goo.lib %FT2DIR%\freetype2.lib shell32.lib user32.lib gdi32.lib advapi32.lib
-
- cd ..
--- 84,86 ----
*** misc/xpdf-3.02/xpdf/Makefile.in Tue Feb 27 23:05:52 2007
--- misc/build/xpdf-3.02/xpdf/Makefile.in Fri Sep 14 20:17:25 2007
***************
*** 20,25 ****
--- 20,27 ----
SPLASHLIBDIR = ../splash
CXXFLAGS = @CXXFLAGS@ @DEFS@ -I.. -I$(GOOSRCDIR) -I$(FOFISRCDIR) -I$(SPLASHSRCDIR) -I$(srcdir) @freetype2_CFLAGS@ @Sgm_CFLAGS@ @Xm_CFLAGS@ @Xt_CFLAGS@ @Xp_CFLAGS@ @Xext_CFLAGS@ @Xpm_CFLAGS@ @t1_CFLAGS@ @libpaper_CFLAGS@ @X_CFLAGS@
+ AR = ar rc
+ RANLIB = ranlib
LDFLAGS = @LDFLAGS@
***************
*** 107,116 ****
#------------------------------------------------------------------------
all: xpdf$(EXE) pdftops$(EXE) pdftotext$(EXE) pdfinfo$(EXE) \
! pdffonts$(EXE) pdftoppm$(EXE) pdfimages$(EXE)
all-no-x: pdftops$(EXE) pdftotext$(EXE) pdfinfo$(EXE) pdffonts$(EXE) \
! pdfimages$(EXE)
#------------------------------------------------------------------------
--- 109,135 ----
#------------------------------------------------------------------------
all: xpdf$(EXE) pdftops$(EXE) pdftotext$(EXE) pdfinfo$(EXE) \
! pdffonts$(EXE) pdftoppm$(EXE) pdfimages$(EXE) $(LIBPREFIX)xpdf.a
all-no-x: pdftops$(EXE) pdftotext$(EXE) pdfinfo$(EXE) pdffonts$(EXE) \
! pdfimages$(EXE) $(LIBPREFIX)xpdf.a
!
! #------------------------------------------------------------------------
!
! XPDFLIB_OBJS = Annot.o Array.o BuiltinFont.o BuiltinFontTables.o Catalog.o \
! CharCodeToUnicode.o CMap.o Decrypt.o Dict.o \
! Error.o FontEncodingTables.o Function.o Gfx.o GfxFont.o \
! GfxState.o GlobalParams.o JArithmeticDecoder.o JBIG2Stream.o \
! JPXStream.o Lexer.o Link.o NameToCharCode.o Object.o Outline.o \
! OutputDev.o Page.o Parser.o PDFCore.o PDFDoc.o PDFDocEncoding.o \
! PSTokenizer.o SecurityHandler.o \
! Stream.o UnicodeMap.o \
! UnicodeTypeTable.o XRef.o
!
! $(LIBPREFIX)xpdf.a: $(XPDFLIB_OBJS)
! rm -f $(LIBPREFIX)xpdf.a
! $(AR) $(LIBPREFIX)xpdf.a $(XPDFLIB_OBJS)
! $(RANLIB) $(LIBPREFIX)xpdf.a
#------------------------------------------------------------------------
*** misc/xpdf-3.02/goo/GString.cc Tue Feb 27 23:05:51 2007
--- misc/build/xpdf-3.02/goo/GString.cc Wed Sep 26 09:43:50 2007
***************
*** 528,534 ****
if ((neg = x < 0)) {
x = -x;
}
! x = floor(x * pow(10, prec) + 0.5);
i = bufSize;
started = !trim;
for (j = 0; j < prec && i > 1; ++j) {
--- 528,534 ----
if ((neg = x < 0)) {
x = -x;
}
! x = floor(x * pow(10.0, prec) + 0.5);
i = bufSize;
started = !trim;
for (j = 0; j < prec && i > 1; ++j) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment