summaryrefslogtreecommitdiffstats
path: root/libmscgen
diff options
context:
space:
mode:
Diffstat (limited to 'libmscgen')
-rw-r--r--libmscgen/CMakeLists.txt17
-rw-r--r--libmscgen/gd.c90
-rw-r--r--libmscgen/gd.h10
-rw-r--r--libmscgen/gd_intern.h2
-rw-r--r--libmscgen/mscgen_adraw.h2
-rw-r--r--libmscgen/mscgen_adraw_int.h2
-rw-r--r--libmscgen/mscgen_api.c16
-rw-r--r--libmscgen/mscgen_gd_out.c2
-rw-r--r--libmscgen/mscgen_lexer.l8
-rw-r--r--libmscgen/mscgen_msc.c2
-rw-r--r--libmscgen/mscgen_msc.h6
-rw-r--r--libmscgen/mscgen_usage.c2
-rw-r--r--libmscgen/mscgen_utf8.c4
13 files changed, 87 insertions, 76 deletions
diff --git a/libmscgen/CMakeLists.txt b/libmscgen/CMakeLists.txt
index 3d67ed3..079fcfc 100644
--- a/libmscgen/CMakeLists.txt
+++ b/libmscgen/CMakeLists.txt
@@ -4,6 +4,18 @@ include_directories(
${GENERATED_SRC}
)
+set(LEX_FILES mscgen_lexer)
+foreach(lex_file ${LEX_FILES})
+ add_custom_command(
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/libmscgen/${lex_file}.l > ${GENERATED_SRC}/${lex_file}.l.h
+ DEPENDS ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/libmscgen/${lex_file}.l
+ OUTPUT ${GENERATED_SRC}/${lex_file}.l.h
+ )
+ set_source_files_properties(${GENERATED_SRC}/${lex_file}.l.h PROPERTIES GENERATED 1)
+
+ FLEX_TARGET(${lex_file} ${lex_file}.l ${GENERATED_SRC}/${lex_file}.cpp COMPILE_FLAGS "${LEX_FLAGS}")
+endforeach()
+
add_library(mscgen
gd.c
gd_security.c
@@ -19,6 +31,7 @@ mscgen_ps_out.c
mscgen_null_out.c
${GENERATED_SRC}/mscgen_language.cpp
${GENERATED_SRC}/mscgen_lexer.cpp
+${GENERATED_SRC}/mscgen_lexer.l.h
mscgen_api.c
mscgen_msc.c
mscgen_safe.c
@@ -28,10 +41,6 @@ mscgen_utf8.c
)
-FLEX_TARGET(mscgen_lexer
- mscgen_lexer.l
- ${GENERATED_SRC}/mscgen_lexer.cpp
- COMPILE_FLAGS "${LEX_FLAGS}")
BISON_TARGET(mscgen_language
mscgen_language.y
${GENERATED_SRC}/mscgen_language.cpp
diff --git a/libmscgen/gd.c b/libmscgen/gd.c
index 7f0a258..7e8b241 100644
--- a/libmscgen/gd.c
+++ b/libmscgen/gd.c
@@ -501,7 +501,7 @@ BGD_DECLARE(int) gdImageColorClosestAlpha (gdImagePtr im, int r, int g, int b, i
#define RETURN_HWB(h, w, b) {HWB->H = h; HWB->W = w; HWB->B = b; return HWB;}
#define RETURN_RGB(r, g, b) {RGB->R = r; RGB->G = g; RGB->B = b; return RGB;}
#define HWB_UNDEFINED -1
-#define SETUP_RGB(s, r, g, b) {s.R = r/255.0; s.G = g/255.0; s.B = b/255.0;}
+#define SETUP_RGB(s, r, g, b) {s.R = r/255.0f; s.G = g/255.0f; s.B = b/255.0f;}
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MIN3(a,b,c) ((a)<(b)?(MIN(a,c)):(MIN(b,c)))
@@ -567,7 +567,7 @@ HWB_Diff (int r1, int g1, int b1, int r2, int g2, int b2)
if ((HWB1.H == HWB_UNDEFINED) || (HWB2.H == HWB_UNDEFINED)) {
diff = 0; /* Undefined hues always match... */
} else {
- diff = fabs (HWB1.H - HWB2.H);
+ diff = fabsf(HWB1.H - HWB2.H);
if (diff > 3) {
diff = 6 - diff; /* Remember, it's a colour circle */
}
@@ -1191,7 +1191,7 @@ clip_1d (int *x0, int *y0, int *x1, int *y1, int mindim, int maxdim)
*x0 = mindim;
/* now, perhaps, adjust the far end of the line as well */
if (*x1 > maxdim) {
- *y1 += m * (maxdim - *x1);
+ *y1 += (int)(m * (maxdim - *x1));
*x1 = maxdim;
}
return 1;
@@ -1594,7 +1594,7 @@ BGD_DECLARE(void) gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, in
TBB: but watch out for /0! */
double ac = cos (atan2 (dy, dx));
if (ac != 0) {
- wid = thick / ac;
+ wid = (int)(thick / ac);
} else {
wid = 1;
}
@@ -1654,7 +1654,7 @@ BGD_DECLARE(void) gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, in
TBB: but watch out for /0! */
double as = sin (atan2 (dy, dx));
if (as != 0) {
- wid = thick / as;
+ wid = (int)(thick / as);
} else {
wid = 1;
}
@@ -1734,7 +1734,7 @@ BGD_DECLARE(void) gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int
TBB: but watch out for /0! */
double as = sin (atan2 (dy, dx));
if (as != 0) {
- wid = thick / as;
+ wid = (int)(thick / as);
} else {
wid = 1;
}
@@ -1783,7 +1783,7 @@ BGD_DECLARE(void) gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int
TBB: but watch out for /0! */
double as = sin (atan2 (dy, dx));
if (as != 0) {
- wid = thick / as;
+ wid = (int)(thick / as);
} else {
wid = 1;
}
@@ -2273,7 +2273,7 @@ BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border,
/* Seek left */
int leftLimit, rightLimit;
int i;
- int restoreAlphaBleding;
+ int restoreAlphaBlending;
if (border < 0 || color < 0) {
/* Refuse to fill to a non-solid border */
@@ -2288,7 +2288,7 @@ BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border,
leftLimit = (-1);
- restoreAlphaBleding = im->alphaBlendingFlag;
+ restoreAlphaBlending = im->alphaBlendingFlag;
im->alphaBlendingFlag = 0;
if (x >= im->sx) {
@@ -2310,7 +2310,7 @@ BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border,
leftLimit = i;
}
if (leftLimit == (-1)) {
- im->alphaBlendingFlag = restoreAlphaBleding;
+ im->alphaBlendingFlag = restoreAlphaBlending;
return;
}
/* Seek right */
@@ -2354,7 +2354,7 @@ BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border,
}
}
}
- im->alphaBlendingFlag = restoreAlphaBleding;
+ im->alphaBlendingFlag = restoreAlphaBlending;
}
/*
@@ -3071,12 +3071,12 @@ BGD_DECLARE(void) gdImageCopyMerge (gdImagePtr dst, gdImagePtr src, int dstX, in
} else {
dc = gdImageGetPixel (dst, tox, toy);
- ncR = gdImageRed (src, c) * (pct / 100.0)
- + gdImageRed (dst, dc) * ((100 - pct) / 100.0);
- ncG = gdImageGreen (src, c) * (pct / 100.0)
- + gdImageGreen (dst, dc) * ((100 - pct) / 100.0);
- ncB = gdImageBlue (src, c) * (pct / 100.0)
- + gdImageBlue (dst, dc) * ((100 - pct) / 100.0);
+ ncR = (int)(gdImageRed (src, c) * (pct / 100.0)
+ + gdImageRed (dst, dc) * ((100 - pct) / 100.0));
+ ncG = (int)(gdImageGreen (src, c) * (pct / 100.0)
+ + gdImageGreen (dst, dc) * ((100 - pct) / 100.0));
+ ncB = (int)(gdImageBlue (src, c) * (pct / 100.0)
+ + gdImageBlue (dst, dc) * ((100 - pct) / 100.0));
/* Find a reasonable color */
nc = gdImageColorResolve (dst, ncR, ncG, ncB);
@@ -3144,15 +3144,15 @@ BGD_DECLARE(void) gdImageCopyMergeGray (gdImagePtr dst, gdImagePtr src, int dstX
nc = c;
} else {
dc = gdImageGetPixel (dst, tox, toy);
- g = 0.29900 * gdImageRed(dst, dc)
- + 0.58700 * gdImageGreen(dst, dc) + 0.11400 * gdImageBlue(dst, dc);
+ g = 0.29900f * gdImageRed(dst, dc)
+ + 0.58700f * gdImageGreen(dst, dc) + 0.11400f * gdImageBlue(dst, dc);
- ncR = gdImageRed (src, c) * (pct / 100.0)
- + g * ((100 - pct) / 100.0);
- ncG = gdImageGreen (src, c) * (pct / 100.0)
- + g * ((100 - pct) / 100.0);
- ncB = gdImageBlue (src, c) * (pct / 100.0)
- + g * ((100 - pct) / 100.0);
+ ncR = (int)(gdImageRed (src, c) * (pct / 100.0)
+ + g * ((100 - pct) / 100.0));
+ ncG = (int)(gdImageGreen (src, c) * (pct / 100.0)
+ + g * ((100 - pct) / 100.0));
+ ncB = (int)(gdImageBlue (src, c) * (pct / 100.0)
+ + g * ((100 - pct) / 100.0));
/* First look for an exact match */
nc = gdImageColorExact (dst, ncR, ncG, ncB);
@@ -3378,14 +3378,14 @@ BGD_DECLARE(void) gdImageCopyRotated (gdImagePtr dst,
for (dx = dstX - radius; (dx <= dstX + radius); dx++) {
double sxd = (dx - dstX) * aCos - (dy - dstY) * aSin;
double syd = (dy - dstY) * aCos + (dx - dstX) * aSin;
- int sx = sxd + scX;
- int sy = syd + scY;
+ int sx = (int)(sxd + scX);
+ int sy = (int)(syd + scY);
if ((sx >= srcX) && (sx < srcX + srcWidth) &&
(sy >= srcY) && (sy < srcY + srcHeight)) {
int c = gdImageGetPixel (src, sx, sy);
/* 2.0.34: transparency wins */
if (c == src->transparent) {
- gdImageSetPixel (dst, dx, dy, dst->transparent);
+ gdImageSetPixel (dst, (int)dx, (int)dy, dst->transparent);
} else if (!src->trueColor) {
/* Use a table to avoid an expensive
lookup on every single pixel */
@@ -3399,10 +3399,10 @@ BGD_DECLARE(void) gdImageCopyRotated (gdImagePtr dst,
gdImageAlpha (src,
c));
}
- gdImageSetPixel (dst, dx, dy, cmap[c]);
+ gdImageSetPixel (dst, (int)dx, (int)dy, cmap[c]);
} else {
gdImageSetPixel (dst,
- dx, dy,
+ (int)dx, (int)dy,
gdImageColorResolveAlpha (dst,
gdImageRed (src,
c),
@@ -3469,16 +3469,16 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
for (x = dstX; (x < dstX + dstW); x++) {
float sy1, sy2, sx1, sx2;
float sx, sy;
- float spixels = 0.0;
- float red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0;
- float alpha_factor, alpha_sum = 0.0, contrib_sum = 0.0;
+ float spixels = 0.0f;
+ float red = 0.0f, green = 0.0f, blue = 0.0f, alpha = 0.0f;
+ float alpha_factor, alpha_sum = 0.0f, contrib_sum = 0.0f;
sy1 = ((float)(y - dstY)) * (float)srcH / (float)dstH;
sy2 = ((float)(y + 1 - dstY)) * (float) srcH / (float) dstH;
sy = sy1;
do {
float yportion;
if (floorf(sy) == floorf(sy1)) {
- yportion = 1.0 - (sy - floorf(sy));
+ yportion = 1.0f - (sy - floorf(sy));
if (yportion > sy2 - sy1) {
yportion = sy2 - sy1;
}
@@ -3486,7 +3486,7 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
} else if (sy == floorf(sy2)) {
yportion = sy2 - floorf(sy2);
} else {
- yportion = 1.0;
+ yportion = 1.0f;
}
sx1 = ((float)(x - dstX)) * (float) srcW / dstW;
sx2 = ((float)(x + 1 - dstX)) * (float) srcW / dstW;
@@ -3496,7 +3496,7 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
float pcontribution;
int p;
if (floorf(sx) == floorf(sx1)) {
- xportion = 1.0 - (sx - floorf(sx));
+ xportion = 1.0f - (sx - floorf(sx));
if (xportion > sx2 - sx1) {
xportion = sx2 - sx1;
}
@@ -3504,7 +3504,7 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
} else if (sx == floorf(sx2)) {
xportion = sx2 - floorf(sx2);
} else {
- xportion = 1.0;
+ xportion = 1.0f;
}
pcontribution = xportion * yportion;
p = gdImageGetTrueColorPixel(src, (int) sx + srcX, (int) sy + srcY);
@@ -3517,14 +3517,14 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
alpha_sum += alpha_factor;
contrib_sum += pcontribution;
spixels += xportion * yportion;
- sx += 1.0;
+ sx += 1.0f;
}
while (sx < sx2);
sy += 1.0f;
}
while (sy < sy2);
- if (spixels != 0.0) {
+ if (spixels != 0.0f) {
red /= spixels;
green /= spixels;
blue /= spixels;
@@ -3539,14 +3539,14 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
blue /= alpha_sum;
}
/* Clamping to allow for rounding errors above */
- if (red > 255.0) {
- red = 255.0;
+ if (red > 255.0f) {
+ red = 255.0f;
}
- if (green > 255.0) {
- green = 255.0;
+ if (green > 255.0f) {
+ green = 255.0f;
}
if (blue > 255.0f) {
- blue = 255.0;
+ blue = 255.0f;
}
if (alpha > gdAlphaMax) {
alpha = gdAlphaMax;
@@ -4373,7 +4373,7 @@ static void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int co
* This isn't a problem as computed dy/dx values came from ints above. */
ag = fabs(abs((int)dy) < abs((int)dx) ? cos(atan2(dy, dx)) : sin(atan2(dy, dx)));
if (ag != 0) {
- wid = thick / ag;
+ wid = (int)(thick / ag);
} else {
wid = 1;
}
diff --git a/libmscgen/gd.h b/libmscgen/gd.h
index d6bbebd..67da1b7 100644
--- a/libmscgen/gd.h
+++ b/libmscgen/gd.h
@@ -101,7 +101,7 @@ extern "C" {
pixels are represented by integers, which
must be 32 bits wide or more.
- True colors are repsented as follows:
+ True colors are represented as follows:
ARGB
@@ -268,7 +268,7 @@ enum gdPaletteQuantizationMethod {
* GD_GENERALIZED_CUBIC - Generalized cubic
* GD_HERMITE - Hermite
* GD_HAMMING - Hamming
- * GD_HANNING - Hannig
+ * GD_HANNING - Hanning
* GD_MITCHELL - Mitchell
* GD_NEAREST_NEIGHBOUR - Nearest neighbour interpolation
* GD_POWER - Power
@@ -333,7 +333,7 @@ typedef double (* interpolation_method )(double);
<Accessor Macros>
(Previous versions of this library encouraged directly manipulating
- the contents ofthe struct but we are attempting to move away from
+ the contents of the struct but we are attempting to move away from
this practice so the fields are no longer documented here. If you
need to poke at the internals of this struct, feel free to look at
*gd.h*.)
@@ -1499,7 +1499,7 @@ BGD_DECLARE(void) gdImageFlipHorizontal(gdImagePtr im);
BGD_DECLARE(void) gdImageFlipVertical(gdImagePtr im);
BGD_DECLARE(void) gdImageFlipBoth(gdImagePtr im);
-#define GD_FLIP_HORINZONTAL 1
+#define GD_FLIP_HORIZONTAL 1
#define GD_FLIP_VERTICAL 2
#define GD_FLIP_BOTH 3
@@ -1572,7 +1572,7 @@ BGD_DECLARE(int) gdTransformAffineBoundingBox(gdRectPtr src, const double affine
*
* Constants:
* GD_CMP_IMAGE - Actual image IS different
- * GD_CMP_NUM_COLORS - Number of colors in pallette differ
+ * GD_CMP_NUM_COLORS - Number of colors in palette differ
* GD_CMP_COLOR - Image colors differ
* GD_CMP_SIZE_X - Image width differs
* GD_CMP_SIZE_Y - Image heights differ
diff --git a/libmscgen/gd_intern.h b/libmscgen/gd_intern.h
index 2e7264b..c9d7f2e 100644
--- a/libmscgen/gd_intern.h
+++ b/libmscgen/gd_intern.h
@@ -58,7 +58,7 @@ uchar_clamp(double clr, unsigned char max) {
result = (clr < 0) ? 0 : max;
}/* if */
- return result;
+ return (unsigned char)result;
}/* uchar_clamp*/
diff --git a/libmscgen/mscgen_adraw.h b/libmscgen/mscgen_adraw.h
index b2e11a3..84b0f36 100644
--- a/libmscgen/mscgen_adraw.h
+++ b/libmscgen/mscgen_adraw.h
@@ -253,7 +253,7 @@ ADraw;
* image functions to be executed.
*
* \param[in] w The width of the output image.
- * \param[in] h The height of the ouput image.
+ * \param[in] h The height of the output image.
* \param[in] file The file to which the image should be written.
* \param[in] fontName The name of the font to use for rendering.
* \param[in] type The output type to generate.
diff --git a/libmscgen/mscgen_adraw_int.h b/libmscgen/mscgen_adraw_int.h
index 6f79ca4..1912fe1 100644
--- a/libmscgen/mscgen_adraw_int.h
+++ b/libmscgen/mscgen_adraw_int.h
@@ -29,7 +29,7 @@
* Preprocessor Macros
***************************************************************************/
-/* Define macro to supress unused parameter warnings */
+/* Define macro to suppress unused parameter warnings */
#ifndef UNUSED
# ifdef __GNUC__
# define UNUSED __attribute__((unused))
diff --git a/libmscgen/mscgen_api.c b/libmscgen/mscgen_api.c
index 0f6052a..b28d653 100644
--- a/libmscgen/mscgen_api.c
+++ b/libmscgen/mscgen_api.c
@@ -67,7 +67,7 @@ typedef struct GlobalOptionsTag
/** Size of 'corner' added to note boxes. */
unsigned int noteCorner;
- /** Anguluar box slope in pixels. */
+ /** Angular box slope in pixels. */
unsigned int aboxSlope;
/** If TRUE, wrap arc text as well as box contents. */
@@ -662,7 +662,7 @@ static char *getLine(const char *string,
* \param x The x position at which the entity text should be centered.
* \param y The y position where the text should be placed.
* \param entLabel The label to render, which maybe \a NULL in which case
- * no ouput is produced.
+ * no output is produced.
* \param entUrl The URL for rendering the label as a hyperlink. This
* maybe \a NULL if not required.
* \param entId The text identifier for the arc.
@@ -704,7 +704,7 @@ static void entityText(Context *ctx,
/* Check if a URL is associated */
if(entUrl)
{
- /* If no explict colour has been set, make URLS blue */
+ /* If no explicit colour has been set, make URLS blue */
ctx->drw.setPen(&ctx->drw, ADRAW_COL_BLUE);
/* Image map output */
@@ -1062,7 +1062,7 @@ static void arcBox(Context *ctx,
* \param arcIdUrl The URL for rendering the test identifier as a hyperlink.
* This maybe \a NULL if not required.
* \param arcTextColour Colour for the arc text, or NULL to use default.
- * \param arcTextColour Colour for the arc text backgroun, or NULL to use default.
+ * \param arcTextColour Colour for the arc text background, or NULL to use default.
* \param arcType The type of arc, used to control output semantics.
*/
static void arcText(Context *ctx,
@@ -1329,7 +1329,7 @@ static void arcLine(Context *ctx,
/* Get co-ordinates of the arc end-point */
ADrawComputeArcPoint(sx, y - 1, ctx->opts.entitySpacing - 8,
- ctx->opts.loopArcHeight, 180 - 45,
+ ctx->opts.loopArcHeight, 180.0f - 45.0f,
&px, &py);
/* Draw a cross */
@@ -1393,7 +1393,7 @@ static void arcLine(Context *ctx,
/* Get co-ordinates of the arc end-point */
ADrawComputeArcPoint(sx, y - 1, ctx->opts.entitySpacing - 8,
- ctx->opts.loopArcHeight, 45,
+ ctx->opts.loopArcHeight, 45.0f,
&px, &py);
/* Draw a cross */
@@ -1431,7 +1431,7 @@ static void arcLine(Context *ctx,
*/
static Boolean checkMsc(Msc m)
{
- /* Check all arc entites are known */
+ /* Check all arc entities are known */
MscResetArcIterator(m);
do
{
@@ -1710,7 +1710,7 @@ int mscgen_generate(const char *inputFile,
assert(startCol != -1);
assert(endCol != -1 || isBroadcastArc(MscGetCurrentArcDest(m)));
- /* Check for entity colouring if not set explicity on the arc */
+ /* Check for entity colouring if not set explicitly on the arc */
if (arcTextColour == NULL)
{
arcTextColour = MscGetEntAttrib(m, startCol, MSC_ATTR_ARC_TEXT_COLOUR);
diff --git a/libmscgen/mscgen_gd_out.c b/libmscgen/mscgen_gd_out.c
index 263431e..8d8198c 100644
--- a/libmscgen/mscgen_gd_out.c
+++ b/libmscgen/mscgen_gd_out.c
@@ -119,7 +119,7 @@ static int getGdoPen(struct ADrawTag *ctx)
/** Given a colour value, convert to a gd colour reference.
- * This searches the current pallette of colours for the passed colour and
+ * This searches the current palette of colours for the passed colour and
* returns an existing reference if possible. Otherwise a new colour reference
* is allocated and returned.
*/
diff --git a/libmscgen/mscgen_lexer.l b/libmscgen/mscgen_lexer.l
index 29d6aea..52f5e05 100644
--- a/libmscgen/mscgen_lexer.l
+++ b/libmscgen/mscgen_lexer.l
@@ -41,7 +41,7 @@ static Boolean lex_utf8 = FALSE;
/* Local function prototypes */
static void newline(const char *text, unsigned int n);
static char *trimQstring(char *s);
-
+static const char *stateToString(int state);
%}
/* Not used, so prevent compiler warning */
@@ -49,7 +49,8 @@ static char *trimQstring(char *s);
%option noinput
%option noyywrap
-%x IN_COMMENT BODY
+%x IN_COMMENT
+%x BODY
%%
<INITIAL>{
@@ -141,7 +142,7 @@ NOTE|note yylval.arctype = MSC_ARC_NOTE; return
%%
/* Handle a new line of input.
- * This counts the line number and duplicates the string incase we need
+ * This counts the line number and duplicates the string in case we need
* it for error reporting. The line is then returned back for parsing
* without the newline characters prefixed.
*/
@@ -233,4 +234,5 @@ Boolean lex_getutf8(void)
return lex_utf8;
}
+#include "mscgen_lexer.l.h"
/* END OF FILE */
diff --git a/libmscgen/mscgen_msc.c b/libmscgen/mscgen_msc.c
index 0a17395..a18e261 100644
--- a/libmscgen/mscgen_msc.c
+++ b/libmscgen/mscgen_msc.c
@@ -91,7 +91,7 @@ struct MscTag
* Local Functions
***************************************************************************/
-/** Find come attrbute in an attribute list.
+/** Find come attribute in an attribute list.
*
* \param[in] attr Head of the linked list to search.
* \param[in] a The attribute type to find.
diff --git a/libmscgen/mscgen_msc.h b/libmscgen/mscgen_msc.h
index 2c75131..1299bf9 100644
--- a/libmscgen/mscgen_msc.h
+++ b/libmscgen/mscgen_msc.h
@@ -205,7 +205,7 @@ Boolean MscGetOptAsBoolean(struct MscTag *m, MscOptType type, Boolean *cons
*
* \param m The MSC to analyse.
* \param label The label to find.
- * \retval -1 If the label was not found, otherwise the columnn index.
+ * \retval -1 If the label was not found, otherwise the column index.
*/
int MscGetEntityIndex(struct MscTag *m, const char *label);
@@ -217,7 +217,7 @@ int MscGetEntityIndex(struct MscTag *m, const char *label);
* @{
*/
-/** Reset the entity interator.
+/** Reset the entity iterator.
* This moves the pointer to the current entity to the head of the list.
*/
void MscResetEntityIterator(Msc m);
@@ -249,7 +249,7 @@ const char *MscGetEntAttrib(Msc m, unsigned int entIdx, MscAttribType a);
* @{
*/
-/** Reset the arc interator.
+/** Reset the arc iterator.
* This moves the pointer to the current arc to the head of the list.
*/
void MscResetArcIterator (Msc m);
diff --git a/libmscgen/mscgen_usage.c b/libmscgen/mscgen_usage.c
index 2126d44..5d448f8 100644
--- a/libmscgen/mscgen_usage.c
+++ b/libmscgen/mscgen_usage.c
@@ -61,7 +61,7 @@ void Usage(void)
" to write output directly to stdout.\n"
#ifdef USE_FREETYPE
" -F <font> Use specified font for PNG output. This must be a font specifier\n"
-" compatbile with fontconfig (see 'fc-list'), and overrides the\n"
+" compatible with fontconfig (see 'fc-list'), and overrides the\n"
" MSCGEN_FONT environment variable if also set.\n"
#endif
" -p Print parsed msc output (for parser debug).\n"
diff --git a/libmscgen/mscgen_utf8.c b/libmscgen/mscgen_utf8.c
index 9614c47..4821164 100644
--- a/libmscgen/mscgen_utf8.c
+++ b/libmscgen/mscgen_utf8.c
@@ -27,7 +27,7 @@
#include "mscgen_utf8.h"
/**************************************************************************
- * Manfest Constants
+ * Manifest Constants
**************************************************************************/
/**************************************************************************
@@ -95,7 +95,7 @@ Boolean Utf8Decode(const char *s, unsigned int *r, unsigned int *bytes)
}
}
- /* Success if no NULL was encoutered */
+ /* Success if no NULL was encountered */
return t == *bytes;
}
}