示例#1
0
const SubsystemInfoLookup *
SubsystemInfoTable::getValidEntry( int num ) const
{
	const SubsystemInfoLookup *entry = getEntry( num );
	if ( ! entry->isValid() ) {
		return NULL;
	}
	return entry;
}
示例#2
0
bool Settings::getEntryNoEx(const std::string &name, SettingsEntry &val) const
{
	try {
		val = getEntry(name);
		return true;
	} catch (SettingNotFoundException &e) {
		return false;
	}
}
示例#3
0
文件: queue.cpp 项目: singron/scummvm
uint32 SoundQueue::getEntryTime(EntityIndex index) {
	Common::StackLock locker(_mutex);

	SoundEntry *entry = getEntry(index);
	if (entry)
		return entry->getTime();

	return 0;
}
示例#4
0
文件: queue.cpp 项目: singron/scummvm
void SoundQueue::processEntry(EntityIndex entity) {
	Common::StackLock locker(_mutex);

	SoundEntry *entry = getEntry(entity);
	if (entry) {
		entry->update(0);
		entry->setEntity(kEntityPlayer);
	}
}
示例#5
0
文件: queue.cpp 项目: singron/scummvm
void SoundQueue::processEntry(Common::String filename) {
	Common::StackLock locker(_mutex);

	SoundEntry *entry = getEntry(filename);
	if (entry) {
		entry->update(0);
		entry->setEntity(kEntityPlayer);
	}
}
示例#6
0
//---------------------------------------------
const char* ModuleRegistry::getModuleURI(unsigned int uIdx) const
{
  const_iterator it = getEntry(uIdx);
  if(it == m_registeredModules.end())
  {
    return NULL;  
  }
  return it->first.c_str();
}
示例#7
0
//---------------------------------------------
ModuleRegistry::tModuleFactory ModuleRegistry::getModuleFactory(unsigned int uIdx) const
{
  const_iterator it = getEntry(uIdx);
  if(it == m_registeredModules.end())
  {
    return NULL;
  }
  return it->second;
}
示例#8
0
// -----------------------------------------------------------------------------
// Returns all entries matching the search criteria in [options]
// -----------------------------------------------------------------------------
vector<ArchiveEntry*> GZipArchive::findAll(SearchOptions& options)
{
	// Init search variables
	options.match_name = options.match_name.Lower();
	vector<ArchiveEntry*> ret;
	if (findFirst(options))
		ret.push_back(getEntry(0));
	return ret;
}
示例#9
0
void    BandMatrix::printBandMatrix() {
    printf( "Printing Matrix : %d %d %d\n", _matDim, _lowerBand, _upperBand );
    for( dim_t row = 0; row < _matDim; row++ ) {
        for( dim_t col = 0; col < _matDim; col++ ) {
            printf( "%10.1e", getEntry( row, col ) );
        }
        printf( "\n" );
    }
}
示例#10
0
文件: file.c 项目: 00001/plan9port
/* assumes hold elk */
int
fileSnapshot(File *dst, File *src, u32int epoch, int doarchive)
{
	Entry e, ee;

	/* add link to snapshot */
	if(!getEntry(src->source, &e, 1) || !getEntry(src->msource, &ee, 1))
		return 0;

	e.snap = epoch;
	e.archive = doarchive;
	ee.snap = epoch;
	ee.archive = doarchive;

	if(!setEntry(dst->source, &e) || !setEntry(dst->msource, &ee))
		return 0;
	return 1;
}
void StandardDatabaseManager::addRewindButtons()
{
  StandardDbEntry* entry = (StandardDbEntry*)getEntry();

  //
  // Map default rewind buttons (if enabled)
  //
  if( getEmulator().isRewindSupported() && 
      wii_rewind &&
      wii_rewind_add_buttons )
  {
    int i, j;
    int profileCount = getProfileCount();  
    for( int x = 0; x < profileCount; x++ )
    {
      int rewindButtonValue = -1;
      for( i = 0; i < getMappableButtonCount( x ); i++ )
      {
        if( getMappableButton( x, i )->button == BTN_REWIND )
        {
          rewindButtonValue = i; 
          break;
        }
      }

      if( rewindButtonValue == -1 )
      {
        // No rewind button for profile?
        continue;
      }

      for( i = 0; i < WII_CONTROLLER_COUNT; i++ )
      {
        bool rewindMapped = false;
        for( j = 0; j < WII_MAP_BUTTON_COUNT && !rewindMapped; j++ )
        {
          rewindMapped = ( entry->buttonMap[x][i][j] == rewindButtonValue );
        }

        if( !rewindMapped )
        {
          u32 btnValue = getDefaultRewindButton( x, i );
          for( int j = 0; j < WII_MAP_BUTTON_COUNT; j++ )
          {
            const WiiButton* btn = getMappedButton( x, i, j );
            if( btn->button == btnValue )
            {
              entry->buttonMap[x][i][j] = rewindButtonValue;
              break;
            }
          }
        }
      }
    }
  }
}
示例#12
0
文件: queue.cpp 项目: singron/scummvm
bool SoundQueue::isBuffered(Common::String filename, bool testForEntity) {
	Common::StackLock locker(_mutex);

	SoundEntry *entry = getEntry(filename);

	if (testForEntity)
		return entry != NULL && entry->getEntity() != kEntityPlayer;

	return (entry != NULL);
}
示例#13
0
void Config::getOption(const s8 *key, u32 &val)
{
	OptionEntry *entry = getEntry(key);
	if (!entry || !entry->val) return;

	s8 *tail;
	s32 a = strtol(entry->val, &tail, 10);

	if (!*tail) val = a;
}
示例#14
0
RawImage PefDecoder::decodeRawInternal() {
  auto raw = mRootIFD->getIFDWithTag(STRIPOFFSETS);

  int compression = raw->getEntry(COMPRESSION)->getU32();

  if (1 == compression || compression == 32773) {
    decodeUncompressed(raw, BitOrder_MSB);
    return mRaw;
  }

  if (65535 != compression)
    ThrowRDE("Unsupported compression");

  TiffEntry *offsets = raw->getEntry(STRIPOFFSETS);
  TiffEntry *counts = raw->getEntry(STRIPBYTECOUNTS);

  if (offsets->count != 1) {
    ThrowRDE("Multiple Strips found: %u", offsets->count);
  }
  if (counts->count != offsets->count) {
    ThrowRDE(
        "Byte count number does not match strip size: count:%u, strips:%u ",
        counts->count, offsets->count);
  }
  if (!mFile->isValid(offsets->getU32(), counts->getU32()))
    ThrowRDE("Truncated file.");

  uint32 width = raw->getEntry(IMAGEWIDTH)->getU32();
  uint32 height = raw->getEntry(IMAGELENGTH)->getU32();

  mRaw->dim = iPoint2D(width, height);
  mRaw->createData();
  try {
    PentaxDecompressor::decompress(
        mRaw, ByteStream(mFile, offsets->getU32(), counts->getU32()),
        getRootIFD());
  } catch (IOException &e) {
    mRaw->setError(e.what());
    // Let's ignore it, it may have delivered somewhat useful data.
  }

  return mRaw;
}
示例#15
0
文件: cache.cpp 项目: 02JanDal/soqute
void Cache::addEntry(const QUrl &url, const QByteArray &data)
{
	Entry entry = getEntry(url);
	entry.md5 = QCryptographicHash::hash(data, QCryptographicHash::Md5);
	entry.updated = QDateTime::currentDateTime();

	FS::write(absoluteFilename(entry), data);

	setEntry(entry);
}
示例#16
0
Matrix Matrix::operator+(const Matrix& right) const
{
	if(getRow() != right.getRow() || getColumn() != right.getColumn())
		throw OperandsNotMatched();
	Matrix sum(getRow(), getColumn());
	for(int i = 0; i < sum.getRow(); i++)
		for(int j = 0; j < sum.getColumn(); j++)
			sum.setEntry(i, j, getEntry(i, j) + right.getEntry(i, j));
	return sum;
}
示例#17
0
 /**
  * 
  * @brief returns all entry sites that correspond with the given call site
  *
  * @param - callSite: the call site whose entry sites to look for
  * @return the set of all entry sites that correspond with the given call site
  *
  */
 const TransitionStorage::States TransitionStorage::getEntries( State callSite ) const
 {
   States entries;
   const Info::Calls & cll = T_info.callTrans(callSite);
   for( Info::CallIterator it = cll.begin(); it != cll.end(); it++ )
   {
     entries.insert(getEntry(*it));
   }
   return entries;
 }
示例#18
0
bool ProjectPackagesDialog::winCheckDirectoryOk()
    {
    bool success = true;
    bool missing = !FileIsDirOnDisk(getEntry("PackageRootDirEntry"), success);
    if(missing)
        {
        Gui::messageBox("The root directory is not correct");
        }
    return(!missing);
    }
void FilledBandedMatrix::print()
{

    for(unsigned long i = 0; i < size()+3; i++)
    {  
        for(unsigned long j = 0; j <= rightIndex(i); j++)
        {
            
            cout << setw(10)<<getEntry(i,j);
        }
//        cout <<"F: ";
        for(unsigned long j =  rightIndex(i) + 1; j <= rightIndex(i) + 4; j++)
        {
            cout <<setw(10) << getEntry(i,j);
        }        
        
        cout << endl;
    }
}
示例#20
0
inline Matrix<T> Matrix<T>::operator*(const Matrix<T> &other) {
	Matrix<T> c = Matrix(this->getHeight(), other.getWidth());
	for (unsigned int i=0; i<c.getHeight(); i++){
		for (unsigned int j = 0; j < c.getWidth(); j++){
			T e = 0;
			for (unsigned int k = 0; k < _width; k += 4){
					asm (
						"#loop"
					);
					e += getEntry(i, k) * other.getEntry(k, j);
					e += getEntry(i, k + 1) * other.getEntry(k + 1, j);
					e += getEntry(i, k + 2) * other.getEntry(k + 2, j);
					e += getEntry(i, k + 3) * other.getEntry(k + 3, j);
			}
			c.setEntry(i,j,e);
		}
	}
	return c;
}
示例#21
0
//------------------------------------------------------------------------
bool COptionMenu::checkEntry (int32_t index, bool state)
{
	CMenuItem* item = getEntry (index);
	if (item)
	{
		item->setChecked (state);
		return true;
	}
	return false;
}
示例#22
0
文件: rawld.cpp 项目: kalemas/swordxx
std::string &RawLD::getRawEntryBuf() const {

    char ret = getEntry();
    if (!ret) {
//        if (!isUnicode())
            prepText(entryBuf);
    }
    else error = ret;

    return entryBuf;
}
示例#23
0
//------------------------------------------------------------------------
bool PresetFile::restoreControllerState (IEditController* editController)
{
	const Entry* e = getEntry (kControllerState);
	if (e)
	{
		ReadOnlyBStream* readOnlyBStream = new ReadOnlyBStream (stream, e->offset, e->size);
		FReleaser readOnlyBStreamReleaser (readOnlyBStream);
		return verify (editController->setState (readOnlyBStream));
	}
	return false;
}
示例#24
0
//------------------------------------------------------------------------
bool PresetFile::restoreComponentState (IComponent* component)
{
	const Entry* e = getEntry (kComponentState);
	if (e)
	{
		ReadOnlyBStream* readOnlyBStream = new ReadOnlyBStream (stream, e->offset, e->size);
		FReleaser readOnlyBStreamReleaser (readOnlyBStream);
		return verify (component->setState (readOnlyBStream));
	}
	return false;
}
示例#25
0
vector_t averageListedPoints(const points_t points, const list_t list)
{
  index_t i;
  vector_t m = initVector(0.0f, 0.0f, 0.0f);
  for (i=0; i<getLength(list); i++) {
    entry_t e=getEntry(list,i);
    m=addVectors(getPoint(points,entry_getIndex(&e)),m);
  }
  m=scaleVector(m,1.0f/((float)getLength(list)));
  return m;
}
示例#26
0
文件: Archive.cpp 项目: Aeyesx/SLADE
/* ArchiveTreeNode::removeEntry
 * Removes the entry at [index] in this directory (but doesn't delete
 * it). Returns false if [index] was out of bounds, true otherwise
 *******************************************************************/
bool ArchiveTreeNode::removeEntry(unsigned index)
{
	// Check index
	if (index >= entries.size())
		return false;

	// De-parent entry
	entries[index]->parent = NULL;

	// De-link entry
	entries[index]->prev = NULL;
	entries[index]->next = NULL;
	if (index > 0) entries[index-1]->next = getEntry(index+1);
	if (index < entries.size()-1) entries[index+1]->prev = getEntry(index-1);

	// Remove it from the entry list
	entries.erase(entries.begin() + index);

	return true;
}
示例#27
0
int calculateZHull(zhull_t *zh)
{
  index_t fli=0;
  index_t pi;
  facet_t *f;
  list_t outsideset;
  int cnt=0;
  int maxit=getNumPoints(zh->pts);
  list_t horizon_fcts=emptyList();
  list_t horizon_fcts_edges=emptyList();
  list_t other_horizon_edges=emptyList();
  list_t available_points=emptyList();
  entry_t e;


//    if (maxit>MAXIT)
//        maxit=MAXIT;
  if (getNumPoints(zh->pts)!=0) {
    zhullInitialFacets(zh);
    //printZhull(zh);
    while(((getLength(zh->facets_with_insidepoints)>0)
           ||(getLength(zh->facets_with_outsidepoints)>0))
          &&(cnt++<maxit))  {
      //            printf("//////////////// ITERATION %d ///////\n",cnt);
      if (getLength(zh->facets_with_insidepoints)>0) {
        fli%=getLength(zh->facets_with_insidepoints);
        f=getFacetByIndex(zh->facets_with_insidepoints,fli);
        e=getEntry(f->insideset, 0);
        pi=entry_getIndex(&e);
//                printf("insidepoint\n");
//                printList(zh->facets_with_insidepoints);
      } else {
        fli%=getLength(zh->facets_with_outsidepoints);
        f=getFacetByIndex(zh->facets_with_outsidepoints,fli);
        pi=f->farthest_outside_point;
      }
//            printf("point %d\n",pi);
      removeVisibleFacetsGetHorizonAndAvailablePoints(zh,pi,f,
          &horizon_fcts, &horizon_fcts_edges,&other_horizon_edges,
          &available_points);
      removeValueFromList(&available_points, entry_makeIndex(pi));
      makePyramidFacetsToHorizon(zh,pi,horizon_fcts,horizon_fcts_edges,
                                 other_horizon_edges,available_points);
      //            printZhull(zh);
      freeList(&horizon_fcts);
      freeList(&horizon_fcts_edges);
      freeList(&other_horizon_edges);
      freeList(&available_points);
      fli++;
    }
//        appendExteriorPoints(zh);
  }
  return cnt;
}
示例#28
0
static void removeFacetByIndexList(zhull_t * const zh,
                                   const list_t indices)
{
  facet_t *f;
  index_t i;
  for (i=0; i<getLength(indices); i++) {
    entry_t e = getEntry(indices,i);
    f = getFacetByIndex(zh->facets, entry_getIndex(&e));
    removeFacetByPointer(zh,f);
  }
}
示例#29
0
//------------------------------------------------------------------------
bool PresetFile::getUnitProgramListID (int32& unitProgramListID)
{
	const Entry* e = getEntry (kProgramData);
	if (e && seekTo (e->offset))
	{
		if (readInt32 (unitProgramListID))
		{
			return true;
		}
	}
	return false;
}
示例#30
0
int ll_addLast(LinkedList *ll, void *element) {
   int status = 0;
   LLNode *p = getEntry(ll);

   if (p != NULL) {
      p->element = element;
      status = 1;
      link(SENTINEL(ll)->prev, p, SENTINEL(ll));
      ll->size++;
   }
   return status;
}