本文整理汇总了C++中VALIDATE函数的典型用法代码示例。如果您正苦于以下问题:C++ VALIDATE函数的具体用法?C++ VALIDATE怎么用?C++ VALIDATE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VALIDATE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: alloc_perm
AFFECT_DATA *new_affect(void)
{
static AFFECT_DATA af_zero;
AFFECT_DATA *af;
if (affect_free == NULL)
af = alloc_perm(sizeof(*af));
else
{
af = affect_free;
affect_free = affect_free->next;
}
*af = af_zero;
VALIDATE(af);
return af;
}
示例2: onlp_psu_cpr_4011_fan_percentage_set
static int
onlp_psu_cpr_4011_fan_percentage_set(onlp_oid_t id, int p)
{
int i = ONLP_OID_ID_GET(id) - 2;
unsigned char mux_ch[] = {0x2, 0x4};
unsigned char cfg_addr[] = {I2C_PSU1_SLAVE_ADDR_CFG, I2C_PSU2_SLAVE_ADDR_CFG};
unsigned char speed[2] = {(unsigned char)p, 0};
VALIDATE(id);
if (as5610_52x_i2c0_pca9548_channel_set(mux_ch[i]) != 0) {
return ONLP_STATUS_E_INTERNAL;
}
if (i2c_nWrite(I2C_PSU_BUS_ID, cfg_addr[i], I2C_PSU_FAN_SPEED_CTL_REG, sizeof(speed), speed) != 0) {
return ONLP_STATUS_E_INTERNAL;
}
return ONLP_STATUS_OK;
}
示例3: VALIDATE
const SkGlyph& SkGlyphCache::getGlyphIDMetrics(uint16_t glyphID) {
VALIDATE();
uint32_t id = SkGlyph::MakeID(glyphID);
unsigned index = ID2HashIndex(id);
SkGlyph* glyph = fGlyphHash[index];
if (NULL == glyph || glyph->fID != id) {
RecordHashCollisionIf(glyph != NULL);
glyph = this->lookupMetrics(glyphID, kFull_MetricsType);
fGlyphHash[index] = glyph;
} else {
RecordHashSuccess();
if (glyph->isJustAdvance()) {
fScalerContext->getMetrics(glyph);
}
}
SkASSERT(glyph->isFullMetrics());
return *glyph;
}
示例4: new_mbr
MBR_DATA *
new_mbr (void)
{
static MBR_DATA mbr_zero;
MBR_DATA *mbr;
if (mbr_free == NULL)
mbr = alloc_perm (sizeof (*mbr));
else
{
mbr = mbr_free;
mbr_free = mbr_free->next;
}
*mbr = mbr_zero;
VALIDATE (mbr);
mbr->name = &str_empty[0];
return mbr;
}
示例5: new_ban
BAN_DATA *
new_ban (void)
{
static BAN_DATA ban_zero;
BAN_DATA *ban;
if (ban_free == NULL)
ban = alloc_perm (sizeof (*ban));
else
{
ban = ban_free;
ban_free = ban_free->next;
}
*ban = ban_zero;
VALIDATE (ban);
ban->name = &str_empty[0];
return ban;
}
示例6: new_wiz
WIZ_DATA *
new_wiz (void)
{
static WIZ_DATA wiz_zero;
WIZ_DATA *wiz;
if (wiz_free == NULL)
wiz = alloc_perm (sizeof (*wiz));
else
{
wiz = wiz_free;
wiz_free = wiz_free->next;
}
*wiz = wiz_zero;
VALIDATE (wiz);
wiz->name = &str_empty[0];
return wiz;
}
示例7: new_cln
CLN_DATA *
new_cln (void)
{
static CLN_DATA cln_zero;
CLN_DATA *cln;
if (cln_free == NULL)
cln = alloc_perm (sizeof (*cln));
else
{
cln = cln_free;
cln_free = cln_free->next;
}
*cln = cln_zero;
VALIDATE (cln);
cln->name = &str_empty[0];
return cln;
}
示例8: Lin_Init
void Lin_Init( const Lin_ConfigType* Config )
{
(void)Config;
uint8 i;
VALIDATE( (LinDriverStatus == LIN_UNINIT), LIN_INIT_SERVICE_ID, LIN_E_STATE_TRANSITION );
/* VALIDATE( (Config!=0), LIN_INIT_SERVICE_ID, LIN_E_INVALID_POINTER ); */
for (i=0;i<LIN_CONTROLLER_CNT;i++)
{
/* LIN171: On entering the state LIN_INIT, the Lin module shall set each channel into
* state LIN_CH_UNINIT. */
LinChannelStatus[i] = LIN_CH_UNINIT;
}
/* LIN146: LIN_UNINIT -> LIN_INIT: The Lin module shall transition from LIN_UNINIT
* to LIN_INIT when the function Lin_Init is called. */
LinDriverStatus = LIN_INIT;
}
示例9: INHERITED
GrGLBuffer::GrGLBuffer(GrGLGpu* gpu, size_t size, GrBufferType intendedType,
GrAccessPattern accessPattern, bool cpuBacked, const void* data)
: INHERITED(gpu, size, intendedType, accessPattern, cpuBacked),
fCPUData(nullptr),
fIntendedType(intendedType),
fBufferID(0),
fSizeInBytes(size),
fUsage(gr_to_gl_access_pattern(intendedType, accessPattern)),
fGLSizeInBytes(0),
fHasAttachedToTexture(false) {
if (this->isCPUBacked()) {
// Core profile uses vertex array objects, which disallow client side arrays.
SkASSERT(!gpu->glCaps().isCoreProfile());
if (gpu->caps()->mustClearUploadedBufferData()) {
fCPUData = sk_calloc_throw(fSizeInBytes);
} else {
fCPUData = sk_malloc_flags(fSizeInBytes, SK_MALLOC_THROW);
}
if (data) {
memcpy(fCPUData, data, fSizeInBytes);
}
} else {
GL_CALL(GenBuffers(1, &fBufferID));
if (fBufferID) {
GrGLenum target = gpu->bindBuffer(fIntendedType, this);
CLEAR_ERROR_BEFORE_ALLOC(gpu->glInterface());
// make sure driver can allocate memory for this buffer
GL_ALLOC_CALL(gpu->glInterface(), BufferData(target,
(GrGLsizeiptr) fSizeInBytes,
data,
fUsage));
if (CHECK_ALLOC_ERROR(gpu->glInterface()) != GR_GL_NO_ERROR) {
GL_CALL(DeleteBuffers(1, &fBufferID));
fBufferID = 0;
} else {
fGLSizeInBytes = fSizeInBytes;
}
}
}
VALIDATE();
this->registerWithCache(SkBudgeted::kYes);
}
示例10: update_canvas
void tscrollbar_::set_item_position(const unsigned item_position)
{
// Set the value always execute since we update a part of the state.
item_position_ = item_position > item_count_ - visible_items_
? item_count_ - visible_items_
: item_position;
item_position_ = (item_position_ + step_size_ - 1) / step_size_;
if(all_items_visible()) {
item_position_ = 0;
}
// Determine the pixel offset of the item position.
positioner_offset_ = static_cast<unsigned>(item_position_ * pixels_per_step_);
update_canvas();
VALIDATE(item_position_ <= item_count_ - visible_items_, null_str);
}
示例11: cpg_virt_hostlist
static int
cpg_virt_hostlist(hostlist_callback callback, void *arg, void *priv)
{
struct cpg_info *info = (struct cpg_info *) priv;
int i;
VALIDATE(priv);
printf("[cpg-virt] HOSTLIST operation\n");
pthread_mutex_lock(&local_vm_list_lock);
update_local_vms(info);
for (i = 0 ; i < local_vm_list->vm_count ; i++) {
callback(local_vm_list->vm_states[i].v_name,
local_vm_list->vm_states[i].v_uuid,
local_vm_list->vm_states[i].v_state.s_state, arg);
}
pthread_mutex_unlock(&local_vm_list_lock);
return 1;
}
示例12: VALIDATE
bool DX10_Obj_LitTex::Initialise(DX10_Renderer* _pRenderer, DX10_Mesh* _pMesh, DX10_Shader_LitTex* _pShader, std::string _texName)
{
if (_pRenderer == 0 || _pMesh == 0 || _pShader == 0)
{
// If any pointers are NULL, Object cannot be initialized
return false;
}
// Assign Member Variables
m_pRenderer = _pRenderer;
m_pMesh = _pMesh;
m_pShader = _pShader;
m_pTextures = new std::vector<ID3D10ShaderResourceView*>;
ID3D10ShaderResourceView* pTempTex = 0;
VALIDATE(m_pRenderer->CreateTexture(_texName, pTempTex));
m_pTextures->push_back(pTempTex);
return true;
}
示例13: VALIDATE
std::pair<T*, config::attribute_value> mp_options_helper::add_node_and_get_widget(
tree_view_node& option_node, const std::string& id, data_map& data, const config& cfg)
{
tree_view_node& node = option_node.add_child(id + "_node", data);
T* widget = dynamic_cast<T*>(node.find(id, true));
VALIDATE(widget, missing_widget(id));
const std::string widget_id = cfg["id"];
auto& option_config = options_data_[visible_options_.back().id];
if(!option_config.has_attribute(widget_id) || option_config[widget_id].empty()) {
option_config[widget_id] = cfg["default"];
}
widget->set_id(widget_id);
widget->set_tooltip(cfg["description"]);
return {widget, option_config[widget_id]};
}
示例14: alloc_perm
PROG_LIST *new_rprog(void)
{
static PROG_LIST rp_zero;
PROG_LIST *rp;
if (rprog_free == NULL)
rp = alloc_perm(sizeof(*rp));
else
{
rp = rprog_free;
rprog_free=rprog_free->next;
}
*rp = rp_zero;
rp->vnum = 0;
rp->trig_type = 0;
rp->code = str_dup("");
VALIDATE(rp);
return rp;
}
示例15: onlp_thermal_info_get_locked__
static int
onlp_thermal_info_get_locked__(onlp_oid_t oid, onlp_thermal_info_t* info)
{
int rv;
VALIDATE(oid);
rv = onlp_thermali_info_get(oid, info);
if(rv >= 0) {
#if ONLP_CONFIG_INCLUDE_PLATFORM_OVERRIDES == 1
int id = ONLP_OID_ID_GET(oid);
cJSON* entry = NULL;
cjson_util_lookup(onlp_json_get(0), &entry, "overrides.thermal.%d", id);
onlp_thermali_info_from_json__(entry, info, 0);
#endif
}
return rv;
}