summaryrefslogtreecommitdiffstats
path: root/libmscgen
diff options
context:
space:
mode:
Diffstat (limited to 'libmscgen')
-rw-r--r--libmscgen/gd.c4
-rw-r--r--libmscgen/mscgen_api.c17
-rw-r--r--libmscgen/mscgen_gd_out.c2
-rw-r--r--libmscgen/mscgen_language.y2
4 files changed, 13 insertions, 12 deletions
diff --git a/libmscgen/gd.c b/libmscgen/gd.c
index 7e8b241..a9a8aa6 100644
--- a/libmscgen/gd.c
+++ b/libmscgen/gd.c
@@ -1967,7 +1967,7 @@ BGD_DECLARE(void) gdImageString (gdImagePtr im, gdFontPtr f,
{
int i;
int l;
- l = strlen ((char *) s);
+ l = (int)strlen((char *) s);
for (i = 0; (i < l); i++) {
gdImageChar (im, f, x, y, s[i], color);
x += f->w;
@@ -1982,7 +1982,7 @@ BGD_DECLARE(void) gdImageStringUp (gdImagePtr im, gdFontPtr f,
{
int i;
int l;
- l = strlen ((char *) s);
+ l = (int)strlen((char *) s);
for (i = 0; (i < l); i++) {
gdImageCharUp (im, f, x, y, s[i], color);
y -= f->w;
diff --git a/libmscgen/mscgen_api.c b/libmscgen/mscgen_api.c
index b28d653..376b9d8 100644
--- a/libmscgen/mscgen_api.c
+++ b/libmscgen/mscgen_api.c
@@ -300,7 +300,7 @@ static char *splitStringToWidth(Context *ctx, char *l, unsigned int width)
/* Copy the remaining line to the start of the string */
m = 0;
- n = (p - l);
+ n = (int)(p - l);
while (isspace(orig[n]) && orig[n] != '\0')
{
@@ -390,7 +390,7 @@ static unsigned int computeLabelLines(Context *ctx,
char *nextLine = strstr(label, "\\n");
if (nextLine)
{
- const int lineLen = nextLine - label;
+ const int lineLen = (int)(nextLine - label);
/* Allocate storage and duplicate the line */
retLines[c] = malloc_s(lineLen + 1);
@@ -633,11 +633,11 @@ static char *getLine(const char *string,
/* Determine the length of the line */
if(lineEnd != NULL)
{
- lineLen = lineEnd - lineStart;
+ lineLen = (unsigned int)(lineEnd - lineStart);
}
else
{
- lineLen = strlen(string) - (lineStart - string);
+ lineLen = (unsigned int)(strlen(string) - (lineStart - string));
}
/* Clamp the length to the buffer */
@@ -1328,8 +1328,8 @@ static void arcLine(Context *ctx,
hasArrows = FALSE;
/* Get co-ordinates of the arc end-point */
- ADrawComputeArcPoint(sx, y - 1, ctx->opts.entitySpacing - 8,
- ctx->opts.loopArcHeight, 180.0f - 45.0f,
+ ADrawComputeArcPoint((float)sx, (float)(y - 1), (float)(ctx->opts.entitySpacing - 8),
+ (float)ctx->opts.loopArcHeight, 180.0f - 45.0f,
&px, &py);
/* Draw a cross */
@@ -1392,8 +1392,9 @@ static void arcLine(Context *ctx,
hasArrows = FALSE;
/* Get co-ordinates of the arc end-point */
- ADrawComputeArcPoint(sx, y - 1, ctx->opts.entitySpacing - 8,
- ctx->opts.loopArcHeight, 45.0f,
+ ADrawComputeArcPoint((float)sx, (float)(y - 1),
+ (float)(ctx->opts.entitySpacing - 8),
+ (float)ctx->opts.loopArcHeight, 45.0f,
&px, &py);
/* Draw a cross */
diff --git a/libmscgen/mscgen_gd_out.c b/libmscgen/mscgen_gd_out.c
index 8d8198c..72c79f5 100644
--- a/libmscgen/mscgen_gd_out.c
+++ b/libmscgen/mscgen_gd_out.c
@@ -180,7 +180,7 @@ unsigned int gdoTextWidth(struct ADrawTag *ctx,
const char *string)
{
#ifndef USE_FREETYPE
- const unsigned int l = strlen(string);
+ const unsigned int l = (unsigned int)strlen(string);
/* Remove 1 pixel since there is usually an uneven gap at
* the right of the last character for the fixed width
diff --git a/libmscgen/mscgen_language.y b/libmscgen/mscgen_language.y
index 0c0ab50..02b36bb 100644
--- a/libmscgen/mscgen_language.y
+++ b/libmscgen/mscgen_language.y
@@ -179,7 +179,7 @@ int yywrap()
char *removeEscapes(char *in)
{
- const uint16_t l = strlen(in);
+ const uint16_t l = (uint16_t)strlen(in);
char *r = (char *)malloc_s(l + 1);
uint16_t t, u;