| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1082,11 +1082,11 @@ void __add_number(double val, char format_code, int precision, | |||
| 1082 | 1082 | ||
| 1083 | 1083 | ||
| 1084 | 1084 | template <class PathIterator> | |
| 1085 | - int __convert_to_string(PathIterator &path, | ||
| 1086 | - int precision, | ||
| 1087 | - char **codes, | ||
| 1088 | - bool postfix, | ||
| 1089 | - std::string& buffer) | ||
| 1085 | + bool __convert_to_string(PathIterator &path, | ||
| 1086 | + int precision, | ||
| 1087 | + char **codes, | ||
| 1088 | + bool postfix, | ||
| 1089 | + std::string& buffer) | ||
| 1090 | 1090 | { | |
| 1091 | 1091 | const char format_code = 'f'; | |
| 1092 | 1092 | ||
@@ -1108,7 +1108,7 @@ int __convert_to_string(PathIterator &path, | |||
| 1108 | 1108 | for (int i = 1; i < size; ++i) { | |
| 1109 | 1109 | unsigned subcode = path.vertex(&x[i], &y[i]); | |
| 1110 | 1110 | if (subcode != code) { | |
| 1111 | - return 2; | ||
| 1111 | + return false; | ||
| 1112 | 1112 | } | |
| 1113 | 1113 | } | |
| 1114 | 1114 | ||
@@ -1140,25 +1140,25 @@ int __convert_to_string(PathIterator &path, | |||
| 1140 | 1140 | last_y = y[size - 1]; | |
| 1141 | 1141 | } else { | |
| 1142 | 1142 | // Unknown code value | |
| 1143 | - return 2; | ||
| 1143 | + return false; | ||
| 1144 | 1144 | } | |
| 1145 | 1145 | ||
| 1146 | 1146 | buffer += '\n'; | |
| 1147 | 1147 | } | |
| 1148 | 1148 | ||
| 1149 | - return 0; | ||
| 1149 | + return true; | ||
| 1150 | 1150 | } | |
| 1151 | 1151 | ||
| 1152 | 1152 | template <class PathIterator> | |
| 1153 | - int convert_to_string(PathIterator &path, | ||
| 1154 | - agg::trans_affine &trans, | ||
| 1155 | - agg::rect_d &clip_rect, | ||
| 1156 | - bool simplify, | ||
| 1157 | - SketchParams sketch_params, | ||
| 1158 | - int precision, | ||
| 1159 | - char **codes, | ||
| 1160 | - bool postfix, | ||
| 1161 | - std::string& buffer) | ||
| 1153 | + bool convert_to_string(PathIterator &path, | ||
| 1154 | + agg::trans_affine &trans, | ||
| 1155 | + agg::rect_d &clip_rect, | ||
| 1156 | + bool simplify, | ||
| 1157 | + SketchParams sketch_params, | ||
| 1158 | + int precision, | ||
| 1159 | + char **codes, | ||
| 1160 | + bool postfix, | ||
| 1161 | + std::string& buffer) | ||
| 1162 | 1162 | { | |
| 1163 | 1163 | size_t buffersize; | |
| 1164 | 1164 | typedef agg::conv_transform<py::PathIterator> transformed_path_t; | |
@@ -1177,7 +1177,7 @@ int convert_to_string(PathIterator &path, | |||
| 1177 | 1177 | ||
| 1178 | 1178 | buffersize = path.total_vertices() * (precision + 5) * 4; | |
| 1179 | 1179 | if (buffersize == 0) { | |
| 1180 | - return 0; | ||
| 1180 | + return true; | ||
| 1181 | 1181 | } | |
| 1182 | 1182 | ||
| 1183 | 1183 | if (sketch_params.scale != 0.0) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -685,7 +685,7 @@ static PyObject *Py_convert_to_string(PyObject *self, PyObject *args, PyObject * | |||
| 685 | 685 | bool postfix; | |
| 686 | 686 | std::string buffer; | |
| 687 | 687 | PyObject *result; | |
| 688 | - int status; | ||
| 688 | + bool status; | ||
| 689 | 689 | ||
| 690 | 690 | if (!PyArg_ParseTuple(args, | |
| 691 | 691 | "O&O&O&OO&iOO&:convert_to_string", | |
@@ -736,12 +736,8 @@ static PyObject *Py_convert_to_string(PyObject *self, PyObject *args, PyObject * | |||
| 736 | 736 | path, trans, cliprect, simplify, sketch, | |
| 737 | 737 | precision, codes, postfix, buffer))); | |
| 738 | 738 | ||
| 739 | - if (status) { | ||
| 740 | - if (status == 1) { | ||
| 741 | - PyErr_SetString(PyExc_MemoryError, "Memory error"); | ||
| 742 | - } else if (status == 2) { | ||
| 743 | - PyErr_SetString(PyExc_ValueError, "Malformed path codes"); | ||
| 744 | - } | ||
| 739 | + if (!status) { | ||
| 740 | + PyErr_SetString(PyExc_ValueError, "Malformed path codes"); | ||
| 745 | 741 | return NULL; | |
| 746 | 742 | } | |
| 747 | 743 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments