Skip to content

Commit 55e506a

Browse files
committed
remove unnecesary code part
1 parent 08823dd commit 55e506a

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

lwprintf/src/lwprintf/lwprintf.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ prv_out_fn_print(lwprintf_int_t* lwi, const char chr) {
179179
if (lwi->is_print_cancelled) {
180180
return 0;
181181
}
182-
/*!< Send character to output */
182+
183+
/* Send character to output */
183184
if (!lwi->lwobj->out_fn(chr, lwi->lwobj)) {
184185
lwi->is_print_cancelled = 1;
185186
}
@@ -216,13 +217,11 @@ prv_out_fn_write_buff(lwprintf_int_t* lwi, const char chr) {
216217
*/
217218
static int
218219
prv_parse_num(const char** format) {
219-
const char* fmt = *format;
220220
int num = 0;
221221

222-
for (; CHARISNUM(*fmt); ++fmt) {
223-
num = (int)10 * num + CHARTONUM(*fmt);
222+
for (; CHARISNUM(**format); ++(*format)) {
223+
num = (int)10 * num + CHARTONUM(**format);
224224
}
225-
*format = fmt;
226225
return num;
227226
}
228227

@@ -615,13 +614,8 @@ prv_double_to_str(lwprintf_int_t* lwi, double in_num) {
615614
if (def_type == 'g') {
616615
/* As per standard to decide level of precision */
617616
if (exp_cnt >= -4 && exp_cnt < lwi->m.precision) {
618-
if (lwi->m.precision > exp_cnt) {
619-
lwi->m.precision -= exp_cnt + 1;
620-
chosen_precision -= exp_cnt + 1;
621-
} else {
622-
lwi->m.precision = 0;
623-
chosen_precision = 0;
624-
}
617+
lwi->m.precision -= exp_cnt + 1;
618+
chosen_precision -= exp_cnt + 1;
625619
lwi->m.type = 'f';
626620
in_num = orig_num;
627621
} else {

0 commit comments

Comments
 (0)