format code

This commit is contained in:
lixianjing 2019-07-07 02:17:53 -07:00
parent 16ecd3ade7
commit bfb41c6d51
12 changed files with 38 additions and 15 deletions

View File

@ -146,7 +146,9 @@ static asset_info_t* try_load_image(assets_manager_t* am, const char* name,
subpath = "assets/raw/images/svg";
break;
}
default: { return NULL; }
default: {
return NULL;
}
}
return_value_if_fail(build_path(am, path, MAX_PATH, ratio, subpath, name, extname) == RET_OK,
@ -195,7 +197,9 @@ static asset_info_t* try_load_assets(assets_manager_t* am, const char* name, con
subpath = "assets/raw/data";
break;
}
default: { return NULL; }
default: {
return NULL;
}
}
return_value_if_fail(build_path(am, path, MAX_PATH, FALSE, subpath, name, extname) == RET_OK,

View File

@ -50,7 +50,9 @@ break_type_t line_break_check(wchar_t c1, wchar_t c2) {
case LINEBREAK_NOBREAK: {
return LINE_BREAK_NO;
}
default: { return LINE_BREAK_ALLOW; }
default: {
return LINE_BREAK_ALLOW;
}
}
}

View File

@ -464,7 +464,9 @@ static int32_t text_edit_calc_x(text_edit_t* text_edit, row_info_t* iter) {
case ALIGN_H_RIGHT: {
return (layout_info->w - row_width);
}
default: { break; }
default: {
break;
}
}
}

View File

@ -182,7 +182,7 @@ static ret_t mledit_on_destroy(widget_t* widget) {
mledit_t* mledit = MLEDIT(widget);
return_value_if_fail(widget != NULL && mledit != NULL, RET_BAD_PARAMS);
if(mledit->timer_id != TK_INVALID_ID) {
if (mledit->timer_id != TK_INVALID_ID) {
timer_remove(mledit->timer_id);
}

View File

@ -182,8 +182,7 @@ static ret_t children_layouter_list_view_layout(children_layouter_t* layouter, w
widget_t* scroll_bar = NULL;
scroll_view_t* scroll_view = SCROLL_VIEW(widget);
children_layouter_list_view_t* l = (children_layouter_list_view_t*)layouter;
return_value_if_fail(l != NULL && widget != NULL && scroll_view != NULL && l != NULL,
RET_BAD_PARAMS);
return_value_if_fail(widget != NULL && scroll_view != NULL && l != NULL, RET_BAD_PARAMS);
virtual_h = widget->h;
list_view = LIST_VIEW(widget->parent);

View File

@ -229,7 +229,9 @@ ret_t bsvg_draw_path(draw_ctx_t* ctx, const svg_path_t* path) {
break;
}
case SVG_PATH_NULL:
default: { break; }
default: {
break;
}
}
return RET_OK;

View File

@ -132,7 +132,9 @@ ret_t bsvg_to_svg_path(str_t* str, const svg_path_t* path) {
break;
}
case SVG_PATH_NULL:
default: { break; }
default: {
break;
}
}
return str_append(str, buff);

View File

@ -248,7 +248,9 @@ static ret_t svg_path_parser_parse_cmd(svg_path_parser_t* parser, char c) {
}
break;
}
default: { assert(!"not supported path!"); } break;
default: {
assert(!"not supported path!");
} break;
}
return RET_OK;

View File

@ -163,7 +163,9 @@ ret_t path_normalize(const char* path, char* result, int32_t size) {
}
break;
}
default: { *d++ = *s++; }
default: {
*d++ = *s++;
}
}
}

View File

@ -37,7 +37,9 @@ bool_t value_bool(const value_t* v) {
case VALUE_TYPE_WSTRING: {
return tk_watob(v->value.wstr);
}
default: { return value_int(v) ? TRUE : FALSE; }
default: {
return value_int(v) ? TRUE : FALSE;
}
}
}
@ -448,7 +450,9 @@ int value_int(const value_t* v) {
case VALUE_TYPE_WSTRING: {
return tk_watoi(v->value.wstr);
}
default: { assert(!"not supported type"); }
default: {
assert(!"not supported type");
}
}
return 0;

View File

@ -414,7 +414,9 @@ static cairo_surface_t* create_surface(uint32_t w, uint32_t h, bitmap_format_t f
cairo_format = CAIRO_FORMAT_RGB16_565;
break;
}
default: { return NULL; }
default: {
return NULL;
}
}
return cairo_image_surface_create_for_data(fbuff, cairo_format, w, h, w * bpp);

View File

@ -111,7 +111,9 @@ static int vgcanvas_nanovg_ensure_image(vgcanvas_nanovg_t* canvas, bitmap_t* img
f = NVG_TEXTURE_RGB;
break;
}
default: { assert(!"not supported format"); }
default: {
assert(!"not supported format");
}
}
i = nvgCreateImageRaw(canvas->vg, img->w, img->h, f, NVG_IMAGE_NEAREST, img->data);