From: chanywa Date: Wed, 26 Jul 2017 06:13:29 +0000 (+0900) Subject: Change spaces indentation to tabs X-Git-Tag: submit/tizen/20170726.061422^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0fb1e702899d248163e2d583f17b4c34b9ddc7b0;p=platform%2Fcore%2Fapi%2Fmaps-service.git Change spaces indentation to tabs Change-Id: I91db171498cbb6e785190bd61c13a4f0d887956b --- diff --git a/src/api/maps_view_snapshot.cpp b/src/api/maps_view_snapshot.cpp index da1e9a8..de6e07a 100644 --- a/src/api/maps_view_snapshot.cpp +++ b/src/api/maps_view_snapshot.cpp @@ -43,65 +43,64 @@ static void __convert_rgba_to_bgra(unsigned char *data, int width, int height) static bool __encode_bitmap_file(const void *data, int width, int height, const char *file) { - struct { - unsigned char magic[2]; - } bmpfile_magic = { {'B', 'M'} }; - - struct { - unsigned int filesz; - unsigned short creator1; - unsigned short creator2; - unsigned int bmp_offset; - } bmpfile_header = { 0, 0, 0, 0x36 }; - - struct { - unsigned int header_sz; - unsigned int width; - unsigned int height; - unsigned short nplanes; - unsigned short bitspp; - unsigned int compress_type; - unsigned int bmp_bytesz; - unsigned int hres; - unsigned int vres; - unsigned int ncolors; - unsigned int nimpcolors; - } bmp_dib_v3_header_t = { 0x28, 0, 0, 1, 24, 0, 0, 0, 0, 0, 0 }; - - struct stat file_info; - if (0 != lstat(file, &file_info)) { - MAPS_LOGE("lstat failed"); //LCOV_EXCL_LINE - return false; - } - if (S_ISLNK(file_info.st_mode)) { - MAPS_LOGE("symbolic linked file"); //LCOV_EXCL_LINE - return false; - } - - unsigned int *blocks; - FILE *fp = fopen(file, "w+"); - int i; - - if (fp == NULL) { - MAPS_LOGE("fopen fail"); //LCOV_EXCL_LINE - return false; - } - bmpfile_header.filesz = sizeof(bmpfile_magic) + sizeof(bmpfile_header) + sizeof(bmp_dib_v3_header_t) + (width * height * 3); - bmp_dib_v3_header_t.header_sz = sizeof(bmp_dib_v3_header_t); - bmp_dib_v3_header_t.width = width; - bmp_dib_v3_header_t.height = -height; - bmp_dib_v3_header_t.bmp_bytesz = width * height * 3; - - fwrite(&bmpfile_magic, sizeof(bmpfile_magic), 1, fp); - fwrite(&bmpfile_header, sizeof(bmpfile_header), 1, fp); - fwrite(&bmp_dib_v3_header_t, sizeof(bmp_dib_v3_header_t), 1, fp); - blocks = (unsigned int *)data; - - for (i = 0; i < height * width; i++) { - fwrite(&blocks[i], 3, 1, fp); - } - fclose(fp); - return true; + struct { + unsigned char magic[2]; + } bmpfile_magic = { {'B', 'M'} }; + + struct { + unsigned int filesz; + unsigned short creator1; + unsigned short creator2; + unsigned int bmp_offset; + } bmpfile_header = { 0, 0, 0, 0x36 }; + + struct { + unsigned int header_sz; + unsigned int width; + unsigned int height; + unsigned short nplanes; + unsigned short bitspp; + unsigned int compress_type; + unsigned int bmp_bytesz; + unsigned int hres; + unsigned int vres; + unsigned int ncolors; + unsigned int nimpcolors; + } bmp_dib_v3_header_t = { 0x28, 0, 0, 1, 24, 0, 0, 0, 0, 0, 0 }; + + struct stat file_info; + if (0 != lstat(file, &file_info)) { + MAPS_LOGE("lstat failed"); //LCOV_EXCL_LINE + return false; + } + if (S_ISLNK(file_info.st_mode)) { + MAPS_LOGE("symbolic linked file"); //LCOV_EXCL_LINE + return false; + } + + unsigned int *blocks; + FILE *fp = fopen(file, "w+"); + int i; + + if (fp == NULL) { + MAPS_LOGE("fopen fail"); //LCOV_EXCL_LINE + return false; + } + bmpfile_header.filesz = sizeof(bmpfile_magic) + sizeof(bmpfile_header) + sizeof(bmp_dib_v3_header_t) + (width * height * 3); + bmp_dib_v3_header_t.header_sz = sizeof(bmp_dib_v3_header_t); + bmp_dib_v3_header_t.width = width; + bmp_dib_v3_header_t.height = -height; + bmp_dib_v3_header_t.bmp_bytesz = width * height * 3; + + fwrite(&bmpfile_magic, sizeof(bmpfile_magic), 1, fp); + fwrite(&bmpfile_header, sizeof(bmpfile_header), 1, fp); + fwrite(&bmp_dib_v3_header_t, sizeof(bmp_dib_v3_header_t), 1, fp); + blocks = (unsigned int *)data; + + for (i = 0; i < height * width; i++) + fwrite(&blocks[i], 3, 1, fp); + fclose(fp); + return true; } static image_util_colorspace_e __convert_colorspace(maps_view_colorspace_type_e cs)