当前位置: 首页>>代码示例>>C++>>正文


C++ dimof函数代码示例

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


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

示例1: vsfos_modinit

vsf_err_t vsfos_modinit(struct vsf_module_t *module,
								struct app_hwcfg_t const *cfg)
{
	struct vsfos_modifs_t *ifs;
	ifs = vsf_bufmgr_malloc(sizeof(struct vsfos_modifs_t));
	if (!ifs) return VSFERR_FAIL;
	memset(ifs, 0, sizeof(*ifs));

	ifs->hwcfg = cfg;

	ifs->pendsvq.size = dimof(ifs->pendsvq_ele);
	ifs->pendsvq.queue = ifs->pendsvq_ele;
	ifs->pendsvq.activate = vsfos_pendsv_activate;

	// init vsftimer
	ifs->vsftimer_memop.alloc = vsftimer_memop_alloc;
	ifs->vsftimer_memop.free = vsftimer_memop_free;

	// init fakefat32_fs
	ifs->fakefat32_fs.Windows_dir[0].memfile.file.name = ".";
	ifs->fakefat32_fs.Windows_dir[0].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.Windows_dir[1].memfile.file.name = "..";
	ifs->fakefat32_fs.Windows_dir[1].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.Windows_dir[2].memfile.file.name = "VSFCDC.inf";
	ifs->fakefat32_fs.Windows_dir[2].memfile.file.size = sizeof(vsfcdc_inf) - 1;
	ifs->fakefat32_fs.Windows_dir[2].memfile.file.attr = VSFILE_ATTR_ARCHIVE | VSFILE_ATTR_READONLY;
	ifs->fakefat32_fs.Windows_dir[2].memfile.f.buff = (uint8_t *)vsfcdc_inf;
	ifs->fakefat32_fs.Windows_dir[3].memfile.file.name = "VSFRNDIS.inf";
	ifs->fakefat32_fs.Windows_dir[3].memfile.file.size = sizeof(vsfrndis_inf) - 1;
	ifs->fakefat32_fs.Windows_dir[3].memfile.file.attr = VSFILE_ATTR_ARCHIVE | VSFILE_ATTR_READONLY;
	ifs->fakefat32_fs.Windows_dir[3].memfile.f.buff = (uint8_t *)vsfrndis_inf;

	ifs->fakefat32_fs.Driver_dir[0].memfile.file.name = ".";
	ifs->fakefat32_fs.Driver_dir[0].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.Driver_dir[1].memfile.file.name = "..";
	ifs->fakefat32_fs.Driver_dir[1].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.Driver_dir[2].memfile.file.name = "Windows";
	ifs->fakefat32_fs.Driver_dir[2].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.Driver_dir[2].memfile.d.child = (struct vsfile_memfile_t *)ifs->fakefat32_fs.Windows_dir;

	ifs->fakefat32_fs.LOSTDIR_dir[0].memfile.file.name = ".";
	ifs->fakefat32_fs.LOSTDIR_dir[0].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.LOSTDIR_dir[1].memfile.file.name = "..";
	ifs->fakefat32_fs.LOSTDIR_dir[1].memfile.file.attr = VSFILE_ATTR_DIRECTORY;

	ifs->fakefat32_fs.RECYCLEBIN_dir[0].memfile.file.name = ".";
	ifs->fakefat32_fs.RECYCLEBIN_dir[0].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.RECYCLEBIN_dir[1].memfile.file.name = "..";
	ifs->fakefat32_fs.RECYCLEBIN_dir[1].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.RECYCLEBIN_dir[2].memfile.file.name = "DESKTOP.INI";
	ifs->fakefat32_fs.RECYCLEBIN_dir[2].memfile.file.size = sizeof(Win_recycle_DESKTOP_INI) - 1;
	ifs->fakefat32_fs.RECYCLEBIN_dir[2].memfile.file.attr = VSFILE_ATTR_ARCHIVE | VSFILE_ATTR_READONLY;
	ifs->fakefat32_fs.RECYCLEBIN_dir[2].memfile.f.buff = (uint8_t *)Win_recycle_DESKTOP_INI;

	ifs->fakefat32_fs.SVI_dir[0].memfile.file.name = ".";
	ifs->fakefat32_fs.SVI_dir[0].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.SVI_dir[1].memfile.file.name = "..";
	ifs->fakefat32_fs.SVI_dir[1].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.SVI_dir[2].memfile.file.name = "IndexerVolumeGuid";
	ifs->fakefat32_fs.SVI_dir[2].memfile.file.size = sizeof(Win10_IndexerVolumeGuid);
	ifs->fakefat32_fs.SVI_dir[2].memfile.file.attr = VSFILE_ATTR_ARCHIVE | VSFILE_ATTR_READONLY | VSFILE_ATTR_SYSTEM | VSFILE_ATTR_HIDDEN,
	ifs->fakefat32_fs.SVI_dir[2].memfile.f.buff = (uint8_t *)Win10_IndexerVolumeGuid;
	ifs->fakefat32_fs.SVI_dir[3].memfile.file.name = "WPSettings.dat";
	ifs->fakefat32_fs.SVI_dir[3].memfile.file.size = sizeof(Win10_WPSettings_dat);
	ifs->fakefat32_fs.SVI_dir[3].memfile.file.attr = VSFILE_ATTR_ARCHIVE | VSFILE_ATTR_READONLY | VSFILE_ATTR_SYSTEM | VSFILE_ATTR_HIDDEN,
	ifs->fakefat32_fs.SVI_dir[3].memfile.f.buff = (uint8_t *)Win10_WPSettings_dat;

	ifs->fakefat32_fs.root_dir[0].memfile.file.name = "VSFDriver";
	ifs->fakefat32_fs.root_dir[0].memfile.file.attr = VSFILE_ATTR_VOLUMID;
	ifs->fakefat32_fs.root_dir[1].memfile.file.name = "LOST.DIR";
	ifs->fakefat32_fs.root_dir[1].memfile.file.attr = VSFILE_ATTR_DIRECTORY | VSFILE_ATTR_SYSTEM | VSFILE_ATTR_HIDDEN;
	ifs->fakefat32_fs.root_dir[1].memfile.d.child = (struct vsfile_memfile_t *)ifs->fakefat32_fs.LOSTDIR_dir;
	ifs->fakefat32_fs.root_dir[2].memfile.file.name = "$RECYCLE.BIN";
	ifs->fakefat32_fs.root_dir[2].memfile.file.attr = VSFILE_ATTR_DIRECTORY | VSFILE_ATTR_SYSTEM | VSFILE_ATTR_HIDDEN;
	ifs->fakefat32_fs.root_dir[2].memfile.d.child = (struct vsfile_memfile_t *)ifs->fakefat32_fs.RECYCLEBIN_dir;
	ifs->fakefat32_fs.root_dir[3].memfile.file.name = "System Volume Information";
	ifs->fakefat32_fs.root_dir[3].memfile.file.attr = VSFILE_ATTR_DIRECTORY | VSFILE_ATTR_SYSTEM | VSFILE_ATTR_HIDDEN;
	ifs->fakefat32_fs.root_dir[3].memfile.d.child = (struct vsfile_memfile_t *)ifs->fakefat32_fs.SVI_dir;
	ifs->fakefat32_fs.root_dir[4].memfile.file.name = "Driver";
	ifs->fakefat32_fs.root_dir[4].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.root_dir[4].memfile.d.child = (struct vsfile_memfile_t *)ifs->fakefat32_fs.Driver_dir;

	// init fakefat32
	ifs->mal.fakefat32.sector_size = 512;
	ifs->mal.fakefat32.sector_number = 0x1000;
	ifs->mal.fakefat32.sectors_per_cluster = 8;
	ifs->mal.fakefat32.volume_id = 0xDEADBEEF;
	ifs->mal.fakefat32.disk_id = 0xBABECAFE;
	ifs->mal.fakefat32.root[0].memfile.file.name = "ROOT";
	ifs->mal.fakefat32.root[0].memfile.d.child = (struct vsfile_memfile_t *)ifs->fakefat32_fs.root_dir,

	// init mal
	ifs->mal.mal.drv = &fakefat32_mal_drv;
	ifs->mal.mal.param = &ifs->mal.fakefat32;
	ifs->mal.pbuffer[0] = ifs->mal.buffer[0];
	ifs->mal.pbuffer[1] = ifs->mal.buffer[1];

	// init file
	ifs->fs.memop.alloc_vfs = vsfos_vsfile_alloc_vfs;
	ifs->fs.memop.free_vfs = vsfos_vsfile_free_vfs;
//.........这里部分代码省略.........
开发者ID:hank-fan,项目名称:vsf,代码行数:101,代码来源:vsfos.c

示例2: dimof

    {VX_BIDIRECTIONAL, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
};


static vx_param_description_t accumulate_scaled_kernel_params[] = {
    {VX_INPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
    {VX_INPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_REQUIRED},
    {VX_BIDIRECTIONAL, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
};


vx_kernel_description_t accumulate_kernel = {
    VX_KERNEL_ACCUMULATE,
    "org.khronos.openvx.accumulate",
    vxAccumulateKernel,
    accumulate_kernel_params, dimof(accumulate_kernel_params),
    vxAccumulateInputValidator,
    vxAccumulateOutputValidator,
    NULL,
    NULL,
};

vx_kernel_description_t accumulate_weighted_kernel = {
    VX_KERNEL_ACCUMULATE_WEIGHTED,
    "org.khronos.openvx.accumulate_weighted",
    vxAccumulateWeightedKernel,
    accumulate_scaled_kernel_params, dimof(accumulate_scaled_kernel_params),
    vxAccumulateWeightedInputValidator,
    vxAccumulateOutputValidator,
    NULL,
    NULL,
开发者ID:flowyard,项目名称:FlowVX,代码行数:31,代码来源:vx_accumulate.c

示例3: vxHarrisDeinitializer

            }
        }
    }
    return status;
}

static vx_status VX_CALLBACK vxHarrisDeinitializer(vx_node node, vx_reference *parameters, vx_uint32 num)
{
    vx_status status = VX_ERROR_INVALID_PARAMETERS;
    if (num == dimof(harris_kernel_params))
    {
        vx_graph graph = vxGetChildGraphOfNode(node);
        vxReleaseGraph(&graph);
        /* set graph to "null" */
        vxSetChildGraphOfNode(node, 0);
        status = VX_SUCCESS;
    }
    return status;
}

vx_kernel_description_t harris_kernel = {
    VX_KERNEL_HARRIS_CORNERS,
    "org.khronos.openvx.harris_corners",
    vxHarrisCornersKernel,
    harris_kernel_params, dimof(harris_kernel_params),
    vxHarrisInputValidator,
    vxHarrisOutputValidator,
    vxHarrisInitializer,
    vxHarrisDeinitializer,
};
开发者ID:flowyard,项目名称:FlowVX,代码行数:30,代码来源:vx_harris.c

示例4: dimof

//-----------------------------------------------------------------------------
//
// header files
//
//-----------------------------------------------------------------------------

#include "bsp.h"
#include "ceddkex.h"
#include "sdk_gpio.h"
#include "bsp_padcfg.h"
#include "sdk_padcfg.h"
#include "oalex.h"

DWORD g_GPIOId[] = {NOTIFICATION_LED_GPIO};
DWORD g_GPIOActiveState[dimof(g_GPIOId)] = {0};
DWORD g_dwNbLeds = dimof(g_GPIOId);
BOOL g_LastLEDIsVibrator = FALSE;

static const PAD_INFO LedPinMux[] = {
    WKUP_PAD_ENTRY(SYS_BOOT6,   INPUT_DISABLED | PULL_RESISTOR_DISABLED | MUXMODE(4)) \
    END_OF_PAD_ARRAY
    };


int NLedCpuFamily = -1;

BOOL NLedBoardInit()
{  
    if (NLedCpuFamily == -1)
    {
开发者ID:zizilala,项目名称:projects_wince_AA,代码行数:30,代码来源:nled.c

示例5: keyName

static WCHAR *GetGhostscriptPath()
{
    WCHAR *gsProducts[] = {
        L"AFPL Ghostscript",
        L"Aladdin Ghostscript",
        L"GPL Ghostscript",
        L"GNU Ghostscript",
    };

    // find all installed Ghostscript versions
    WStrVec versions;
    REGSAM access = KEY_READ | KEY_WOW64_32KEY;
TryAgain64Bit:
    for (int i = 0; i < dimof(gsProducts); i++) {
        HKEY hkey;
        ScopedMem<WCHAR> keyName(str::Join(L"Software\\", gsProducts[i]));
        if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyName, 0, access, &hkey) != ERROR_SUCCESS)
            continue;
        WCHAR subkey[32];
        for (DWORD ix = 0; RegEnumKey(hkey, ix, subkey, dimof(subkey)) == ERROR_SUCCESS; ix++)
            versions.Append(str::Dup(subkey));
        RegCloseKey(hkey);
    }
    if ((access & KEY_WOW64_32KEY)) {
        // also look for 64-bit Ghostscript versions under 64-bit Windows
        access = KEY_READ | KEY_WOW64_64KEY;
#ifndef _WIN64
        // (unless this is 32-bit Windows)
        if (IsRunningInWow64())
#endif
        goto TryAgain64Bit;
    }
    versions.SortNatural();

    // return the path to the newest installation
    for (size_t ix = versions.Count(); ix > 0; ix--) {
        for (int i = 0; i < dimof(gsProducts); i++) {
            ScopedMem<WCHAR> keyName(str::Format(L"Software\\%s\\%s",
                                                 gsProducts[i], versions.At(ix - 1)));
            ScopedMem<WCHAR> GS_DLL(ReadRegStr(HKEY_LOCAL_MACHINE, keyName, L"GS_DLL"));
            if (!GS_DLL)
                continue;
            ScopedMem<WCHAR> dir(path::GetDir(GS_DLL));
            ScopedMem<WCHAR> exe(path::Join(dir, L"gswin32c.exe"));
            if (file::Exists(exe))
                return exe.StealData();
            exe.Set(path::Join(dir, L"gswin64c.exe"));
            if (file::Exists(exe))
                return exe.StealData();
        }
    }

    // if Ghostscript isn't found in the Registry, try finding it in the %PATH%
    DWORD size = GetEnvironmentVariable(L"PATH", NULL, 0);
    ScopedMem<WCHAR> envpath(AllocArray<WCHAR>(size));
    if (size > 0 && envpath) {
        GetEnvironmentVariable(L"PATH", envpath, size);
        WStrVec paths;
        paths.Split(envpath, L";", true);
        for (size_t ix = 0; ix < paths.Count(); ix++) {
            ScopedMem<WCHAR> exe(path::Join(paths.At(ix), L"gswin32c.exe"));
            if (file::Exists(exe))
                return exe.StealData();
            exe.Set(path::Join(paths.At(ix), L"gswin64c.exe"));
            if (file::Exists(exe))
                return exe.StealData();
        }
    }

    return NULL;
}
开发者ID:xuxiandi,项目名称:sumatrapdf,代码行数:71,代码来源:PsEngine.cpp

示例6: WriteAllUtf

bool WriteAllUtf(const char *filePath, const void *data, size_t dataLen)
{
    WCHAR buf[512];
    str::Utf8ToWcharBuf(filePath, str::Len(filePath), buf, dimof(buf));
    return WriteAll(buf, data, dataLen);
}
开发者ID:DavidWiberg,项目名称:sumatrapdf,代码行数:6,代码来源:FileUtil.cpp

示例7: dimof

    {"FOURCC_Y800",     T_FIXNUM, .value.l=FOURCC_Y800},
    {"FOURCC_UYVY",     T_FIXNUM, .value.l=FOURCC_UYVY},
    {"FOURCC_RGB",      T_FIXNUM, .value.l=FOURCC_RGB},
    {"FOURCC_Y16",      T_FIXNUM, .value.l=FOURCC_Y16},
    {"FOURCC_Y32",      T_FIXNUM, .value.l=FOURCC_Y32},
    {"FOURCC_NV12",     T_FIXNUM, .value.l=FOURCC_NV12},
};

static rext_const_t parameter_constants[] = {
    {"VX_INPUT",        T_FIXNUM, .value.l=VX_INPUT},
    {"VX_OUTPUT",       T_FIXNUM, .value.l=VX_OUTPUT},
    {"VX_BIDIRECTIONAL",T_FIXNUM, .value.l=VX_BIDIRECTIONAL},
};

static rext_object_t objects[] = {
    {0, &rb_cObject, "Reference", Reference_allocate, NULL, 0, NULL, 0, reference_methods, dimof(reference_methods)},
    {0, &rb_cObject, "Kernel", Kernel_allocate, NULL, 0, NULL, 0, kernel_methods, dimof(kernel_methods)},
    {0, &rb_cObject, "Graph", Graph_allocate, NULL, 0, NULL, 0, graph_methods, dimof(graph_methods)},
    {0, &rb_cObject, "Image", Image_allocate, NULL, 0, image_constants, dimof(image_constants), image_methods, dimof(image_methods)},
    {0, &rb_cObject, "Node", Node_allocate, NULL, 0, NULL, 0, node_methods, dimof(node_methods)},
    {0, &rb_cObject, "Parameter", Parameter_allocate, NULL, 0, parameter_constants, dimof(parameter_constants), parameter_methods, dimof(parameter_methods)},
    {0, &rb_cObject, "Buffer", Buffer_allocate, NULL, 0, NULL, 0, buffer_methods, dimof(buffer_methods)},
    {0, &rb_cObject, "Scalar", Scalar_allocate, NULL, 0, NULL, 0, scalar_methods, dimof(scalar_methods)},
    {0, &rb_cObject, "Target", Target_allocate, NULL, 0, NULL, 0, target_methods, dimof(target_methods)},
};

static rext_module_t modules[] = {
    {0, "OpenVX", NULL, 0, objects, dimof(objects), NULL, 0, openvx_global_methods, dimof(openvx_global_methods)},
};

//******************************************************************************
开发者ID:ofleischmann,项目名称:vision,代码行数:31,代码来源:vx_ruby.c

示例8: CrashIf

RectF TextRenderGdiplus::Measure(const char *s, size_t sLen) {
    CrashIf(!currFont);
    size_t strLen = str::Utf8ToWcharBuf(s, sLen, txtConvBuf, dimof(txtConvBuf));
    return MeasureText(gfx, currFont->font, txtConvBuf, strLen, measureAlgo);
}
开发者ID:Nargesf,项目名称:Sumatrapdf,代码行数:5,代码来源:TextRender.cpp

示例9: vxAddition

    if (num == 4)
    {
        vx_image in0 = (vx_image)parameters[0];
        vx_image in1 = (vx_image)parameters[1];
        vx_scalar policy_param = (vx_scalar)parameters[2];
        vx_image output = (vx_image)parameters[3];
        return vxAddition(in0, in1, policy_param, output);
    }
    return VX_ERROR_INVALID_PARAMETERS;
}

vx_kernel_description_t add_kernel = {
    VX_KERNEL_ADD,
    "org.khronos.openvx.add",
    vxAdditionKernel,
    add_subtract_kernel_params, dimof(add_subtract_kernel_params),
    vxAddSubtractInputValidator,
    vxAddSubtractOutputValidator,
    NULL,
    NULL,
};

static vx_status VX_CALLBACK vxSubtractionKernel(vx_node node, const vx_reference *parameters, vx_uint32 num)
{
    if (num == 4)
    {
        vx_image in0 = (vx_image)parameters[0];
        vx_image in1 = (vx_image)parameters[1];
        vx_scalar policy_param = (vx_scalar)parameters[2];
        vx_image output = (vx_image)parameters[3];
        return vxSubtraction(in0, in1, policy_param, output);
开发者ID:ChiahungTai,项目名称:clairvoyance,代码行数:31,代码来源:vx_addsub.c

示例10: VX_PRINT

    else
    {
        status = VX_ERROR_INVALID_PARAMETERS;
    }
    VX_PRINT(VX_ZONE_API, "%s:%u returned %d\n", __FUNCTION__, index, status);
    return status;
}


/*! \brief Declares the parameter types for \ref vxuColorConvert.
 * \ingroup group_implementation
 */
static vx_param_description_t channel_extract_kernel_params[] = {
    {VX_INPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
    {VX_INPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_REQUIRED},
    {VX_OUTPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
};

/*! \brief The exported kernel table entry */
vx_kernel_description_t channelextract_kernel = {
    VX_KERNEL_CHANNEL_EXTRACT,
    "org.khronos.openvx.channel_extract",
    vxChannelExtractKernel,
    channel_extract_kernel_params, dimof(channel_extract_kernel_params),
    vxChannelExtractInputValidator,
    vxChannelExtractOutputValidator,
    NULL,
    NULL,
};

开发者ID:ChiahungTai,项目名称:clairvoyance,代码行数:29,代码来源:vx_channelextract.c

示例11: thread_unittest

bool_e thread_unittest(int argc, char *argv[])
{
    uint32_t i, counter = 10;
    pingpongevent_t events;
    int numErrors = 0;
    bool_e verbose = false_e;
    option_t hash_opts[] = {
        {OPTION_TYPE_BOOL, &verbose, sizeof(bool_e), "-v", "--verbose", "Used to print out debugging information"},
    };
    msg_t msgs[] = {{3}, {9283}, {27}, {42}}; // last value == TEST_RET_VALUE
    msg_thread_t msgt;
    thread_t t;
    thread_ret_t r;

    option_process(argc, argv, hash_opts, dimof(hash_opts));

    if (verbose) {
        SOSAL_PRINT(SOSAL_ZONE_THREAD, "===THREAD TEST===\n");
    }

    // simple start, stop test
    t = thread_create(thread_test, &counter);
    r = thread_join(t);
    if (r != TEST_RET_VALUE)
        numErrors++;

    if (verbose) {
        SOSAL_PRINT(SOSAL_ZONE_THREAD, "===PING PONG TEST===\n");
    }

    // event test across threads
    event_init(&events.ping, false_e);
    event_init(&events.pong, false_e);

    t = thread_create(thread_test_events, &events);
    if (verbose) {
        SOSAL_PRINT(SOSAL_ZONE_THREAD, "Test is waiting for thread to wakeup!\n");
    }
    if (event_wait(&events.ping, 500))
    {
        if (verbose)
            SOSAL_PRINT(SOSAL_ZONE_THREAD, "Received Event from Thread!\n");
    }
    else
    {
        if (verbose)
            SOSAL_PRINT(SOSAL_ZONE_THREAD, "ERROR! Thread Message Timedout!\n");
    }
    if (verbose) SOSAL_PRINT(SOSAL_ZONE_THREAD, "Sending Event to Thread!\n");

    event_set(&events.pong);

    r = thread_join(t);
    SOSAL_PRINT(SOSAL_ZONE_THREAD, "=== THREAD JOIN exit = "THREAD_RET_FMT" ===\n", r);
    if (r != TEST_RET_VALUE)
        numErrors++;
    event_deinit(&events.ping);
    event_deinit(&events.pong);

    if (verbose) {
        SOSAL_PRINT(SOSAL_ZONE_THREAD, "===QUEUE TEST===\n");
    }

    msgt.msgs = queue_create(2, sizeof(msg_t));
    msgt.running = true_e;
    event_init(&msgt.signal, false_e);
    t = thread_create(thread_test_msgs, &msgt);
    if (verbose)
    {
        SOSAL_PRINT(SOSAL_ZONE_THREAD, "Waiting for thread to start!\n");
        SOSAL_PRINT(SOSAL_ZONE_THREAD, "Thread Started?(%s!)\n", (event_wait(&msgt.signal, 1000)?"true":"false"));
    }
    for (i = 0; i < dimof(msgs); i++) {
        if (queue_write(msgt.msgs, true_e, &msgs[i]) == false_e) {
            SOSAL_PRINT(SOSAL_ZONE_ERROR, "ERROR! Failed to write to queue!\n");
        } else {
            if (verbose) SOSAL_PRINT(SOSAL_ZONE_THREAD, "Wrote message "FMT_SIZE_T" to the Queue!\n", msgs[i].code);
        }
    }
    r = thread_join(t);
    SOSAL_PRINT(SOSAL_ZONE_THREAD, "=== THREAD JOIN exit = "THREAD_RET_FMT" ===\n", r);
    queue_destroy(msgt.msgs);
    event_deinit(&msgt.signal);

    if (verbose) {
        SOSAL_PRINT(SOSAL_ZONE_THREAD, "===THREAD TEST EXIT Errors=%d ===\n", numErrors);
    }

    if (numErrors > 0)
        return false_e;
    else
        return true_e;
}
开发者ID:aosp,项目名称:dvp,代码行数:93,代码来源:thread.c

示例12: DMA_Init

//------------------------------------------------------------------------------
//
//  Function:  DMA_Init
//
//  Called by device manager to initialize device.
//
DWORD
DMA_Init(
    LPCWSTR szContext, 
    LPCVOID pBusContext
    )
{
    DWORD rc = (DWORD)NULL;

    UNREFERENCED_PARAMETER(pBusContext);
    UNREFERENCED_PARAMETER(szContext);

    DEBUGMSG(ZONE_FUNCTION, (
        L"+DMA_Init(%s, 0x%08x)\r\n", szContext, pBusContext
        ));

    // Create device structure
    Device_t *pDevice = (Device_t *)LocalAlloc(LPTR, sizeof(Device_t));
    if (pDevice == NULL)
        {
        DEBUGMSG(ZONE_ERROR, (L"ERROR: DMA_Init: "
            L"Failed allocate DMA controller structure\r\n"
            ));
        goto cleanUp;
        }

    // initialize memory
    memset(pDevice, 0, sizeof(Device_t));

    // Set cookie
    pDevice->cookie = DMA_DEVICE_COOKIE;

    // Initalize critical section
    InitializeCriticalSection(&pDevice->cs);

    // Read device parameters
    if (GetDeviceRegistryParams(
            szContext, pDevice, dimof(s_deviceRegParams), s_deviceRegParams
            ) != ERROR_SUCCESS)
        {
        DEBUGMSG(ZONE_ERROR, (L"ERROR: DMA_Init: "
            L"Failed read DMA driver registry parameters\r\n"
            ));
        goto cleanUp;
        }
        
	// Retrieve device ID
    pDevice->SdmaDevice = SOCGetDMADevice(pDevice->SdmaIndex);
    
    // Set hardware to full power
	EnableDeviceClocks(pDevice->SdmaDevice, TRUE);
    
    // DMA will be in smart idle mode so we don't need to
    // ever set the power state of the DMA to D4

    // initialize general dma controller
    if (InitializeDevice(pDevice) == FALSE)
        {
        DEBUGMSG (ZONE_ERROR, (L"ERROR: DMA_Init: "
            L"Failed to initialize device\r\n"
            ));
        goto cleanUp;        
        }

    rc = (DWORD)pDevice;
    
cleanUp:
    if (rc == 0) DMA_Deinit((DWORD)pDevice);
    DEBUGMSG(ZONE_FUNCTION, (L"-DMA_Init(rc = %d)\r\n", rc));
    return rc;
}
开发者ID:zizilala,项目名称:projects_etest,代码行数:76,代码来源:dma.cpp

示例13: dimof

    {
        ptr->dim.scalar.type = VX_TYPE_UINT32;
        status = VX_SUCCESS;
    }
    return status;
}

static vx_param_description_t minmaxloc_kernel_params[] = {
    {VX_INPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
    {VX_OUTPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_OPTIONAL},
    {VX_OUTPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_OPTIONAL},
    {VX_OUTPUT, VX_TYPE_ARRAY, VX_PARAMETER_STATE_OPTIONAL},
    {VX_OUTPUT, VX_TYPE_ARRAY, VX_PARAMETER_STATE_OPTIONAL},
    {VX_OUTPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_OPTIONAL},
    {VX_OUTPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_OPTIONAL},
};

vx_kernel_description_t minmaxloc_kernel = {
    VX_KERNEL_MINMAXLOC,
    "org.khronos.openvx.minmaxloc",
    vxMinMaxLocKernel,
    minmaxloc_kernel_params, dimof(minmaxloc_kernel_params),
    NULL,
    vxMinMaxLocInputValidator,
    vxMinMaxLocOutputValidator,
    NULL,
    NULL,
};


开发者ID:eric100lin,项目名称:My-OpenVX-1.1,代码行数:28,代码来源:vx_minmaxloc.c

示例14: dimof

    {VX_INPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
    {VX_OUTPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
};

static vx_param_description_t euclidean_non_max_suppression_harris_params[] = {
    {VX_INPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
    {VX_INPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_REQUIRED}, /* strength_thresh */
    {VX_INPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_REQUIRED}, /* min_distance */
    {VX_OUTPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
};

vx_kernel_description_t nonmax_kernel = {
    VX_KERNEL_EXTRAS_NONMAXSUPPRESSION,
    "org.khronos.extra.nonmaximasuppression",
    vxNonMaxSuppressionKernel,
    nonmaxsuppression_params, dimof(nonmaxsuppression_params),
    vxNonMaxSuppressionInputValidator,
    vxNonMaxSuppressionOutputValidator,
    NULL,
    NULL,
};

vx_kernel_description_t euclidian_nonmax_harris_kernel = {
    VX_KERNEL_EXTRAS_EUCLIDEAN_NONMAXSUPPRESSION_HARRIS,
    "org.khronos.extra.euclidean_nonmaxsuppression_harris",
    vxEuclideanNonMaxSuppressionHarrisKernel,
    euclidean_non_max_suppression_harris_params, dimof(euclidean_non_max_suppression_harris_params),
    vxEuclideanNonMaxHarrisInputValidator,
    vxEuclideanNonMaxHarrisOutputValidator,
    NULL,
    NULL,
开发者ID:ChiahungTai,项目名称:clairvoyance,代码行数:31,代码来源:vx_nonmax.c

示例15: dimof

void TextRenderHdc::Draw(const char *s, size_t sLen, RectF& bb, bool isRtl) {
    size_t strLen = str::Utf8ToWcharBuf(s, sLen, txtConvBuf, dimof(txtConvBuf));
    return Draw(txtConvBuf, strLen, bb, isRtl);
}
开发者ID:Nargesf,项目名称:Sumatrapdf,代码行数:4,代码来源:TextRender.cpp


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