int32_t cc_getRLSFrame(uint32_t *memory, uint8_t *lut, bool sync) { int32_t res; int32_t responseInt = -1; // check mode, set if necessary if ((res=cam_setMode(CAM_MODE1))<0) return res; // forward call to M0, get frame if (sync) { g_chirpM0->callSync(g_getRLSFrameM0, UINT32((uint32_t)memory), UINT32((uint32_t)lut), END_OUT_ARGS, &responseInt, END_IN_ARGS); return responseInt; } else { g_chirpM0->callAsync(g_getRLSFrameM0, UINT32((uint32_t)memory), UINT32((uint32_t)lut), END_OUT_ARGS); return 0; } }
inline uint RarVM::GetValue(bool ByteMode,uint *Addr) { if (ByteMode) { #ifdef BIG_ENDIAN if (IS_VM_MEM(Addr)) return(*(byte *)Addr); else return(*Addr & 0xff); #else return(*(byte *)Addr); #endif } else { #if defined(BIG_ENDIAN) || !defined(ALLOW_NOT_ALIGNED_INT) if (IS_VM_MEM(Addr)) { byte *B=(byte *)Addr; return UINT32((uint)B[0]|((uint)B[1]<<8)|((uint)B[2]<<16)|((uint)B[3]<<24)); } else return UINT32(*Addr); #else return UINT32(*Addr); #endif } }
////////////////////////////////////////////////////// /// Write new levelLength into stream. /// It might throw an IOException. /// @return Written image bytes. UINT32 CEncoder::UpdateLevelLength() { UINT64 curPos = m_stream->GetPos(); // end of image // set file pos to levelLength m_stream->SetPos(FSFromStart, m_levelLengthPos); if (m_levelLength) { #ifdef PGF_USE_BIG_ENDIAN UINT32 levelLength; int count = WordBytes; for (int i=0; i < m_currLevelIndex; i++) { levelLength = __VAL(UINT32(m_levelLength[i])); m_stream->Write(&count, &levelLength); } #else int count = m_currLevelIndex*WordBytes; m_stream->Write(&count, m_levelLength); #endif //PGF_USE_BIG_ENDIAN } else { int count = m_currLevelIndex*WordBytes; m_stream->SetPos(FSFromCurrent, count); } // begin of image UINT32 retValue = UINT32(curPos - m_stream->GetPos()); // restore file position m_stream->SetPos(FSFromStart, curPos); return retValue; }
void voodoo_pci_device::map_extra(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space) { logerror("%s: map_extra\n", this->tag()); // Really awkward way of getting vga address space mapped // Should really be dependent on voodoo VGAINIT0 bit 8 and IO base + 0xc3 bit 0 if (1) { // io map is on bank_infos[2] bank_info &bi = bank_infos[2]; if(bi.adr==-1) return; if(UINT32(bi.adr) == UINT32(~(bi.size - 1))) return; UINT64 start; address_space *space; if(bi.flags & M_IO) { space = io_space; start = bi.adr + io_offset; } else { space = memory_space; start = bi.adr + memory_offset; } // The mapping needs to only check high address bits start = (start & 0xFFFF0000) + 0x300; UINT64 end = (start & 0xFFFF0000) + 0x3ef; space->install_device_delegate(start, end, *this, bi.map); logerror("%s: map %s at %0*x-%0*x\n", this->tag(), bi.map.name(), bi.flags & M_IO ? 4 : 8, UINT32(start), bi.flags & M_IO ? 4 : 8, UINT32(end)); } }
bool CompManager::SupportLayerAsCursor(Handle comp_handle, HWLayers *hw_layers) { DisplayCompositionContext *display_comp_ctx = reinterpret_cast<DisplayCompositionContext *>(comp_handle); Handle &display_resource_ctx = display_comp_ctx->display_resource_ctx; LayerStack *layer_stack = hw_layers->info.stack; bool supported = false; int32_t gpu_index = -1; if (!layer_stack->flags.cursor_present) { return supported; } for (int32_t i = INT32(layer_stack->layers.size() - 1); i >= 0; i--) { Layer *layer = layer_stack->layers.at(UINT32(i)); if (layer->composition == kCompositionGPUTarget) { gpu_index = i; break; } } if (gpu_index <= 0) { return supported; } Layer *cursor_layer = layer_stack->layers.at(UINT32(gpu_index) - 1); if (cursor_layer->flags.cursor && resource_intf_->ValidateCursorConfig(display_resource_ctx, cursor_layer, true) == kErrorNone) { supported = true; } return supported; }
// // ReadDirEntry // static void ReadDirEntry(void) { size_t len; raw_wad_entry_t entry; lump_t *lump; DisplayTicker(); len = fread(&entry, sizeof(entry), 1, in_file); if (len != 1) FatalError("Trouble reading wad directory"); lump = NewLump(UtilStrNDup(entry.name, 8)); lump->start = UINT32(entry.start); lump->length = UINT32(entry.length); # if DEBUG_DIR PrintDebug("Read dir... %s\n", lump->name); # endif // link it in lump->next = NULL; lump->prev = wad.dir_tail; if (wad.dir_tail) wad.dir_tail->next = lump; else wad.dir_head = lump; wad.dir_tail = lump; }
/* ChapelBase.chpl:663 */ static void init_elts4(_ddata_chpldev_Task x, int64_t s, int64_t _ln, c_string _fn) { range_int64_t_bounded_F call_tmp; _ref_range_int64_t_bounded_F ret_to_arg_ref_tmp_ = NULL; range_int64_t_bounded_F _ic__F0_this; int64_t i; int64_t ret; int64_t end; int64_t ret2; chpldev_Task this8; chpldev_Task wrap_call_tmp; int64_t call_tmp2; ret_to_arg_ref_tmp_ = &call_tmp; _build_range(INT64(1), s, ret_to_arg_ref_tmp_, _ln, _fn); _ic__F0_this = call_tmp; ret = (&_ic__F0_this)->_low; ret2 = (&_ic__F0_this)->_high; end = ret2; for (i = ret; ((i <= end)); i += INT64(1)) { (&this8)->state = taskState_pending; (&this8)->lineno = UINT32(0); (&this8)->filename = ""; (&this8)->tl_info = UINT64(0); (&this8)->state = taskState_pending; (&this8)->lineno = UINT32(0); (&this8)->filename = ""; (&this8)->tl_info = UINT64(0); wrap_call_tmp = _construct_chpldev_Task(taskState_pending, UINT32(0), "", UINT64(0), &this8, _ln, _fn); call_tmp2 = (i - INT64(1)); *(x + call_tmp2) = wrap_call_tmp; } return; }
/** * \brief This function initialize members of structure for Node_Priority command */ static void _v_node_link_init(struct Generic_Cmd *node_link, uint32 parent_node_id, uint32 child_node_id) { if(node_link != NULL) { /* initialize members with values */ node_link->id = CMD_NODE_LINK; UINT32(node_link->data[0]) = parent_node_id; UINT32(node_link->data[UINT32_SIZE]) = child_node_id; } }
uint32_t DisplayHDMI::GetBestConfig(HWS3DMode s3d_mode) { uint32_t best_index = 0, index; uint32_t num_modes = 0; hw_intf_->GetNumDisplayAttributes(&num_modes); // Get display attribute for each mode std::vector<HWDisplayAttributes> attrib(num_modes); for (index = 0; index < num_modes; index++) { hw_intf_->GetDisplayAttributes(index, &attrib[index]); } // Select best config for s3d_mode. If s3d is not enabled, s3d_mode is kS3DModeNone for (index = 0; index < num_modes; index ++) { if (attrib[index].s3d_config[s3d_mode]) { break; } } if (index < num_modes) { best_index = UINT32(index); for (size_t index = best_index + 1; index < num_modes; index ++) { if (!attrib[index].s3d_config[s3d_mode]) continue; // From the available configs, select the best // Ex: 1920x1080@60Hz is better than 1920x1080@30 and 1920x1080@30 is better than 1280x720@60 if (attrib[index].y_pixels > attrib[best_index].y_pixels) { best_index = UINT32(index); } else if (attrib[index].y_pixels == attrib[best_index].y_pixels) { if (attrib[index].x_pixels > attrib[best_index].x_pixels) { best_index = UINT32(index); } else if (attrib[index].x_pixels == attrib[best_index].x_pixels) { if (attrib[index].vsync_period_ns < attrib[best_index].vsync_period_ns) { best_index = UINT32(index); } } } } } else { DLOGW("%s, could not support S3D mode from EDID info. S3D mode is %d", __FUNCTION__, s3d_mode); } // Used for changing HDMI Resolution - override the best with user set config uint32_t user_config = UINT32(Debug::GetHDMIResolution()); if (user_config) { uint32_t config_index = 0; // For the config, get the corresponding index DisplayError error = hw_intf_->GetConfigIndex(user_config, &config_index); if (error == kErrorNone) return config_index; } return best_index; }
int main(int argc, char * argv[]) { PIN_Init(argc, argv); PIN_InitSymbolsAlt( SYMBOL_INFO_MODE(UINT32(IFUNC_SYMBOLS) | UINT32(DEBUG_OR_EXPORT_SYMBOLS))); IMG_AddInstrumentFunction(Image,0); // Never returns PIN_StartProgram(); return 0; }
/** * \brief This function handle node_unsubscribe command */ int vs_handle_node_unsubscribe(struct VS_CTX *vs_ctx, struct VSession *vsession, struct Generic_Cmd *node_unsubscribe) { struct VSNode *node; struct VSNodeSubscriber *node_subscriber; uint32 node_id = UINT32(node_unsubscribe->data[0]); uint32 version = UINT32(node_unsubscribe->data[UINT32_SIZE]); /*uint32 crc32 = UINT32(node_unsubscribe->data[UINT32_SIZE + UINT32_SIZE]);*/ /* Try to find node */ if((node = vs_node_find(vs_ctx, node_id)) == NULL) { v_print_log(VRS_PRINT_DEBUG_MSG, "%s() node (id: %d) not found\n", __FUNCTION__, node_id); return 0; } /* TODO: when versing will be supported, then compute crc32, save data to * the disk and send node_unsubscribe command to the client with version number * and crc32 */ if(version != 0) { v_print_log(VRS_PRINT_WARNING, "Version: %d != 0, versing is not supported yet\n", version); } /* Node has to be created */ if(node->state == ENTITY_CREATED || node->state == ENTITY_CREATING) { /* Is client subscribed to this node? */ node_subscriber = node->node_subs.first; while(node_subscriber != NULL) { if(node_subscriber->session->session_id == vsession->session_id) { break; } node_subscriber = node_subscriber->next; } if(node_subscriber!= NULL) { return vs_node_unsubscribe(node, node_subscriber, 0); } else { v_print_log(VRS_PRINT_DEBUG_MSG, "%s() client not subscribed to this node (id: %d)\n", __FUNCTION__, node_id); return 0; } } else { v_print_log(VRS_PRINT_DEBUG_MSG, "%s() node (id: %d) is not in NODE_CREATED state: %d\n", __FUNCTION__, node->id, node->state); return 0; } return 0; }
int CFITOM::InitVoice(int type, int banks, CVoiceBank* voice) { int ret = 0; FMVOICE buf; memset((void*)&buf, 0, sizeof(FMVOICE)); for (int j=0; j<banks; j++) { for (int i=0; i<128; i++) { buf.ID = UINT32(0xff000000L) | UINT32(j << 8) | i; voice[j].SetVoice(i, &buf); } } return ret; }
void CVisualTree::GetMaxExtent(UINT32& maxXExtent, UINT32& maxYExtent) { for(size_t n = 0; n < m_Objects.GetCount(); n++) { CVisualObject* pObj = m_Objects.GetAt(n); UINT32 objXExtent = UINT32(pObj->Rect().x() + pObj->Rect().w() + 10); UINT32 objYExtent = UINT32(pObj->Rect().y() + pObj->Rect().h() + 10); if(objXExtent > maxXExtent) maxXExtent = objXExtent; if(objYExtent > maxYExtent) maxYExtent = objYExtent; } }
/** * \brief This function initialize structure of TagGroup_Subscribe command */ static void _v_taggroup_unsubscribe_init(struct Generic_Cmd *taggroup_unsubscribe, uint32 node_id, uint16 taggroup_id, uint32 version, uint32 crc32) { if(taggroup_unsubscribe != NULL) { taggroup_unsubscribe->id = CMD_TAGGROUP_UNSUBSCRIBE; UINT32(taggroup_unsubscribe->data[0]) = node_id; UINT16(taggroup_unsubscribe->data[UINT32_SIZE]) = taggroup_id; UINT32(taggroup_unsubscribe->data[UINT32_SIZE+UINT16_SIZE]) = version; UINT32(taggroup_unsubscribe->data[UINT32_SIZE+UINT16_SIZE+UINT32_SIZE]) = crc32; } }
inline unsigned int RarVM::GetValue(bool ByteMode,unsigned int *Addr) { if (ByteMode) return(*(unsigned char *)Addr); else { #if defined(BIG_ENDIAN) || !defined(ALLOW_NOT_ALIGNED_INT) unsigned char *B=(unsigned char *)Addr; return UINT32((unsigned int)B[0]|((unsigned int)B[1]<<8)|((unsigned int)B[2]<<16)|((unsigned int)B[3]<<24)); #else return UINT32(*Addr); #endif } }
OP_STATUS QuickPagingLayout::GoToPage(int pos) { if (0 > pos || UINT32(pos) >= m_pages.GetCount()) { OP_ASSERT(!"Index out of bounds"); return OpStatus::ERR_OUT_OF_RANGE; } if (pos == m_active_pos) return OpStatus::OK; if (m_active_pos >= 0) m_pages[m_active_pos]->SetParentOpWidget(0); m_previous_pos = m_active_pos; m_active_pos = pos; if (!m_visible) return OpStatus::OK; m_pages[m_active_pos]->SetParentOpWidget(m_parent_op_widget); if (m_previous_pos >= 0) StartAnimation(); if (m_rect.IsEmpty()) return OpStatus::OK; return Layout(m_rect); }
int32_t prm_getAll(const uint16_t &index, Chirp *chirp) { int res; uint16_t i; uint32_t len; uint8_t *data, argList[CRP_MAX_ARGS]; ParamRecord *rec; Shadow *shadow; for (i=0, rec=(ParamRecord *)PRM_FLASH_LOC; rec->crc!=0xffff && rec<(ParamRecord *)PRM_ENDREC; i++, rec++) { if(i==index) { shadow = prm_findShadow(prm_getId(rec)); if (shadow && shadow->data) { len = shadow->len; data = shadow->data; } else { len = rec->len; data = (uint8_t *)rec+prm_getDataOffset(rec); } res = Chirp::getArgList(data, rec->len, argList); if (res<0) return res; CRP_RETURN(chirp, UINT32(rec->flags), STRING(argList), STRING(prm_getId(rec)), STRING(prm_getDesc(rec)), UINTS8(len, data), END); return 0; } } return -1; }
void* HWEvents::DisplayEventHandler() { char data[kMaxStringLength] = {0}; prctl(PR_SET_NAME, event_thread_name_.c_str(), 0, 0, 0); setpriority(PRIO_PROCESS, 0, kThreadPriorityUrgent); while (!exit_threads_) { int error = Sys::poll_(poll_fds_.data(), UINT32(event_list_->size()), -1); if (error <= 0) { DLOGW("poll failed. error = %s", strerror(errno)); continue; } for (uint32_t event = 0; event < event_list_->size(); event++) { pollfd &poll_fd = poll_fds_[event]; if (!strncmp(event_list_->at(event), "thread_exit", strlen("thread_exit"))) { if ((poll_fd.revents & POLLIN) && (Sys::read_(poll_fd.fd, data, kMaxStringLength) > 0)) { (this->*(event_data_list_[event]).event_parser)(data); } } else { if ((poll_fd.revents & POLLPRI) && (Sys::pread_(poll_fd.fd, data, kMaxStringLength, 0) > 0)) { (this->*(event_data_list_[event]).event_parser)(data); } } } } pthread_exit(0); return NULL; }
void *malloc_file_line(size_t size, const char *file, int line, bool array, bool throw_on_fail, bool clear) { // allocate the memory and fail if we can't void *result = array ? osd_malloc_array(size) : osd_malloc(size); if (result == nullptr) { fprintf(stderr, "Failed to allocate %d bytes (%s:%d)\n", UINT32(size), file, line); osd_break_into_debugger("Failed to allocate RAM"); if (throw_on_fail) throw std::bad_alloc(); return nullptr; } // zap the memory if requested if (clear) memset(result, 0, size); else { #if !__has_feature(memory_sanitizer) && defined(INITIALIZE_ALLOCATED_MEMORY) && !defined(MAME_DEBUG_FAST) memset(result, 0xdd, size); #endif } // add a new entry memory_entry::allocate(size, result, file, line, array); return result; }
bool CTemplateManager::GetTemplateFilename( UINT32 ordNumberOfTemplate, String_256* pStrNameOfFile ) { // Fill the list with all templates (user local, begin second will over-write system ones) CTemplateList setSortFilename; GetTemplateList( &setSortFilename, m_TemplatesPath, false ); GetTemplateList( &setSortFilename, m_LocalTemplatesPath, true ); // If the template with ordinal doesn't exist, fail if( ordNumberOfTemplate > UINT32(setSortFilename.size()) ) return false; // Get enbry for template CTemplateList::iterator iter = setSortFilename.begin(); for( UINT32 i = 1; i < ordNumberOfTemplate; ++i, ++iter ) { /*Do nothing!*/ } // Pre-pend the path to the template PathName pathTemplates = iter->second ? m_LocalTemplatesPath : m_TemplatesPath; pathTemplates.SetFileNameAndType( iter->first ); *pStrNameOfFile = pathTemplates.GetPath(); TRACEUSER( "jlh92", _T("Final(%d) = %s\n"), ordNumberOfTemplate, PCTSTR(*pStrNameOfFile) ); return true; }
void i82371ab_device::device_reset() { southbridge_device::device_reset(); UINT32 (*regs32)[64] = (UINT32 (*)[64])(m_regs); /* isa */ regs32[0][0x00] = 0x71108086; regs32[0][0x04] = 0x00000000; regs32[0][0x08] = 0x06010000; regs32[0][0x0c] = 0x00800000; /* ide */ regs32[1][0x00] = 0x71118086; regs32[1][0x04] = 0x02800000; regs32[1][0x08] = 0x01018000; regs32[1][0x0c] = 0x00000000; /* usb */ regs32[2][0x00] = 0x71128086; regs32[2][0x04] = 0x02800000; regs32[2][0x08] = 0x0c030000; regs32[2][0x0c] = 0x00000000; /* acpi */ regs32[3][0x00] = 0x71138086; regs32[3][0x04] = 0x02800000; regs32[3][0x08] = 0x06800000; regs32[3][0x0c] = 0x02800000; }
bool InternetChessPlayer::send ( const ChessBoard &board ) { char tempString [256]; UINT32 numPlies = board.GetCurrentPlyNumber(); if ( numPlies > 0 ) { // Before receiving the move from the remote opponent, we must // send him the complete state of the game as it exists locally. // Send an 8-byte string to specify what kind of message this is. // In this case, it is "history", because we are sending the entire history // of moves in the game history so far... UINT32 plyBytes = numPlies * sizeof(Move); UINT32 packetSize = 8 + sizeof(numPlies) + plyBytes; int result = ::send ( connectInfo.commSocket, (const char *)&packetSize, 4, 0 ); if ( result != 4 ) { sprintf ( tempString, "send psize: %d", WSAGetLastError() ); userInterface.ReportSpecial (tempString); return false; } result = ::send ( connectInfo.commSocket, "history ", 8, 0 ); if ( result != 8 ) { sprintf ( tempString, "send 'history': %d", WSAGetLastError() ); userInterface.ReportSpecial (tempString); return false; } result = ::send ( connectInfo.commSocket, (const char *)&numPlies, 4, 0 ); if ( result != 4 ) return false; Move *history = new Move [numPlies]; if ( !history ) { userInterface.ReportSpecial ( "out of memory!" ); return false; } for ( UINT32 ply = 0; ply < numPlies; ++ply ) history[ply] = board.GetPastMove (ply); result = ::send ( connectInfo.commSocket, (const char *)history, plyBytes, 0 ); delete[] history; history = NULL; if ( UINT32(result) != plyBytes ) { sprintf ( tempString, "send: %d", WSAGetLastError() ); userInterface.ReportSpecial (tempString); return false; } } return true; }
void CPlayer::SetBotPlayerData(const MoGui::MoGuiXY::DBServerXY::DBS_BotPlayerData& bpd) { m_AID = bpd.m_AID; m_PID = bpd.m_PID; m_Sex = bpd.m_Sex; m_NickName = bpd.m_NickName; m_HeadPicURL = bpd.m_HeadPicURL; m_HomePageURL = bpd.m_HomePageURL; m_City = bpd.m_City; m_nGameMoney = bpd.m_nGameMoney; m_nJF = bpd.m_nJF; m_nEP = bpd.m_nEP; m_nWinTimes = INT32(bpd.m_nWinTimes); m_nLossTimes = INT32(bpd.m_nLossTimes); m_nGameTime = INT32(bpd.m_nGameTime); m_MaxPai = bpd.m_MaxPai; m_MaxPaiTime = bpd.m_MaxPaiTime; m_MaxMoney = bpd.m_MaxMoney; m_MaxMoneyTime = bpd.m_MaxMoneyTime; m_MaxWin = bpd.m_MaxWin; m_MaxWinTime = bpd.m_MaxWinTime; m_JoinTime = bpd.m_JoinTime; m_LandTime = UINT32(time(NULL)); m_InvitePID = bpd.m_InvitePID; ClearMoneyLog(); AddMoneyLog(bpd.m_nGameMoney,"SetBotPlayerData"); }
void CompManager::PrepareStrategyConstraints(Handle comp_handle, HWLayers *hw_layers) { DisplayCompositionContext *display_comp_ctx = reinterpret_cast<DisplayCompositionContext *>(comp_handle); StrategyConstraints *constraints = &display_comp_ctx->constraints; constraints->safe_mode = safe_mode_; constraints->use_cursor = false; constraints->max_layers = max_layers_; // Limit 2 layer SDE Comp if its not a Primary Display if (!display_comp_ctx->is_primary_panel) { constraints->max_layers = 2; } // If a strategy fails after successfully allocating resources, then set safe mode if (display_comp_ctx->remaining_strategies != display_comp_ctx->max_strategies) { constraints->safe_mode = true; } // Avoid idle fallback, if there is only one app layer. // TODO(user): App layer count will change for hybrid composition uint32_t app_layer_count = UINT32(hw_layers->info.stack->layers.size()) - 1; if ((app_layer_count > 1 && display_comp_ctx->idle_fallback) || display_comp_ctx->fallback_) { // Handle the idle timeout by falling back constraints->safe_mode = true; } if (SupportLayerAsCursor(comp_handle, hw_layers)) { constraints->use_cursor = true; } }
int vs_handle_layer_unsubscribe(struct VS_CTX *vs_ctx, struct VSession *vsession, struct Generic_Cmd *layer_unsubscribe_cmd) { struct VSNode *node; struct VSLayer *layer; uint32 node_id = UINT32(layer_unsubscribe_cmd->data[0]); uint16 layer_id = UINT16(layer_unsubscribe_cmd->data[UINT32_SIZE]); /* uint32 version = UINT32(layer_subscribe_cmd->data[UINT32_SIZE+UINT16_SIZE]); uint32 crc32 = UINT32(layer_subscribe_cmd->data[UINT32_SIZE+UINT16_SIZE+UINT32_SIZE]); */ /* Try to find node */ if((node = vs_node_find(vs_ctx, node_id)) == NULL) { v_print_log(VRS_PRINT_DEBUG_MSG, "%s() node (id: %d) not found\n", __FUNCTION__, node_id); return 0; } /* Try to find layer */ if( (layer = vs_layer_find(node, layer_id)) == NULL) { v_print_log(VRS_PRINT_DEBUG_MSG, "%s() layer (id: %d) in node (id: %d) not found\n", __FUNCTION__, layer_id, node_id); return 0; } return vs_layer_unsubscribe(layer, vsession); }
/** * \brief This function tries to handle node_create command */ int vs_handle_node_create(struct VS_CTX *vs_ctx, struct VSession *vsession, struct Generic_Cmd *node_create) { uint16 user_id = UINT16(node_create->data[0]); uint32 parent_id = UINT32(node_create->data[UINT16_SIZE]); uint32 node_id = UINT32(node_create->data[UINT16_SIZE+UINT32_SIZE]); uint16 custom_type = UINT16(node_create->data[UINT16_SIZE+UINT32_SIZE+UINT32_SIZE]); /* Client has to send node_create command with node_id equal to * the value 0xFFFFFFFF */ if(node_id != VRS_RESERVED_NODE_ID) { v_print_log(VRS_PRINT_DEBUG_MSG, "%s() node_id is 0xFFFFFFFF\n", __FUNCTION__); return 0; } /* Client has to send node_create with parent_id equal to its avatar_id */ if(parent_id != vsession->avatar_id) { v_print_log(VRS_PRINT_DEBUG_MSG, "%s() parent_id: %d is not equal to session avatar id %d\n", __FUNCTION__, parent_id, vsession->avatar_id); return 0; } /* Client has to send node_create command with his user_id */ if(user_id != vsession->user_id) { v_print_log(VRS_PRINT_DEBUG_MSG, "%s() user_id: %d is not equal to session user id %d\n", __FUNCTION__, user_id, vsession->user_id); return 0; } /* Client has to send node_create command with custom_type bigger or * equal 32, because lower values are reserved for special nodes */ if( custom_type < 32 ) { v_print_log(VRS_PRINT_DEBUG_MSG, "%s() custom_type: %d is smaller then 32\n", __FUNCTION__, custom_type); return 0; } if(vs_node_new(vs_ctx, vsession, custom_type) != NULL) { return 1; } else { return 0; } return 0; }
void AE_WaitStable(UINT32 count) { UINT32 VD_count = 0; UINT32 orgNewWeight=0,orgPrvWeight=0,orgConH=0,orgConL=0,orgRatioH=0,orgRatioL=0; BOOL orgbOverExpt = FALSE; PImageAlgInfo pimginfo; UINT32(* orgPrvCurve)[ AEALG_INFO_MAX ]; pimginfo = UI_GetParameter(); if (AEAlg_GetStbCnt() >= 2) { return; } //enlarge coverge condition orgNewWeight = AeInfo.EVNewWeight; orgPrvWeight = AeInfo.EVPrvWeight; orgRatioH = AeInfo.AdjRatioH; orgRatioL = AeInfo.AdjRatioL; orgConH = AeInfo.CovRangeH; orgConL = AeInfo.CovRangeL; orgbOverExpt = AeInfo.ReduceOverExpoModeEn; AeInfo.EVNewWeight = 1; AeInfo.EVPrvWeight = 0; AeInfo.AdjRatioH = 300; AeInfo.AdjRatioL = 20; AeInfo.CovRangeH = 10; AeInfo.CovRangeL = 10; AeInfo.ReduceOverExpoModeEn = FALSE; orgPrvCurve = AeInfo.PrvCurve; //debug_msg("^G %s:",__func__); AE_Process(); if(AE_getFlickerType(pimginfo->Frequency) == AE_FLICKER_50HZ) AeInfo.PrvCurve = (UINT32(*)[AEALG_INFO_MAX])AeCurve_ISO400_50Hz; else AeInfo.PrvCurve = (UINT32(*)[AEALG_INFO_MAX])AeCurve_ISO400_60Hz; while (AEAlg_GetStbCnt() < 2) { sie_waitVD(2); //debug_msg("^G %s:",__func__); AE_Process(); if(AEAlg_GetStbCnt() >= 2) break; VD_count += 2; if((VD_count > count * aaa_GetAeRate())) { break; } } AeInfo.PrvCurve = orgPrvCurve; AE_reset();//inorder to use org ae curve AeInfo.EVNewWeight = orgNewWeight; AeInfo.EVPrvWeight = orgPrvWeight; AeInfo.AdjRatioH = orgRatioH; AeInfo.AdjRatioL = orgRatioL; AeInfo.CovRangeH = orgConH; AeInfo.CovRangeL = orgConL; AeInfo.ReduceOverExpoModeEn = orgbOverExpt; }
/** * \brief This function tries to handle Tag_Destroy command */ int vs_handle_tag_destroy(struct VS_CTX *vs_ctx, struct VSession *vsession, struct Generic_Cmd *tag_destroy) { struct VSNode *node; struct VSTagGroup *tg; struct VSTag *tag; uint32 node_id = UINT32(tag_destroy->data[0]); uint16 taggroup_id = UINT16(tag_destroy->data[UINT32_SIZE]); uint16 tag_id = UINT16(tag_destroy->data[UINT32_SIZE + UINT16_SIZE]); int ret = 0; /* Try to find node */ if((node = vs_node_find(vs_ctx, node_id)) == NULL) { v_print_log(VRS_PRINT_DEBUG_MSG, "%s() node (id: %d) not found\n", __FUNCTION__, node_id); return 0; } pthread_mutex_lock(&node->mutex); /* Node has to be created */ if(vs_node_is_created(node) != 1) { goto end; } /* Is user owner of this node or can user write to this node? */ if(vs_node_can_write(vsession, node) != 1) { v_print_log(VRS_PRINT_DEBUG_MSG, "%s(): user: %s can't write to node: %d\n", __FUNCTION__, ((struct VSUser *)vsession->user)->username, node->id); goto end; } /* Try to find TagGroup */ if( (tg = vs_taggroup_find(node, taggroup_id)) == NULL) { v_print_log(VRS_PRINT_DEBUG_MSG, "%s() tag_group (id: %d) in node (id: %d) not found\n", __FUNCTION__, taggroup_id, node_id); goto end; } /* Try to find Tag */ if ( (tag = vs_tag_find(tg, tag_id)) == NULL) { v_print_log(VRS_PRINT_DEBUG_MSG, "%s() tag (id: %d) in tag_group (id: %d), node (id: %d) not found\n", __FUNCTION__, tag_id, taggroup_id, node_id); goto end; } ret = vs_tag_send_destroy(node, tg, tag); end: pthread_mutex_unlock(&node->mutex); return ret; }
// // WriteDirEntry // static void WriteDirEntry(lump_t *lump) { size_t len; raw_wad_entry_t entry; DisplayTicker(); strncpy(entry.name, lump->name, 8); entry.start = UINT32(lump->new_start); entry.length = UINT32(lump->length); len = fwrite(&entry, sizeof(entry), 1, out_file); if (len != 1) PrintWarn("Trouble writing wad directory\n"); }
/* Tell returns the current file position in the ra file */ ULONG32 CWin32MMFile::Tell (void) { if (!m_hfmoFile || m_ulPositionHigh) { return UINT32(-1); } return m_ulPositionLow; }