Gdal::Band::Band(Gdal& owner_, GDALRasterBand *band_) : owner(owner_), band(band_) { size.cx = band->GetXSize(); size.cy = band->GetYSize(); band->GetBlockSize(&block_size.cx, &block_size.cy); block_count = idivceil(size, block_size); type = band->GetRasterDataType(); pixel_bytes = (GDALGetDataTypeSize(type) + 7) >> 3; complex = GDALDataTypeIsComplex(type); int nodata_flag; nodata_value = band->GetNoDataValue(&nodata_flag); is_nodata = !!nodata_flag; is_stat = false; nodata_int = fround(nodata_value); blocks.Alloc(block_count.cx * block_count.cy); }
void createCHKNameList(int fd) { struct pcdir *ignorep1, *ignorep2; int32_t ignore32; char *ignorecp = NULL; char ignore = '\0'; int ignoreint = 0; ignorep1 = ignorep2 = NULL; if (!OkayToRelink || CHKsList != NULL) return; /* * Allocate an array to keep a bit map of the integer * values used in CHK names. */ if ((CHKsList = (uchar_t *)calloc(1, idivceil(MAXCHKVAL, NBBY))) == NULL) { OkayToRelink = 0; return; } /* * Search the root directory for all the files with names of * the form FILEXXXX.CHK. The root directory is an area * outside of the file space on FAT12 and FAT16 file systems. * On FAT32 file systems, the root directory is in a file * area cluster just like any other directory. */ if (!IsFAT32) { traverseFromRoot(fd, 0, PCFS_NO_SUBDIRS, PCFS_FIND_CHKS, ignore, &ignorep1, &ignore32, &ignorep2, ignorecp, &ignoreint); } else { DirCount++; traverseDir(fd, TheBIOSParameterBlock.bpb32.root_dir_clust, 0, PCFS_NO_SUBDIRS, PCFS_FIND_CHKS, ignore, &ignorep1, &ignore32, &ignorep2, ignorecp, &ignoreint); } }
int itimesceil(int x, int y) { return y * idivceil(x, y); }