• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ roundUp函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中roundUp函数的典型用法代码示例。如果您正苦于以下问题:C++ roundUp函数的具体用法?C++ roundUp怎么用?C++ roundUp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了roundUp函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: log

void ToneMappingDrago03::toneMapping_Drago03(Image<float> *img, float *avLum, float *maxLum, unsigned int *pic, float bias)
{
	image = img;
	picture = pic;

	avLuminance = avLum;
	maxLuminance = maxLum;

	normMaxLum = *maxLum / *avLum; // normalize maximum luminance by average luminance
	const float LOG05 = -0.693147f; // log(0.5)

	divider = log10(normMaxLum + 1.0f);
	biasP = log(bias)/LOG05;
	logFile("divider = %f biasP = %f \n", divider, biasP);

	localWorkSize[0] = BLOCK_SIZE;
	localWorkSize[1] = BLOCK_SIZE;
	
	//round values on upper value
	logFile("%d %d \n", image->getHeight(), image->getWidth());
	globalWorkSize[0] = roundUp(BLOCK_SIZE, image->getHeight());
	globalWorkSize[1] = roundUp(BLOCK_SIZE, image->getWidth());

	//core->runComputeUnit();
	
	
	
	CStopWatch timer;
	timer.startTimer();
	calctoneMapping_Drago03CPU();
	timer.stopTimer();
	logFile("ToneMappingCPU,calc_time, , ,%f, \n", timer.getElapsedTime());
}
开发者ID:mihailo,项目名称:HDRTool,代码行数:33,代码来源:ToneMappingDrago03.cpp


示例2: displayAll

/*
   Similar to displayAll(), but only prints out folders and the size of those folders
   Also recursively enters sub-directories
*/
void displayFolders(DIR *directory, char *path, long *total, int depth, int human) {
   char *temp = malloc(sizeof(char) * MAX_LEN);
   char *curPath = malloc(sizeof(char) * MAX_LEN);
   struct dirent *tempdir = malloc(sizeof(struct dirent));
   struct stat *stats = malloc(sizeof(struct stat));

   if (directory) {
      while ((tempdir = readdir(directory))) {
         if ((path == NULL) && checkDir(tempdir->d_name) && strcmp(tempdir->d_name, "..") != 0 &&
          strcmp(tempdir->d_name, ".") != 0)
            sprintf(curPath, "./%s", tempdir->d_name);
         else if (checkDir(tempdir->d_name) && strcmp(tempdir->d_name, "..") != 0 && 
          strcmp(tempdir->d_name, ".") != 0)
            sprintf(curPath, "%s/%s", path, tempdir->d_name);

         if (checkDir(tempdir->d_name) && strcmp(tempdir->d_name, "..") != 0 &&
          strcmp(tempdir->d_name, ".") != 0 && depth > 0) {
            sprintf(temp, "./%s", tempdir->d_name);
            chdir(tempdir->d_name);
            displayFolders(opendir("."), curPath, total, depth - 1, human);
            chdir("..");
            lstat(tempdir->d_name, stats);
            *total += roundUp((stats->st_size + (BLOCKSIZE - 1)) / BLOCKSIZE);
            if (!human)
               printf("%d\t%s\n", roundUp((int)(stats->st_size + (BLOCKSIZE - 1)) / BLOCKSIZE), curPath);
            if (human)
               printHuman(stats, -1, curPath);
         }
      }
   }
}
开发者ID:eskirk,项目名称:MyDu,代码行数:35,代码来源:du.c


示例3: roundUp

void DateTimeNumericFieldElement::stepUp() {
  int newValue = roundUp(m_hasValue ? m_value + 1 : defaultValueForStepUp());
  if (!m_range.isInRange(newValue))
    newValue = roundUp(m_range.minimum);
  m_typeAheadBuffer.clear();
  setValueAsInteger(newValue, DispatchEvent);
}
开发者ID:mirror,项目名称:chromium,代码行数:7,代码来源:DateTimeNumericFieldElement.cpp


示例4: srand

void Draft::startDraft(Team *arr, vector<NodeData*>& a, int nTeams, WINDOW **board){
	int pickN, round = 0;
	srand(time(0));

	roundUp(++round, board[34]);

	while(round < 16){
		pickN = 0;

		for(int i = 0; i < nTeams; i++){
			if(arr[i].getUser()){
				pick(arr[i], a, board, pickN);
			}
			else if(!arr[i].getUser()){
				autoP(arr[i], a, board, pickN);
			}
			pickN++;
		}
		roundUp(++round, board[34]);
		for(int i = (nTeams - 1); i > -1; i--){
			if(arr[i].getUser())
				pick(arr[i], a, board, pickN);
			else if(!arr[i].getUser())
				autoP(arr[i], a, board, pickN);
			pickN++;
		}
		roundUp(++round, board[34]);
		clearBoard(board);
	}
}
开发者ID:JohnFZoeller,项目名称:Personal---FantasyFootballDrafter,代码行数:30,代码来源:draft.cpp


示例5: clEnqueueAcquireGLObjects

void FDMHeatWidget::updateSystemTexture()
{
    cl_int error;

    error= clEnqueueAcquireGLObjects(clQueue, 1, &textureMem, 0, 0, 0);
    if(checkError(error, "clEnqueueAcquireGLObjects"))
        return;

    // Work group y NDRange de renderKernel
    size_t workGroupSize[2] = { 16, 16 };
    size_t ndRangeSize[2];
    ndRangeSize[0]= roundUp(system->getWidth(), workGroupSize[0]);
    ndRangeSize[1]= roundUp(system->getHeight(), workGroupSize[1]);

    bool suspended= system->isSuspended();
    if(!suspended)
        system->suspend();

    // Ejecutamos el kernel para renderizar el sistema en una imagen
    cl_mem systemData= system->getOutputData();
    error  = clSetKernelArg(renderKernel, 0, sizeof(cl_mem), (void*)&systemData);
    error |= clSetKernelArg(renderKernel, 1, sizeof(cl_mem), (void*)&textureMem);
    error |= clSetKernelArg(renderKernel, 2, sizeof(cl_mem), (void*)&paletteMem);

    error |= clEnqueueNDRangeKernel(clQueue, renderKernel, 2, NULL, ndRangeSize, workGroupSize, 0, NULL, NULL);
    checkError(error, "FDMHeatWidget::updateSystemTexture: clEnqueueNDRangeKernel");

    if(!suspended)
        system->resume();

    error= clEnqueueReleaseGLObjects(clQueue, 1, &textureMem, 0, 0, 0);
    if (checkError(error, "clEnqueueReleaseGLObjects"))
        return;
}
开发者ID:imaglabs,项目名称:eagpgpu-c1,代码行数:34,代码来源:fdmheatwidget.cpp


示例6: roundUp

void Resistor::moveResistor(int x, int y, bool stepMode) {
	if (stepMode) {
		rPos.x = roundUp(x);
		rPos.y = roundUp(y);
	}
	else {
		rPos.x = x;
		rPos.y = y;
	}
}
开发者ID:NEGU93,项目名称:ResistorCalculator,代码行数:10,代码来源:Resistor.cpp


示例7: mm_initialize

/**
 * Sets up memory location
 */
void mm_initialize(u32int initrd_location){
  initrd_location = initrd_location;
  //Get the memory map from the multiboot_info
  multiboot_memory_map_t* mmap = (multiboot_memory_map_t*)mbt->mmap_addr;

  //loop through the memory map for a usable (1) portion that is bigger than 0x1000000
  while((u32int)mmap < (mbt->mmap_addr + mbt->mmap_length)) {
    if(mmap->type == 1 && mmap->len > 0x1000000){
      //if found, save that memLoc and memAmt for later use
      memLoc = /*(u32int*)*/mmap->addr;
      memAmt = mmap->len;
    }
    mmap = (multiboot_memory_map_t*) ( (unsigned int)mmap + mmap->size + sizeof(mmap->size) );
   // mmap = (multiboot_memory_map_t) ( (unsigned int)mmap + mmap.size + sizeof(mmap.size) );
  }

  /* Calculate the initrd (ramdisk size) */
  initrd_end = *(u32int*)(mbt->mods_addr+4);
  initrd_size = initrd_end - initrd_location;

  /* Only used to display the start location of Ram, then promptly forgotten */
  u32int startOfRam = memLoc;

  /* Calculate a pointer to the end of physical memory. */
  memEndLoc = memLoc + memAmt;


  /* Add the size of the kernel to memLoc at the nearest 4kb boundry */
  memLoc += roundUp(end - code, 4096); 

  /* Add the size of the initrd to memLoc at the nearest 4kb boundry */
  memLoc += roundUp(initrd_size, 4096); 


  /* Calculate the amount of memory that is usable for heap allocation after kernel*/
  memUsable = memEndLoc - memLoc;

  printf("\nEnd of Kernel           : 0x%x", (u32int) end);
  printf("\nStart of Kernel         : 0x%x", (u32int) code);
  printf("\nSize of Kernel          : 0x%x", (u32int)(end - code));

  printf("\nMemory Found At Location: 0x%x", (u32int) startOfRam);
  printf("\nMemory Amount Located   : 0x%x", memAmt);
  printf("\nEnd of Physical Memory : 0x%x", (u32int) memEndLoc);
  printf("\nInitrd Starts At       : 0x%x", initrd_location);
  printf("\nInitrd Ends At         : 0x%x", initrd_end);
  printf("\nInitrd Size            : 0x%x",  initrd_size);
  printf("\nUsable Memory Starts At: 0x%x", (u32int) memLoc);
  printf("\nUsable Amount of Memory: 0x%x", memUsable);
  placement_address = (u32int)memLoc;
  //while(1);
}
开发者ID:itravers,项目名称:PanicOS,代码行数:55,代码来源:mm.c


示例8: loadTextureDecal

gliGenericImage *
loadTextureDecal(gliGenericImage *image, int mipmap)
{
  int needsScaling;
  int nw, nh;

  nw = roundUp(image->width);
  nh = roundUp(image->height);

  if ((nw != image->width) || (nh != image->height)) {
    needsScaling = 1;
  } else {
    needsScaling = 0;
  }
  assert(image->format != GL_COLOR_INDEX);
  if (needsScaling) {
    gliGenericImage *nimage;
      
    nimage = gliScaleImage(image, nw, nh);
    gliFree(image);
    image = nimage;
  }

#ifdef __APPLE__
  mipmap = 0;  /* Why doesn't Apple's gluBuild2DMipmaps work correctly? */
#endif
  if (mipmap) {
    GLint status;

    glTexParameteri(GL_TEXTURE_2D,
      GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    status = gluBuild2DMipmaps(GL_TEXTURE_2D, image->internalFormat,
      nw, nh, image->format, image->type, image->pixels);
    if (status == GLU_INVALID_ENUM) {
      gliConvertImageToCoreFormat(image);
      status = gluBuild2DMipmaps(GL_TEXTURE_2D, image->internalFormat,
        nw, nh, image->format, image->type, image->pixels);
    }
    assert(status == 0);
  } else {
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

    glTexImage2D(GL_TEXTURE_2D, 0, image->internalFormat,
      nw, nh, 0,
      image->format, image->type, image->pixels);
  }

  return image;
}
开发者ID:davll,项目名称:ICG_SSAO,代码行数:51,代码来源:loadtex.c


示例9: roundUp

//--------------------------------------------------------------
void SalsaScreen::setup()
{
    mainWindowWidth = config.mainWindowWidth;
    
    player.loadSound("sounds/Salsa_instructions.mp3");
    player.setVolume(0.75f);
    player.setMultiPlay(false);
    
    intervall1 = 800; // in ms
    intervall1 = roundUp(intervall1/100);
    intervall2 = 500; // quicker
    intervall2 = roundUp(intervall2/100);
    
    startPlayerPos_R1   =  20800;   // individual
    stopPlayerPos_R1    =  39800;
    startPlayerPos_R2   =  47500;   // move forwards
    stopPlayerPos_R2    =  66599;
    startPlayerPos_R3   =  66600;   // partner
    stopPlayerPos_R3    =  92900;
    startPlayerPos_R4   =  92901;   // faster
    stopPlayerPos_R4    = 115900;
    startPlayerPos_R1 = roundUp(startPlayerPos_R1 /100);
    stopPlayerPos_R1  = roundUp(stopPlayerPos_R1  /100);
    startPlayerPos_R2 = roundUp(startPlayerPos_R2 /100);
    stopPlayerPos_R2  = roundUp(stopPlayerPos_R2  /100);
    startPlayerPos_R3 = roundUp(startPlayerPos_R3 /100);
    stopPlayerPos_R3  = roundUp(stopPlayerPos_R3  /100);
    startPlayerPos_R4 = roundUp(startPlayerPos_R4 /100);
    stopPlayerPos_R4  = roundUp(stopPlayerPos_R4  /100);
    
    prevPlayerPos = startPlayerPos_R1;
    
    // CHOREOGRAPHY --------------------------------------------
    currentStep = 0;
    isStart = true;
    
    boxWidth    = 0;
    boxHeight   = 300;
    role = salsaChoreo.init(0, 0, boxWidth, boxHeight, "Salsa");
    
    // position of each couple
    cX1 = config.mainWindowWidth/4-boxHeight/3;
    cY1 = config.mainWindowHeight/4;
    cX2 = config.mainWindowWidth*3/4-boxHeight+boxHeight/3;
    cY2 = config.mainWindowHeight*3/4;
    
    // lift icon - resize
    newIconSize = config.iconSize;
    biconWasBig = false;
}
开发者ID:JuliaEichler,项目名称:DanSpire,代码行数:51,代码来源:SalsaScreen.cpp


示例10: glFinish

void GLWidget::runKernel() 
{
    cl_int error;
    
    // block until all gl functions are completed
    glFinish();
    // Le doy a OpenCL el vbo que estaba usando OpenGL para renderizar
    error = clEnqueueAcquireGLObjects(clQueue, 1, &clvbo, 0, 0, 0);
    if (checkError(error, "clEnqueueAcquireGLObjects")) {
	return;
    }

    localWorkSize = 1024;
    globalWorkSize = roundUp(vertexNumber, localWorkSize);
    
    error = clEnqueueNDRangeKernel(clQueue, clKernel, 1, NULL, &globalWorkSize, &localWorkSize, 0, 0, 0);
    if (checkError(error, "clEnqueueNDRangeKernel")) {
	return;
    }

    // unmap buffer object
    error = clEnqueueReleaseGLObjects(clQueue, 1, &clvbo, 0, 0, 0);
    if (checkError(error, "clEnqueueReleaseGLObjects")) {
	return;
    }

    clFinish(clQueue);

}
开发者ID:imaglabs,项目名称:eagpgpu-c1,代码行数:29,代码来源:glwidget.cpp


示例11: calcNrThreads

static void
calcNrThreads(
    size_t threads[2],
    const SubproblemDim *subdims,
    const PGranularity *pgran,
    const void *args,
    const void *extra)
{
    size_t yLen;     /* Length of "Y" vector */
    const CLBlasKargs *kargs = args;
    unsigned int subgr = pgran->wgSize[0] / (subdims[0].bwidth / subdims[1].bwidth);

    (void)subdims;
    (void)extra;

    yLen = kargs->transA == clblasNoTrans ? kargs->M : kargs->N;

    if (yLen == 0) {
        yLen = 1;
        //launch one group to avoid CL_INVALID_WORK_GROUP_SIZE error
    }

    //each work item handles y1 lines
    threads[0] = divRoundUp(yLen, subdims[1].y) * subgr;
    threads[0] = roundUp(threads[0], pgran->wgSize[0]);
    threads[1] = 0;
}
开发者ID:AndreasMiller,项目名称:clBLAS,代码行数:27,代码来源:gemv.c


示例12: find

	void find(double* ptr, size_t size,  double& min, double &max)
	{

		size_t num_wg = 64;
		size_t num_compute_units = 6;
		size_t workgroup_size = 256;

		size_t global_size = num_wg * num_compute_units;

		m_result_min.resize( global_size);
		m_result_max.resize( global_size);

		m_args.p_values = ptr;
		m_args.size = size;
		m_args.p_min_list = &m_result_min[0];
		m_args.p_max_list = &m_result_max[0];
		hsa_signal_t signal;
		Launch_params_t lp {.ndim=1, .gdims={std::min(roundUp(size, workgroup_size), global_size*workgroup_size)}, .ldims={workgroup_size}};
		m_dispatch->dispatchKernel(m_args, signal, lp);
		m_dispatch->waitComplete(signal);
		if (size < workgroup_size)
		{
			min = ptr[ m_result_min[0]];
			max = ptr[ m_result_max[0]];
		}
		return reduce(ptr, size, min,max);
	}
protected:
开发者ID:vpa1977,项目名称:hsa_jni,代码行数:28,代码来源:max_value.hpp


示例13: kma_free

void kma_free(void* ptr, kma_size_t size)
{
  size = roundUp(size);
  kma_page_t *page = *((kma_page_t **) BASEADDR(ptr));
  if (diff(size) == 8) { //if 8196, free the page
    free_page(page);
    PAGE_COUNT--;
  } else {
    page->size += size;
    if (page->size == PAGESIZE - sizeof(kma_page_t*)) {
      derefPage(page->ptr, size); //if page is made of free buffers, derefence the buffer in freelist
      free_page(page);
      PAGE_COUNT--;
    } else {  //not all free, give the buffer back to freelist
      insertAtHead(ptr, size);
    }
  }
  //free everything
  if(PAGE_COUNT == 1) {
    free_page(FREEPAGE);
    INIT = FALSE;
    PAGE_COUNT = 0;
    FREE_LIST_HEAD = NULL;
  }
}
开发者ID:hercule24,项目名称:EECS-343,代码行数:25,代码来源:kma_p2fl.c


示例14: assert

//------------------------------------------------------------------------
// ArenaAllocator::alloateMemory:
//    Allocates memory using an `ArenaAllocator`.
//
// Arguments:
//    size - The number of bytes to allocate.
//
// Return Value:
//    A pointer to the allocated memory.
//
// Note:
//    This is the DEBUG-only version of `allocateMemory`; the release
//    version of this method is defined in the corresponding header file.
//    This version of the method has some abilities that the release
//    version does not: it may inject faults into the allocator and
//    seeds all allocations with a specified pattern to help catch
//    use-before-init problems.
void* ArenaAllocator::allocateMemory(size_t size)
{
    assert(size != 0 && (size & (sizeof(int) - 1)) == 0);

    // Ensure that we always allocate in pointer sized increments.
    size = (size_t)roundUp(size, sizeof(size_t));

    if (JitConfig.ShouldInjectFault() != 0)
    {
        // Force the underlying memory allocator (either the OS or the CLR hoster) 
        // to allocate the memory. Any fault injection will kick in.
        void* p = ClrAllocInProcessHeap(0, S_SIZE_T(1));
        if (p != nullptr)
        {
            ClrFreeInProcessHeap(0, p);
        }
        else 
        {
            NOMEM();  // Throw!
        }
    }

    void* block = m_nextFreeByte;
    m_nextFreeByte += size;

    if (m_nextFreeByte > m_lastFreeByte)
    {
        block = allocateNewPage(size);
    }

    memset(block, UninitializedWord<char>(), size);
    return block;
}
开发者ID:sundebin,项目名称:coreclr,代码行数:50,代码来源:alloc.cpp


示例15: transform

	double transform(double* ptr, size_t size)
	{

		size_t num_wg = 64;
		size_t num_compute_units = 6;
		size_t global_size = num_wg * num_compute_units;
		size_t workgroup_size = 256;

		m_result.resize( global_size);


		m_local_dispatch->clearArgs();
		FIX_ARGS_STABLE(m_local_dispatch);

		m_local_dispatch->pushPointerArg((void*)ptr);
		m_local_dispatch->pushIntArg((int)size );
		m_local_dispatch->pushPointerArg((void*)&m_result[0]);
		size_t global_dims[3] = { std::min(roundUp(size, workgroup_size), global_size*workgroup_size),1,1};
		size_t local_dims[3] = {workgroup_size,1,1};
		m_local_dispatch->setLaunchAttributes(1, global_dims,  local_dims);
		m_local_dispatch->dispatchKernelWaitComplete();
		if (size < workgroup_size)
		{
			return m_result[0];
		}
		return reduceTail(size);
	}
开发者ID:vpa1977,项目名称:hsa_jni,代码行数:27,代码来源:transform.hpp


示例16: error

gl::Error VertexBufferInterface::reserveVertexSpace(const gl::VertexAttribute &attrib, GLsizei count, GLsizei instances)
{
    gl::Error error(GL_NO_ERROR);

    unsigned int requiredSpace;
    error = mVertexBuffer->getSpaceRequired(attrib, count, instances, &requiredSpace);
    if (error.isError())
    {
        return error;
    }

    // Protect against integer overflow
    if (mReservedSpace + requiredSpace < mReservedSpace)
    {
        return gl::Error(GL_OUT_OF_MEMORY, "Unable to reserve %u extra bytes in internal vertex buffer, "
                         "it would result in an overflow.", requiredSpace);
    }

    mReservedSpace += requiredSpace;

    // Align to 16-byte boundary
    mReservedSpace = roundUp(mReservedSpace, 16u);

    return gl::Error(GL_NO_ERROR);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:25,代码来源:VertexBuffer.cpp


示例17: locker

PassRefPtr<MetaAllocatorHandle> MetaAllocator::allocate(size_t sizeInBytes, void* ownerUID)
{
    SpinLockHolder locker(&m_lock);

    if (!sizeInBytes)
        return 0;
    
    sizeInBytes = roundUp(sizeInBytes);
    
    void* start = findAndRemoveFreeSpace(sizeInBytes);
    if (!start) {
        size_t requestedNumberOfPages = (sizeInBytes + m_pageSize - 1) >> m_logPageSize;
        size_t numberOfPages = requestedNumberOfPages;
        
        start = allocateNewSpace(numberOfPages);
        if (!start)
            return 0;
        
        ASSERT(numberOfPages >= requestedNumberOfPages);
        
        size_t roundedUpSize = numberOfPages << m_logPageSize;
        
        ASSERT(roundedUpSize >= sizeInBytes);
        
        m_bytesReserved += roundedUpSize;
        
        if (roundedUpSize > sizeInBytes) {
            void* freeSpaceStart = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(start) + sizeInBytes);
            size_t freeSpaceSize = roundedUpSize - sizeInBytes;
            addFreeSpace(freeSpaceStart, freeSpaceSize);
        }
    }
开发者ID:yoavweiss,项目名称:RespImg-WebKit,代码行数:32,代码来源:MetaAllocator.cpp


示例18: processData

static int processData( const CRYPT_CONTEXT cryptContext, BYTE *buffer,
						const int noBlocks, const int blockSize,
						CRYPT_FUNCTION cryptFunction )
	{
	int offset = 0, i, status;

	/* Encrypt the data in variable-length blocks.  The technique for
	   selecting lengths isn't perfect since it tends to put large blocks
	   at the start and small ones at the end, but it's good enough for
	   general testing */
	for( i = 0; i < noBlocks - 1; i++ )
		{
		int noBytes = rand() % ( DATABUFFER_SIZE - offset - \
								 ( blockSize * ( noBlocks - i  ) ) );
		if( !noBytes )
			noBytes = 1;
		if( blockSize > 1 )
			noBytes = roundUp( noBytes, blockSize );
		status = cryptFunction( cryptContext, buffer + offset, noBytes );
		if( cryptStatusError( status ) )
			return( status );
		offset += noBytes;
		}
	status = cryptFunction( cryptContext, buffer + offset,
							DATABUFFER_SIZE - offset );
	if( cryptStatusOK( status ) )
		status = cryptFunction( cryptContext, "", 0 );
	return( status );
	}
开发者ID:mckinnley,项目名称:New-College-of-Florida,代码行数:29,代码来源:stress.c


示例19: indentForCenteredDimensions

quint32 indentForCenteredDimensions(const quint32 outerDimension,const quint32 innerDimension)
{
	if (outerDimension < innerDimension)
		return 0;

	return roundUp(((qreal)(outerDimension-innerDimension))/2.0);
}
开发者ID:ctbrowser,项目名称:luna-sysmgr,代码行数:7,代码来源:dimensionsglobal.cpp


示例20: task_free

void task_free(Task *t) {
	ASSERT_int_disable();
	ASSERT(t == task_curr);

	ipc_task_free(t);
	task_curr_free_files();

	uint32_t count_brk = (roundUp(t->pgdir.end_brk) - roundDown(t->pgdir.start_brk)) / 0x1000;
	/* code, heap ve stack alanlari toplami user alanina esit olmali */
	ASSERT(t->pgdir.count_stack + t->pgdir.count_program + count_brk ==
		   t->pgdir.count_user);
	task_free_vm_user(t);
	ASSERT(t->pgdir.count_user == 0);

	/*
	 * kernel stack ve pagedir daha sonra zombie list uzerinden silinecek.
	 * task structini bulundugu listeden cikar, zombie olarak isaretle ve
	 * task_zombie_list'e ekle.
	 */
	t->list_node.__list->erase(t->list_node.get_iterator());
	t->state = Task::State_zombie;
	task_zombie_list.push_back(&t->list_node);

	if (t->alarm_list_node.__list)
		t->alarm_list_node.__list->erase(&t->alarm_list_node);
}
开发者ID:tanerguven,项目名称:MakarnaX,代码行数:26,代码来源:task.cpp



注:本文中的roundUp函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ round_down函数代码示例发布时间:2022-05-30
下一篇:
C++ round函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap