summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjoye <joye>2014-03-17 14:43:29 (GMT)
committerjoye <joye>2014-03-17 14:43:29 (GMT)
commit2502655cf696ac6b78ade1376845f3726e6179d6 (patch)
tree05ce2df952a79ce14be6a82c3f6c224b3f715c71 /src
parent1ca1642ae4c8db4b77c0247e3a8e86f87b58254e (diff)
downloadblt-2502655cf696ac6b78ade1376845f3726e6179d6.zip
blt-2502655cf696ac6b78ade1376845f3726e6179d6.tar.gz
blt-2502655cf696ac6b78ade1376845f3726e6179d6.tar.bz2
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/bltGrPSOutput.C6
-rw-r--r--src/bltParse.C15
2 files changed, 10 insertions, 11 deletions
diff --git a/src/bltGrPSOutput.C b/src/bltGrPSOutput.C
index 58dcb52..949cdbb 100644
--- a/src/bltGrPSOutput.C
+++ b/src/bltGrPSOutput.C
@@ -28,6 +28,7 @@
*
*/
+extern "C" {
#include <stdarg.h>
#include <X11/Xlib.h>
@@ -41,6 +42,7 @@
#include "bltInt.h"
#include "bltMath.h"
#include "bltPsInt.h"
+};
#define FONT_ITALIC (1<<0)
#define FONT_BOLD (1<<1)
@@ -114,9 +116,7 @@ int Blt_Ps_ComputeBoundingBox(PageSetup *setupPtr, int width, int height)
PostScript *Blt_Ps_Create(Tcl_Interp* interp, PageSetup *setupPtr)
{
- PostScript *psPtr;
-
- psPtr = malloc(sizeof(PostScript));
+ PostScript* psPtr = (PostScript*)malloc(sizeof(PostScript));
psPtr->setupPtr = setupPtr;
psPtr->interp = interp;
Tcl_DStringInit(&psPtr->dString);
diff --git a/src/bltParse.C b/src/bltParse.C
index a2fa375..930a2b1 100644
--- a/src/bltParse.C
+++ b/src/bltParse.C
@@ -23,8 +23,10 @@
* since the compiled code typically runs only one time.
*/
+extern "C" {
#include "bltInt.h"
#include "bltParse.h"
+};
/*
* A table used to classify input characters to assist in parsing
@@ -358,20 +360,17 @@ void Blt_ExpandParseValue(
int needed) /* Minimum amount of additional space
* to allocate. */
{
- int size;
- char *buffer;
-
/*
* Either double the size of the buffer or add enough new space
* to meet the demand, whichever produces a larger new buffer.
*/
- size = (parsePtr->end - parsePtr->buffer) + 1;
- if (size < needed) {
+ int size = (parsePtr->end - parsePtr->buffer) + 1;
+ if (size < needed)
size += needed;
- } else {
+ else
size += size;
- }
- buffer = malloc((unsigned int)size);
+
+ char* buffer = (char*)malloc((unsigned int)size);
/*
* Copy from old buffer to new, free old buffer if needed, and