本文整理汇总了C++中freeData函数的典型用法代码示例。如果您正苦于以下问题:C++ freeData函数的具体用法?C++ freeData怎么用?C++ freeData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了freeData函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: freeData
OCSPClientCertID::~OCSPClientCertID()
{
freeData(mIssuerName);
freeData(mIssuerPubKey);
freeData(mSubjectSerial);
freeData(mEncoded);
}
开发者ID:aosm,项目名称:libsecurity_ocspd,代码行数:7,代码来源:ocspResponse.cpp
示例2: freeData
int gWaveform::alloc(int datasize) {
ratio = chan->wave->size / (float) datasize;
if (ratio < 2)
return 0;
freeData();
data.size = datasize;
data.sup = (int*) malloc(data.size * sizeof(int));
data.inf = (int*) malloc(data.size * sizeof(int));
int offset = h() / 2;
int zero = y() + offset; // center, zero amplitude (-inf dB)
for (int i=0; i<data.size; i++) {
int pp; // point prev
int pn; // point next
/* resampling the waveform, hardcore way. Many thanks to
* http://fourier.eng.hmc.edu/e161/lectures/resize/node3.html
* Note: we use
* p = j * (m-1 / n)
* instead of
* p = j * (m-1 / n-1)
* in order to obtain 'datasize' cells to parse (and not datasize-1) */
pp = i * ((chan->wave->size - 1) / (float) datasize);
pn = (i+1) * ((chan->wave->size - 1) / (float) datasize);
if (pp % 2 != 0) pp -= 1;
if (pn % 2 != 0) pn -= 1;
float peaksup = 0.0f;
float peakinf = 0.0f;
int k = pp;
while (k < pn) {
if (chan->wave->data[k] > peaksup)
peaksup = chan->wave->data[k]; // Left data only
else
if (chan->wave->data[k] <= peakinf)
peakinf = chan->wave->data[k]; // Left data only
k += 2;
}
data.sup[i] = zero - (peaksup * chan->boost * offset);
data.inf[i] = zero - (peakinf * chan->boost * offset);
// avoid window overflow
if (data.sup[i] < y()) data.sup[i] = y();
if (data.inf[i] > y()+h()-1) data.inf[i] = y()+h()-1;
}
recalcPoints();
return 1;
}
开发者ID:micahscopes,项目名称:giada,代码行数:60,代码来源:ge_waveform.cpp
示例3: tvRefcountedDecRef
BaseVector::~BaseVector() {
for (uint i = 0; i < m_size; ++i) {
tvRefcountedDecRef(&m_data[i]);
}
freeData();
}
开发者ID:Diego-Brocanelli,项目名称:hhvm,代码行数:7,代码来源:base_vector.cpp
示例4: freeData
void NNRegressionFactory::deserialize( Object *parent , SerializeObject& so )
{
freeData();
vars = ( NNVariables * )so.getPropObject( "variables" , true );
nPerceptronIDLast = so.getPropInt( "nPerceptronIDLast" );
}
开发者ID:sarbjit-longia,项目名称:ahuman,代码行数:7,代码来源:nnregressionfactory.cpp
示例5: XOJ_CHECK_TYPE
void PagePositionHandler::update(PageView** viewPages, int viewPagesLen,
int maxY)
{
XOJ_CHECK_TYPE(PagePositionHandler);
freeData();
this->maxY = maxY;
PagePosition* lastPp = new PagePosition();
addData(lastPp);
for (int i = 0; i < viewPagesLen; i++)
{
PageView* pv = viewPages[i];
if (!lastPp->add(pv))
{
PagePosition* pp = new PagePosition(pv);
lastPp->y2 = pp->y1 - 1;
lastPp = pp;
addData(pp);
}
}
PagePosition* pp = new PagePosition();
pp->y1 = lastPp->y2 + 1;
pp->y2 = maxY;
addData(pp);
}
开发者ID:cass00,项目名称:xournalpp,代码行数:31,代码来源:PagePositionHandler.cpp
示例6: main
int main() {
struct node_t *list = NULL;
/* Create a long singly-linked list with optional data.
*/
int dataNotFinished = 0;
do {
append(&list);
} while(__VERIFIER_nondet_int());
/*
Do something with data.
displayData();
*/
// free list and data
while (list) {
struct node_t *next = list->next;
freeData(list->data);
free(list);
list = next;
}
return 0;
}
开发者ID:Heizmann,项目名称:sv-benchmarks,代码行数:27,代码来源:optional_data_creation_test04_true-valid-memsafety.c
示例7: freeData
bool BitmapData::loadTGA(Common::SeekableReadStream *data) {
Image::TGADecoder dec;
bool success = dec.loadStream(*data);
if (!success)
return false;
const Graphics::Surface *origSurf = dec.getSurface();
Graphics::PixelFormat pixelFormat = Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24);
Graphics::Surface *surf = origSurf->convertTo(pixelFormat);
_width = surf->w;
_height = surf->h;
_format = 1;
_x = _y = 0;
_bpp = 4;
_colorFormat = BM_RGBA;
_numImages = 1;
_data = new Graphics::PixelBuffer[1];
_data[0].set(pixelFormat, (unsigned char *)surf->getPixels());
g_driver->createBitmap(this);
freeData();
delete surf;
return true;
}
开发者ID:Akz-,项目名称:residual,代码行数:28,代码来源:bitmap.cpp
示例8: ashmem_get_size_region
void ProfileDataContainer::switchStorageToAshmem(int ashmemfd) {
int regionSize = ashmem_get_size_region(ashmemfd);
if (regionSize < 0) {
int err = errno;
ALOGW("Failed to get ashmem region size from fd %d, err %d %s", ashmemfd, err,
strerror(err));
return;
}
if (regionSize < static_cast<int>(sizeof(ProfileData))) {
ALOGW("Ashmem region is too small! Received %d, required %u", regionSize,
static_cast<unsigned int>(sizeof(ProfileData)));
return;
}
ProfileData* newData = reinterpret_cast<ProfileData*>(
mmap(NULL, sizeof(ProfileData), PROT_READ | PROT_WRITE, MAP_SHARED, ashmemfd, 0));
if (newData == MAP_FAILED) {
int err = errno;
ALOGW("Failed to move profile data to ashmem fd %d, error = %d", ashmemfd, err);
return;
}
newData->mergeWith(*mData);
freeData();
mData = newData;
mIsMapped = true;
}
开发者ID:AlanCheen,项目名称:platform_frameworks_base,代码行数:26,代码来源:ProfileDataContainer.cpp
示例9: freeData
//-----------------------------------------------------------------------------
Image & Image::operator = ( const Image &img )
{
freeData();
m_uWidth = img.m_uWidth;
m_uHeight = img.m_uHeight;
m_uDepth = img.m_uDepth;
m_eFormat = img.m_eFormat;
m_uSize = img.m_uSize;
m_uFlags = img.m_uFlags;
m_ucPixelSize = img.m_ucPixelSize;
m_uNumMipmaps = img.m_uNumMipmaps;
m_bAutoDelete = img.m_bAutoDelete;
//Only create/copy when previous data was not dynamic data
if( m_bAutoDelete )
{
m_pBuffer = new uchar[ m_uSize ];
memcpy( m_pBuffer, img.m_pBuffer, m_uSize );
}
else
{
m_pBuffer = img.m_pBuffer;
}
return *this;
}
开发者ID:brock7,项目名称:TianLong,代码行数:27,代码来源:OgreImage.cpp
示例10: freeData
void CppVariant::set(const NPVariant& newValue)
{
freeData();
switch (newValue.type) {
case NPVariantType_Bool:
set(newValue.value.boolValue);
break;
case NPVariantType_Int32:
set(newValue.value.intValue);
break;
case NPVariantType_Double:
set(newValue.value.doubleValue);
break;
case NPVariantType_String:
set(newValue.value.stringValue);
break;
case NPVariantType_Null:
case NPVariantType_Void:
type = newValue.type;
break;
case NPVariantType_Object:
set(newValue.value.objectValue);
break;
}
}
开发者ID:fmalita,项目名称:webkit,代码行数:25,代码来源:CppVariant.cpp
示例11: createTestSummary
void createTestSummary(char *baseFileName) {
lineStruct **tests;
uint numTests;
tests = gatherTests(baseFileName, numTests);
printTestsSummary(numTests, tests, baseFileName);
freeData(tests, numTests);
}
开发者ID:qq101,项目名称:ggks-multiSelect,代码行数:7,代码来源:readOutputfile.cpp
示例12: freeData
CFile::~CFile(){
if(mStream){
mStream->flush();
delete mStream;
}
freeData();
}
开发者ID:harkal,项目名称:sylphis3d,代码行数:7,代码来源:vfs.cpp
示例13: main
int main(int argc, char **argv)
{
exitCode = 0;
initGtk(&argc, &argv);
migrateConfigToXdgDir();
migrateThemesToXdgDir();
initDataDefault();
if (parseCommandline(&argc, &argv)) {
if(initLockFile()) {
printMessage(MSG_INFO, "Startup %s %s (-h to print usage)\n", OBS_NAME, OBS_VERSION);
if (initConfigs()) {
initWidgets();
gtk_widget_show_all(winWidget);
gtk_main();
}
else
exitCode = 1;
deleteLockFile();
}
else
exitCode = 1;
}
else
exitCode = 1;
freeData();
exit(exitCode);
}
开发者ID:Anon1234,项目名称:obshutdown,代码行数:32,代码来源:main.c
示例14: stratBranch
int stratBranch (void *branchpoint, void **newbranch, size_t *size) {
tsp_t *bp = (tsp_t *)branchpoint;
*size = sizeof (tsp_t *);
// Find number of children
int *degre = (int *) calloc (bp->nb_node, sizeof (int)), i, j;
for (i=0; i<bp->nb_node; i++) {
degre[bp->sol[i]/bp->nb_node]++;
degre[bp->sol[i]%bp->nb_node]++;
}
int max = 0, ind_max = 0;
for (i=0; i<bp->nb_node; i++)
if (degre[i] > max) {
max = degre[i];
ind_max = i;
}
if (max <= 2) {
free (degre);
return 0;
}
int *nodes = (int *) malloc (sizeof(int) * max);
int zz = 0;
for (i=0; i<bp->nb_node; i++) {
if (bp->sol[i]/bp->nb_node == ind_max)
nodes[zz++] = bp->sol[i]%bp->nb_node;
else if (bp->sol[i]%bp->nb_node == ind_max)
nodes[zz++] = bp->sol[i]/bp->nb_node;
}
tsp_t **nb = (tsp_t **) malloc (max * sizeof(tsp_t *));
tsp_t *tmp;
for (i=0; i< max; i++) {
tmp = (tsp_t *) malloc (sizeof(tsp_t));
tmp->nb_node = bp->nb_node;
tmp->sol = (int *) malloc (bp->nb_node * sizeof(int));
tmp->mat = (int **) malloc (sizeof(int*) *bp->nb_node);
for (j=0; j<bp->nb_node; tmp->mat[j++] = (int *) malloc (sizeof(int)*bp->nb_node));
copyData(tmp, bp);
tmp->mat[nodes[i]][ind_max] = -1;
tmp->mat[ind_max][nodes[i]] = -1;
if (compPartSolFromACPM(tmp, 0))
nb[i] = tmp;
else {
i--;
max--;
freeData(tmp);
}
}
*newbranch = nb;
free (degre);
free(nodes);
// free(nb);
return max;
}
开发者ID:Origraena,项目名称:moca,代码行数:59,代码来源:tsp.c
示例15: freeData
void mhwd::fillData(mhwd::Data *data) {
freeData(data);
fillDevices(data, mhwd::TYPE_PCI);
fillDevices(data, mhwd::TYPE_USB);
updateConfigData(data);
}
开发者ID:Acidburn0zzz,项目名称:mhwd,代码行数:8,代码来源:mhwd.cpp
示例16: freeData
void MemoryObject2::copyData(byte *src, int dataSize) {
if (_data)
freeData();
_dataSize = dataSize;
_data = (byte *)malloc(dataSize);
memcpy(_data, src, _dataSize);
}
开发者ID:DrItanium,项目名称:scummvm,代码行数:9,代码来源:utils.cpp
示例17: reset
int reset(AVFormatContext* formatCtx)
{
freeData();
int result = av_read_frame(formatCtx, &packet);
if (result < 0)
packet.data = nullptr;
return result;
}
开发者ID:Orange-7,项目名称:SimpleVideoInput,代码行数:9,代码来源:SimpleVideoInput.cpp
示例18: SecureStorage_FreeStorage
void SecureStorage_FreeStorage(void *s) {
SecureStorageS *storage = NULL;
if (s == NULL) return;
storage = (SecureStorageS *)s;
Utils_Free(storage->caSalt);
Utils_Free(storage->caSecret);
freeData(storage->Data);
}
开发者ID:ibm-security-innovation,项目名称:libsecurity-c,代码行数:9,代码来源:secureStorage.c
示例19: queue_delete
void queue_delete(Queue* file)
{
if(file == NULL)
return;
freeData(file->data);
free(file);
file = NULL;
}
开发者ID:Moumou38,项目名称:ITD,代码行数:9,代码来源:queue.c
示例20: writeUnwrittenDiffs
static int writeUnwrittenDiffs(){
int status = updateDb(POLL_INTERVAL, unwrittenDiffs);
logData(unwrittenDiffs);
freeData(unwrittenDiffs);
unwrittenDiffs = NULL;
return status;
}
开发者ID:JackWangCUMT,项目名称:bitmeteros,代码行数:9,代码来源:process.c
注:本文中的freeData函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论