summaryrefslogtreecommitdiff
path: root/pkg/netsurf/patch/0004-framebuffer-Fix-font-layout-function-return-values.patch
blob: accd9cc0b6f4a5a440c8e726a1147d519751bc41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
From 507e82825f659742b76df9179e59975b3bd55b30 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sun, 25 Dec 2016 00:23:34 -0800
Subject: [PATCH] framebuffer: Fix font layout function return values

The return type is nserror, so they should return NSERROR_OK, not true.
---
 frontends/framebuffer/font_freetype.c | 10 +++++-----
 frontends/framebuffer/font_internal.c | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/frontends/framebuffer/font_freetype.c b/frontends/framebuffer/font_freetype.c
index 9235ad476..42be6d443 100644
--- a/frontends/framebuffer/font_freetype.c
+++ b/frontends/framebuffer/font_freetype.c
@@ -445,7 +445,7 @@ fb_font_width(const plot_font_style_t *fstyle,
                 *width += glyph->advance.x >> 16;
         }
 
-	return true;
+	return NSERROR_OK;
 }
 
 
@@ -481,7 +481,7 @@ fb_font_position(const plot_font_style_t *fstyle,
                 *actual_x = prev_x;
 
         *char_offset = nxtchr;
-	return true;
+	return NSERROR_OK;
 }
 
 
@@ -494,7 +494,7 @@ fb_font_position(const plot_font_style_t *fstyle,
  * \param  x            width available
  * \param  char_offset  updated to offset in string of actual_x, [1..length]
  * \param  actual_x     updated to x coordinate of character closest to x
- * \return  true on success, false on error and error reported
+ * \return  NSERROR_OK on success or error code on failure
  *
  * On exit, char_offset indicates first character after split point.
  *
@@ -537,7 +537,7 @@ fb_font_split(const plot_font_style_t *fstyle,
                          * found a space; return previous space */
                         *actual_x = last_space_x;
                         *char_offset = last_space_idx;
-                        return true;
+                        return NSERROR_OK;
                 }
 
                 nxtchr = utf8_next(string, length, nxtchr);
@@ -545,7 +545,7 @@ fb_font_split(const plot_font_style_t *fstyle,
 
         *char_offset = nxtchr;
 
-	return true;
+	return NSERROR_OK;
 }
 
 static struct gui_layout_table layout_table = {
diff --git a/frontends/framebuffer/font_internal.c b/frontends/framebuffer/font_internal.c
index 9164a29db..a9054098f 100644
--- a/frontends/framebuffer/font_internal.c
+++ b/frontends/framebuffer/font_internal.c
@@ -364,7 +364,7 @@ fb_font_width(const plot_font_style_t *fstyle,
         }
 
 	*width *= fb_get_font_size(fstyle);
-	return true;
+	return NSERROR_OK;
 }
 
 
@@ -397,7 +397,7 @@ fb_font_position(const plot_font_style_t *fstyle,
         *actual_x = x_pos;
 
         *char_offset = nxtchr;
-	return true;
+	return NSERROR_OK;
 }
 
 
@@ -410,7 +410,7 @@ fb_font_position(const plot_font_style_t *fstyle,
  * \param  x            width available
  * \param  char_offset  updated to offset in string of actual_x, [1..length]
  * \param  actual_x     updated to x coordinate of character closest to x
- * \return  true on success, false on error and error reported
+ * \return  NSERROR_OK on success or error code on failure
  *
  * On exit, char_offset indicates first character after split point.
  *
@@ -455,7 +455,7 @@ fb_font_split(const plot_font_style_t *fstyle,
                          * found a space; return previous space */
                         *actual_x = last_space_x;
                         *char_offset = last_space_idx;
-                        return true;
+                        return NSERROR_OK;
                 }
 
                 nxtchr = utf8_next(string, length, nxtchr);
@@ -463,7 +463,7 @@ fb_font_split(const plot_font_style_t *fstyle,
 
         *char_offset = nxtchr;
 
-	return true;
+	return NSERROR_OK;
 }
 
 
-- 
2.11.0