/bootable/recovery/applypatch/ |
D | bsdiff.c | 62 off_t i,j,k,x,tmp,jj,kk; in split() local 67 for(i=1;k+i<start+len;i++) { in split() 68 if(V[I[k+i]+h]<x) { in split() 69 x=V[I[k+i]+h]; in split() 72 if(V[I[k+i]+h]==x) { in split() 73 tmp=I[k+j];I[k+j]=I[k+i];I[k+i]=tmp; in split() 77 for(i=0;i<j;i++) V[I[k+i]]=k+j-1; in split() 85 for(i=start;i<start+len;i++) { in split() 86 if(V[I[i]+h]<x) jj++; in split() 87 if(V[I[i]+h]==x) kk++; in split() [all …]
|
D | imgdiff.c | 205 int i; in ReadZip() local 206 for (i = st.st_size-20; i >= 0 && i > st.st_size - 65600; --i) { in ReadZip() 207 if (img[i] == 0x50 && img[i+1] == 0x4b && in ReadZip() 208 img[i+2] == 0x05 && img[i+3] == 0x06) { in ReadZip() 213 if (!(img[i+4] == 0 && img[i+5] == 0 && img[i+6] == 0 && img[i+7] == 0)) { in ReadZip() 218 int cdcount = Read2(img+i+8); in ReadZip() 219 int cdoffset = Read4(img+i+16); in ReadZip() 225 for (i = 0; i < cdcount; ++i) { in ReadZip() 227 printf("bad central directory entry %d\n", i); in ReadZip() 254 printf("bad local file header entry %d\n", i); in ReadZip() [all …]
|
D | freecache.c | 23 int i; in EliminateOpenFiles() local 24 for (i = 0; de->d_name[i] != '\0' && isdigit(de->d_name[i]); ++i); in EliminateOpenFiles() 25 if (de->d_name[i]) continue; in EliminateOpenFiles() 87 unsigned int i; in FindExpendableFiles() local 88 for (i = 0; i < sizeof(dirs)/sizeof(dirs[0]); ++i) { in FindExpendableFiles() 89 d = opendir(dirs[i]); in FindExpendableFiles() 91 printf("error opening %s: %s\n", dirs[i], strerror(errno)); in FindExpendableFiles() 97 strcpy(path, dirs[i]); in FindExpendableFiles() 156 int i; in MakeFreeSpaceOnCache() local 157 for (i = 0; i < entries && free_now < bytes_needed; ++i) { in MakeFreeSpaceOnCache() [all …]
|
D | main.c | 59 int i; in ParsePatchArgs() local 60 for (i = 0; i < *num_patches; ++i) { in ParsePatchArgs() 61 char* colon = strchr(argv[i], ':'); in ParsePatchArgs() 67 if (ParseSha1(argv[i], digest) != 0) { in ParsePatchArgs() 68 printf("failed to parse sha1 \"%s\"\n", argv[i]); in ParsePatchArgs() 72 (*sha1s)[i] = argv[i]; in ParsePatchArgs() 74 (*patches)[i] = NULL; in ParsePatchArgs() 80 (*patches)[i] = malloc(sizeof(Value)); in ParsePatchArgs() 81 (*patches)[i]->type = VAL_BLOB; in ParsePatchArgs() 82 (*patches)[i]->size = fc.size; in ParsePatchArgs() [all …]
|
D | applypatch.c | 141 int i; in LoadPartitionContents() local 143 for (i = 0; filename[i] != '\0'; ++i) { in LoadPartitionContents() 144 if (filename[i] == ':') { in LoadPartitionContents() 158 for (i = 0; i < pairs; ++i) { in LoadPartitionContents() 160 size[i] = strtol(size_str, NULL, 10); in LoadPartitionContents() 161 if (size[i] == 0) { in LoadPartitionContents() 165 sha1sum[i] = strtok(NULL, ":"); in LoadPartitionContents() 166 index[i] = i; in LoadPartitionContents() 217 for (i = 0; i < pairs; ++i) { in LoadPartitionContents() 221 size_t next = size[index[i]] - file->size; in LoadPartitionContents() [all …]
|
D | imgpatch.c | 61 int i; in ApplyImagePatch() local 62 for (i = 0; i < num_chunks; ++i) { in ApplyImagePatch() 65 printf("failed to read chunk %d record\n", i); in ApplyImagePatch() 75 printf("failed to read chunk %d normal header data\n", i); in ApplyImagePatch() 89 printf("failed to read chunk %d raw header data\n", i); in ApplyImagePatch() 96 printf("failed to read chunk %d raw data\n", i); in ApplyImagePatch() 102 printf("failed to write chunk %d raw data\n", i); in ApplyImagePatch() 111 printf("failed to read chunk %d deflate header data\n", i); in ApplyImagePatch() 133 size_t bonus_size = (i == 1 && bonus_data != NULL) ? bonus_data->size : 0; in ApplyImagePatch() 228 printf("patch chunk %d is unknown type %d\n", i, type); in ApplyImagePatch()
|
D | bspatch.c | 195 int i; in ApplyBSDiffPatchMem() local 225 for (i = 0; i < ctrl[0]; ++i) { in ApplyBSDiffPatchMem() 226 if ((oldpos+i >= 0) && (oldpos+i < old_size)) { in ApplyBSDiffPatchMem() 227 (*new_data)[newpos+i] += old_data[oldpos+i]; in ApplyBSDiffPatchMem()
|
/bootable/recovery/edify/ |
D | expr.c | 72 int i; in ConcatFn() local 73 for (i = 0; i < argc; ++i) { in ConcatFn() 74 strings[i] = NULL; in ConcatFn() 78 for (i = 0; i < argc; ++i) { in ConcatFn() 79 strings[i] = Evaluate(state, argv[i]); in ConcatFn() 80 if (strings[i] == NULL) { in ConcatFn() 83 length += strlen(strings[i]); in ConcatFn() 88 for (i = 0; i < argc; ++i) { in ConcatFn() 89 strcpy(result+p, strings[i]); in ConcatFn() 90 p += strlen(strings[i]); in ConcatFn() [all …]
|
/bootable/recovery/ |
D | verifier.cpp | 179 size_t i; in verify_file() local 180 for (i = 4; i < eocd_size-3; ++i) { in verify_file() 181 if (eocd[i ] == 0x50 && eocd[i+1] == 0x4b && in verify_file() 182 eocd[i+2] == 0x05 && eocd[i+3] == 0x06) { in verify_file() 196 for (i = 0; i < numKeys; ++i) { in verify_file() 197 switch (pKeys[i].hash_len) { in verify_file() 243 for (i = 0; i < numKeys; ++i) { in verify_file() 245 switch (pKeys[i].hash_len) { in verify_file() 253 if (pKeys[i].key_type == Certificate::RSA) { in verify_file() 256 LOGI("signature is too short for RSA key %zu\n", i); in verify_file() [all …]
|
D | screen_ui.cpp | 79 for (int i = 0; i < 5; i++) { in ScreenRecoveryUI() local 80 backgroundIcon[i] = nullptr; in ScreenRecoveryUI() 118 for (int i = 0; i < max_stage; ++i) { in draw_background_locked() local 119 gr_blit((i < stage) ? stageMarkerFill : stageMarkerEmpty, in draw_background_locked() 220 for (size_t i = 0; lines != nullptr && lines[i] != nullptr; ++i) { in DrawTextLines() local 221 DrawTextLine(y, lines[i], false); in DrawTextLines() 264 for (int i = 0; i < menu_items; ++i) { in draw_screen_locked() local 265 if (i == menu_sel) { in draw_screen_locked() 271 gr_text(4, y, menu_[i], true); in draw_screen_locked() 274 gr_text(4, y, menu_[i], false); in draw_screen_locked() [all …]
|
D | recovery.cpp | 253 int i; in get_args() local 254 for (i = 1; i < *argc; ++i) { in get_args() 255 strlcat(boot.recovery, (*argv)[i], sizeof(boot.recovery)); in get_args() 328 for (int i = max-1; i >= 0; --i) { in rotate_logs() local 329 std::string old_log = android::base::StringPrintf((i == 0) ? "%s" : "%s.%d", in rotate_logs() 330 LAST_LOG_FILE, i); in rotate_logs() 331 std::string new_log = android::base::StringPrintf("%s.%d", LAST_LOG_FILE, i+1); in rotate_logs() 335 std::string old_kmsg = android::base::StringPrintf((i == 0) ? "%s" : "%s.%d", in rotate_logs() 336 LAST_KMSG_FILE, i); in rotate_logs() 337 std::string new_kmsg = android::base::StringPrintf("%s.%d", LAST_KMSG_FILE, i+1); in rotate_logs() [all …]
|
D | roots.cpp | 44 int i; in load_volume_table() local 63 for (i = 0; i < fstab->num_entries; ++i) { in load_volume_table() 64 Volume* v = &fstab->recs[i]; in load_volume_table() 65 printf(" %d %s %s %s %lld\n", i, v->mount_point, v->fs_type, in load_volume_table() 273 for (int i = 0; i < fstab->num_entries; ++i) { in setup_install_mounts() local 274 Volume* v = fstab->recs + i; in setup_install_mounts()
|
/bootable/recovery/minzip/ |
D | SysUtil.c | 95 unsigned int i; in sysMapBlockFile() local 101 for (i = 0; i < sizeof(block_dev); ++i) { in sysMapBlockFile() 102 if (block_dev[i] == '\n') { in sysMapBlockFile() 103 block_dev[i] = 0; in sysMapBlockFile() 137 for (i = 0; i < range_count; ++i) { in sysMapBlockFile() 140 LOGW("failed to parse range %d in block map\n", i); in sysMapBlockFile() 146 LOGW("failed to map block %d: %s\n", i, strerror(errno)); in sysMapBlockFile() 149 pMap->ranges[i].addr = addr; in sysMapBlockFile() 150 pMap->ranges[i].length = (end-start)*blksize; in sysMapBlockFile() 152 next += pMap->ranges[i].length; in sysMapBlockFile() [all …]
|
D | Hash.c | 80 int i; in mzHashTableClear() local 83 for (i = 0; i < pHashTable->tableSize; i++, pEnt++) { in mzHashTableClear() 117 int i, count; in countTombStones() local 119 for (count = i = 0; i < pHashTable->tableSize; i++) { in countTombStones() 120 if (pHashTable->pEntries[i].data == HASH_TOMBSTONE) in countTombStones() 140 int i; in resizeHash() local 148 for (i = 0; i < pHashTable->tableSize; i++) { in resizeHash() 149 void* data = pHashTable->pEntries[i].data; in resizeHash() 151 int hashValue = pHashTable->pEntries[i].hashValue; in resizeHash() 283 int i, val; in mzHashForeach() local [all …]
|
D | Zip.c | 169 unsigned int i; in validFilename() local 170 for (i = 0; i < fileNameLen; ++i) { in validFilename() 171 if (fileName[i] < 32 || fileName[i] >= 127) { in validFilename() 172 LOGW("Filename contains invalid character '\%03o'\n", fileName[i]); in validFilename() 191 unsigned int i, numEntries, cdOffset; in parseZipArchive() local 249 for (i = 0; i < numEntries; i++) { in parseZipArchive() 256 LOGW("Ran off the end (at %d)\n", i); in parseZipArchive() 260 LOGW("Missed a central dir sig (at %d)\n", i); in parseZipArchive() 270 LOGW("Filename ran off the end (at %d)\n", i); in parseZipArchive() 274 LOGW("Invalid filename (at %d)\n", i); in parseZipArchive() [all …]
|
/bootable/recovery/mtdutils/ |
D | mounts.c | 79 int i; in scan_mounted_volumes() local 80 for (i = 0; i < g_mounts_state.volume_count; i++) { in scan_mounted_volumes() 81 free_volume_internals(&g_mounts_state.volumes[i], 1); in scan_mounted_volumes() 106 int i; in find_mounted_volume_by_device() local 107 for (i = 0; i < g_mounts_state.volume_count; i++) { in find_mounted_volume_by_device() 108 MountedVolume *v = &g_mounts_state.volumes[i]; in find_mounted_volume_by_device() 125 int i; in find_mounted_volume_by_mount_point() local 126 for (i = 0; i < g_mounts_state.volume_count; i++) { in find_mounted_volume_by_mount_point() 127 MountedVolume *v = &g_mounts_state.volumes[i]; in find_mounted_volume_by_mount_point()
|
/bootable/recovery/updater/ |
D | install.c | 79 int i; in PrintSha1() local 81 for (i = 0; i < SHA_DIGEST_SIZE; ++i) { in PrintSha1() 82 buffer[i*2] = alphabet[(digest[i] >> 4) & 0xf]; in PrintSha1() 83 buffer[i*2+1] = alphabet[digest[i] & 0xf]; in PrintSha1() 85 buffer[i*2] = '\0'; in PrintSha1() 417 int i; in DeleteFn() local 418 for (i = 0; i < argc; ++i) { in DeleteFn() 419 paths[i] = Evaluate(state, argv[i]); in DeleteFn() 420 if (paths[i] == NULL) { in DeleteFn() 422 for (j = 0; j < i; ++i) { in DeleteFn() [all …]
|
D | blockimg.c | 77 int i; in parse_range() local 78 for (i = 0; i < num; ++i) { in parse_range() 79 out->pos[i] = strtol(strtok_r(NULL, ",", &save), NULL, 0); in parse_range() 80 if (i%2) { in parse_range() 81 out->size += out->pos[i]; in parse_range() 83 out->size -= out->pos[i]; in parse_range() 91 int i, j, r1_0, r1_1, r2_0, r2_1; in range_overlaps() local 97 for (i = 0; i < r1->count; ++i) { in range_overlaps() 98 r1_0 = r1->pos[i * 2]; in range_overlaps() 99 r1_1 = r1->pos[i * 2 + 1]; in range_overlaps() [all …]
|
/bootable/recovery/minui/ |
D | resources.cpp | 247 int i; in res_create_multi_display_surface() local 261 for (i = 0; i < num_text; ++i) { in res_create_multi_display_surface() 262 if (text[i].key && strcmp(text[i].key, "Frames") == 0 && text[i].text) { in res_create_multi_display_surface() 263 *frames = atoi(text[i].text); in res_create_multi_display_surface() 281 for (i = 0; i < *frames; ++i) { in res_create_multi_display_surface() 282 surface[i] = init_display_surface(width, height / *frames); in res_create_multi_display_surface() 283 if (surface[i] == NULL) { in res_create_multi_display_surface() 310 for (i = 0; i < *frames; ++i) { in res_create_multi_display_surface() 311 if (surface[i]) free(surface[i]); in res_create_multi_display_surface() 376 int i; in matches_locale() local [all …]
|
D | graphics_drm.cpp | 212 int i, j; in find_crtc_for_connector() local 234 for (i = 0; i < connector->count_encoders; i++) { in find_crtc_for_connector() 235 encoder = drmModeGetEncoder(fd, connector->encoders[i]); in find_crtc_for_connector() 257 int i; in find_used_connector_by_type() local 258 for (i = 0; i < resources->count_connectors; i++) { in find_used_connector_by_type() 261 connector = drmModeGetConnector(fd, resources->connectors[i]); in find_used_connector_by_type() 276 int i; in find_first_connected_connector() local 277 for (i = 0; i < resources->count_connectors; i++) { in find_first_connected_connector() 280 connector = drmModeGetConnector(fd, resources->connectors[i]); in find_first_connected_connector() 294 unsigned i = 0; in find_main_monitor() local [all …]
|
D | events.cpp | 181 for (size_t i = 0; i < ev_dev_count; ++i) { in ev_sync_key_state() local 185 if (ioctl(ev_fdinfo[i].fd, EVIOCGBIT(0, sizeof(ev_bits)), ev_bits) == -1) { in ev_sync_key_state() 191 if (ioctl(ev_fdinfo[i].fd, EVIOCGKEY(sizeof(key_bits)), key_bits) == -1) { in ev_sync_key_state() 209 for (size_t i = 0; i < ev_dev_count; ++i) { in ev_iterate_available_keys() local 214 if (ioctl(ev_fdinfo[i].fd, EVIOCGBIT(0, sizeof(ev_bits)), ev_bits) == -1) { in ev_iterate_available_keys() 221 int rc = ioctl(ev_fdinfo[i].fd, EVIOCGBIT(EV_KEY, KEY_MAX), key_bits); in ev_iterate_available_keys()
|
D | graphics_adf.cpp | 141 ssize_t n_dev_ids, i; in adf_init() local 165 for (i = 0; i < n_dev_ids && pdata->intf_fd < 0; i++) { in adf_init() 168 int err = adf_device_open(dev_ids[i], O_RDWR, &dev); in adf_init() 170 fprintf(stderr, "opening adf device %u failed: %s\n", dev_ids[i], in adf_init() 178 dev_ids[i], strerror(-err)); in adf_init() 227 unsigned int i; in adf_exit() local 229 for (i = 0; i < pdata->n_surfaces; i++) in adf_exit() 230 adf_surface_destroy(&pdata->surfaces[i]); in adf_exit()
|
/bootable/recovery/tools/ota/ |
D | check-lost+found.c | 75 int i; in main() local 76 for (i = 0; kPartitions[i] != NULL; ++i) { in main() 78 snprintf(fn, sizeof(fn), "%s/%s", kPartitions[i], "dirty"); in main() 97 int i; in main() local 98 for (i = 0; kPartitions[i] != NULL; ++i) { in main() 100 snprintf(fn, sizeof(fn), "%s/%s", kPartitions[i], "lost+found"); in main()
|
D | convert-to-bmp.py | 72 for i in range(j*im.size[0]*4, (j+1)*im.size[0]*4, 4): 73 f.write(data[i+2]) # B 74 f.write(data[i+1]) # G 75 f.write(data[i+0]) # R 76 f.write(data[i+3]) # A
|
/bootable/recovery/uncrypt/ |
D | uncrypt.cpp | 137 for (int i = 0; i < fstab->num_entries; ++i) { in find_block_device() local 138 struct fstab_rec* v = &fstab->recs[i]; in find_block_device() 213 for (size_t i = 0; i < WINDOW_SIZE; ++i) { in produce_block_map() local 214 buffers[i] = reinterpret_cast<unsigned char*>(malloc(sb.st_blksize)); in produce_block_map() 306 for (int i = 0; i < range_used; ++i) { in produce_block_map() local 307 fprintf(mapf, "%d %d\n", ranges[i*2], ranges[i*2+1]); in produce_block_map() 329 for (int i = 0; i < fstab->num_entries; ++i) { in wipe_misc() local 330 struct fstab_rec* v = &fstab->recs[i]; in wipe_misc()
|