本文整理汇总了C++中debugError函数的典型用法代码示例。如果您正苦于以下问题:C++ debugError函数的具体用法?C++ debugError怎么用?C++ debugError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debugError函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: if
bool
VolumeControlLowRes::setValue(int v)
{
uint32_t reg;
uint32_t old_reg;
if (v>0xFF) v=0xFF;
else if (v<0) v=0;
if ( !m_Parent.getSpecificValue(m_cmd_id, ®) ) {
debugError( "getSpecificValue failed\n" );
return 0;
}
old_reg=reg;
reg &= ~(0xFF<<m_bit_shift);
reg |= (v<<m_bit_shift);
debugOutput(DEBUG_LEVEL_VERBOSE, "setValue for id %d to %d, shift %d (reg: 0x%08X => 0x%08X)\n",
m_cmd_id, v, m_bit_shift, old_reg, reg);
if ( !m_Parent.setSpecificValue(m_cmd_id, reg) ) {
debugError( "setSpecificValue failed\n" );
return false;
} else return true;
}
开发者ID:janosvitok,项目名称:ffado,代码行数:26,代码来源:focusrite_generic.cpp
示例2: debugError
bool
EfcCmd::deserialize( Util::Cmd::IISDeserialize& de )
{
bool result=true;
result &= de.read(&m_length);
m_length=CondSwapFromBus32(m_length);
// read the EFC header
quadlet_t *header_as_quadlets=(quadlet_t *)&m_header;
for (unsigned int i=0; i<sizeof(m_header)/4; i++) {
result &= de.read((header_as_quadlets+i));
*(header_as_quadlets+i)=CondSwapFromBus32(*(header_as_quadlets+i));
}
// check the EFC version
if(m_header.version > 1) {
debugError("Unsupported EFC version: %d\n", m_header.version);
return false;
}
// check whether the category and command of the response are valid
if (m_header.category != m_category_id) {
debugError("Invalid category response: %d != %d\n", m_header.category, m_category_id);
return false;
}
if (m_header.command != m_command_id) {
debugError("Invalid command response: %d != %d\n", m_header.command, m_command_id);
return false;
}
return result;
}
开发者ID:janosvitok,项目名称:ffado,代码行数:32,代码来源:efc_cmd.cpp
示例3: extPlugInfoCmd
uint8_t
Device::getConfigurationIdNumberOfChannel( PlugAddress::EPlugDirection ePlugDirection )
{
ExtendedPlugInfoCmd extPlugInfoCmd( get1394Service() );
UnitPlugAddress unitPlugAddress( UnitPlugAddress::ePT_PCR,
0 );
extPlugInfoCmd.setPlugAddress( PlugAddress( ePlugDirection,
PlugAddress::ePAM_Unit,
unitPlugAddress ) );
extPlugInfoCmd.setNodeId( getNodeId() );
extPlugInfoCmd.setCommandType( AVCCommand::eCT_Status );
extPlugInfoCmd.setVerbose( getDebugLevel() );
ExtendedPlugInfoInfoType extendedPlugInfoInfoType(
ExtendedPlugInfoInfoType::eIT_NoOfChannels );
extendedPlugInfoInfoType.initialize();
extPlugInfoCmd.setInfoType( extendedPlugInfoInfoType );
if ( !extPlugInfoCmd.fire() ) {
debugError( "Number of channels command failed\n" );
return 0;
}
ExtendedPlugInfoInfoType* infoType = extPlugInfoCmd.getInfoType();
if ( infoType
&& infoType->m_plugNrOfChns )
{
debugOutput(DEBUG_LEVEL_VERBOSE, "Number of channels 0x%02x\n",
infoType->m_plugNrOfChns->m_nrOfChannels );
return infoType->m_plugNrOfChns->m_nrOfChannels;
}
debugError( "Could not retrieve number of channels\n" );
return 0;
}
开发者ID:EMATech,项目名称:ffado,代码行数:34,代码来源:bebob_avdevice.cpp
示例4: debugOutput
bool
Device::destroyMixer() {
bool ret = true;
debugOutput(DEBUG_LEVEL_VERBOSE, "destroy mixer...\n");
if (m_MixerContainer == NULL) {
debugOutput(DEBUG_LEVEL_VERBOSE, "no mixer to destroy...\n");
} else
if (!deleteElement(m_MixerContainer)) {
debugError("Mixer present but not registered to the avdevice\n");
ret = false;
} else {
// remove and delete (as in free) child control elements
m_MixerContainer->clearElements(true);
delete m_MixerContainer;
m_MixerContainer = NULL;
}
// remove control container
if (m_ControlContainer == NULL) {
debugOutput(DEBUG_LEVEL_VERBOSE, "no controls to destroy...\n");
} else
if (!deleteElement(m_ControlContainer)) {
debugError("Controls present but not registered to the avdevice\n");
ret = false;
} else {
// remove and delete (as in free) child control elements
m_ControlContainer->clearElements(true);
delete m_ControlContainer;
m_ControlContainer = NULL;
}
return false;
}
开发者ID:janosvitok,项目名称:ffado,代码行数:34,代码来源:rme_avdevice.cpp
示例5: extStreamFormatCmd
uint8_t
Device::getConfigurationIdSampleRate()
{
ExtendedStreamFormatCmd extStreamFormatCmd( get1394Service() );
UnitPlugAddress unitPlugAddress( UnitPlugAddress::ePT_PCR, 0 );
extStreamFormatCmd.setPlugAddress( PlugAddress( PlugAddress::ePD_Input,
PlugAddress::ePAM_Unit,
unitPlugAddress ) );
extStreamFormatCmd.setNodeId( getNodeId() );
extStreamFormatCmd.setCommandType( AVCCommand::eCT_Status );
extStreamFormatCmd.setVerbose( getDebugLevel() );
if ( !extStreamFormatCmd.fire() ) {
debugError( "Stream format command failed\n" );
return 0;
}
FormatInformation* formatInfo =
extStreamFormatCmd.getFormatInformation();
FormatInformationStreamsCompound* compoundStream
= dynamic_cast< FormatInformationStreamsCompound* > (
formatInfo->m_streams );
if ( compoundStream ) {
debugOutput(DEBUG_LEVEL_VERBOSE, "Sample rate 0x%02x\n",
compoundStream->m_samplingFrequency );
return compoundStream->m_samplingFrequency;
}
debugError( "Could not retrieve sample rate\n" );
return 0;
}
开发者ID:EMATech,项目名称:ffado,代码行数:32,代码来源:bebob_avdevice.cpp
示例6: createPidFile
// ----------------------------------------------------
// Creates the pid file for a given instance directory.
// and a given pid.
// If the file could be created returns TRUE and FALSE
// otherwise.
// ----------------------------------------------------
BOOL createPidFile(const char* instanceDir, int pid)
{
BOOL returnValue = FALSE;
char pidFile[PATH_SIZE];
FILE *f;
debug("createPidFile(instanceDir='%s',pid=%d)", instanceDir, pid);
if (getPidFile(instanceDir, pidFile, PATH_SIZE))
{
if ((f = fopen(pidFile, "w")) != NULL)
{
fprintf(f, "%d", pid);
fclose (f);
returnValue = TRUE;
debug("Successfully put pid=%d in the pid file '%s'.", pid, pidFile);
}
else
{
debugError("Couldn't create the pid file '%s' because the file could not be opened.", pidFile);
returnValue = FALSE;
}
}
else
{
debugError("Couldn't create the pid file because the pid file name could not be constructed.");
returnValue = FALSE;
}
return returnValue;
} // createPidFile
开发者ID:GluuFederation,项目名称:gluu-opendj,代码行数:37,代码来源:winlauncher.c
示例7: debugError
bool
BinaryControl::setValue(int v)
{
uint32_t reg;
uint32_t old_reg;
if ( !m_Parent.getSpecificValue(m_cmd_id, ®) ) {
debugError( "getSpecificValue failed\n" );
return 0;
}
old_reg=reg;
if (v) {
reg |= (1<<m_cmd_bit);
} else {
reg &= ~(1<<m_cmd_bit);
}
debugOutput(DEBUG_LEVEL_VERBOSE, "setValue for id %d to %d (reg: 0x%08X => 0x%08X)\n",
m_cmd_id, v, old_reg, reg);
if ( !m_Parent.setSpecificValue(m_cmd_id, reg) ) {
debugError( "setSpecificValue failed\n" );
return false;
} else return true;
}
开发者ID:janosvitok,项目名称:ffado,代码行数:25,代码来源:focusrite_generic.cpp
示例8: OAEP_decode
/**
* PKCS #1 OAEP decoding
*/
static int OAEP_decode(unsigned char *message,
unsigned int encoded_bytes, const unsigned char *encoded,
unsigned int label_bytes, const unsigned char *label) {
unsigned int i, message_bytes;
unsigned char DB[RSA_MOD_BYTES - RSA_SHA_BYTES - 1 /* Add MGF1 buffer space */ + 4];
unsigned char seed[RSA_SHA_BYTES /* Add MGF1 buffer space */ + 4];
debugValue("OAEP decode: encoded message", encoded, encoded_bytes);
// First byte of encoded message must be 0x00
if(encoded[0] != 0x00) {
debugError("First byte of OAEP encoded message is not 0x00");
return RSA_ERROR_OAEP_DECODE;
}
// Extract maskedDB and maskedSeed
debugValue("OAEP decode: maskedSeed", encoded + 1, RSA_SHA_BYTES);
Copy(RSA_SHA_BYTES, DB, encoded + 1 + RSA_SHA_BYTES);
debugValue("OAEP decode: maskedDB", encoded + 1 + RSA_SHA_BYTES, RSA_MOD_BYTES - RSA_SHA_BYTES - 1);
// Finding seed and DB
MGF1(RSA_MOD_BYTES - RSA_SHA_BYTES - 1, DB, RSA_SHA_BYTES, seed);
debugValue("OAEP decode: seedMask", seed, RSA_SHA_BYTES);
XorAssign(RSA_SHA_BYTES, seed, encoded + 1);
debugValue("OAEP decode: seed", seed, RSA_SHA_BYTES);
MGF1(RSA_SHA_BYTES, seed, RSA_MOD_BYTES - RSA_SHA_BYTES - 1, DB);
debugValue("OAEP decode: dbMask", DB, RSA_MOD_BYTES - RSA_SHA_BYTES - 1);
XorAssign(RSA_MOD_BYTES - RSA_SHA_BYTES - 1, DB, encoded + 1 + RSA_SHA_BYTES);
debugValue("OAEP decode: DB", DB, RSA_MOD_BYTES - RSA_SHA_BYTES - 1);
// Compute the hash of l
debugValue("OAEP decode: label", label, label_bytes);
SHA(RSA_SHA_BYTES, seed, label_bytes, label);
debugValue("OAEP decode: hash of label", seed, RSA_SHA_BYTES);
// Check whether the first RSA_SHA_BYTES bytes of DB equal to lHash
if (NotEqual(RSA_SHA_BYTES, seed, DB)) {
debugError("First RSA_SHA_BYTES of DB do not match with hash of label");
return RSA_ERROR_OAEP_DECODE;
}
// Try to locate the message in DB
i = RSA_SHA_BYTES;
while ((DB[i] == 0x00) && (DB[i] != 0x01) && (i < (RSA_MOD_BYTES - RSA_SHA_BYTES - 1 - 1))) i++;
if ((i == (RSA_MOD_BYTES - RSA_SHA_BYTES - 1 - 1)) || (DB[i] != 0x01)) {
debugError("Failed to locate the message in DB");
return RSA_ERROR_OAEP_DECODE;
}
// Extract the message, starting after 0x01 byte to the end of DB
message_bytes = RSA_MOD_BYTES - RSA_SHA_BYTES - 1 - 1 - (i + 1) + 1;
CopyBytes(message_bytes, message, DB + i + 1);
debugValue("OAEP decode: recovered message", message, message_bytes);
return message_bytes;
}
开发者ID:adelapie,项目名称:irma_card,代码行数:63,代码来源:RSA.c
示例9: launch
// The goal of these methods is:
// Be able to launch batch files with double-click and not having a
// prompt-window associated with it.
// Launch batch files from the prompt that generate a java process that does not
// block the prompt and that keeps running even if the prompt window is closed.
//
// This function expects the following parameter to be passed:
// the directory of the server we want to start and the
// command line that we want to execute (basically the java
// command that we want to display the status panel). The main reasons
// to have the command line passed are:
// 1. Keep the native code as minimal as possible.
// 2. Allow the administrator some flexibility in the way the
// server is started by leaving most of the logic in the command-line.
//
// Returns the pid of the process associated with the command if it could be
// launched and -1 otherwise.
// ----------------------------------------------------
int launch(char* argv[])
{
int returnValue;
char command[COMMAND_SIZE];
if (getCommandLine(argv, command, COMMAND_SIZE))
{
returnValue = spawn(command, TRUE);
if (returnValue <= 0)
{
debugError("Failed to launch the child process '%s'.", command);
}
else
{
debug("Successfully launched the child process '%s'.", command);
}
}
else
{
debugError("Couldn't launch the child process because the full command line could not be constructed.");
returnValue = -1;
}
return returnValue;
} // launch
开发者ID:GluuFederation,项目名称:gluu-opendj,代码行数:44,代码来源:winlauncher.c
示例10: start
// ----------------------------------------------------
// Function called when we want to start the server.
// This function expects the following parameter to be passed:
// the directory of the server we want to start and the
// command line (and its argumets) that we want to execute (basically the java
// command that we want to start the server). The main reasons
// to have the command line passed are:
// 1. Keep the native code as minimal as possible.
// 2. Allow the administrator some flexibility in the way the
// server is started by leaving most of the logic in the command-line.
//
// This approach makes things to be closer between what is proposed
// in windows and in UNIX systems.
//
// If the instance could be started the code will write the pid of the process
// of the server in file that can be used for instance to stop the server
// (see stop.c).
//
// Returns the pid of the process of the instance if it could be started and -1
// otherwise.
// ----------------------------------------------------
int start(const char* instanceDir, char* argv[])
{
int returnValue;
int childPid;
char command[COMMAND_SIZE];
if (getCommandLine(argv, command, COMMAND_SIZE))
{
childPid = spawn(command, TRUE);
if (childPid > 0)
{
createPidFile(instanceDir, childPid);
returnValue = childPid;
}
else
{
debugError("Couldn't start the child process because the spawn failed.");
returnValue = -1;
}
}
else
{
debugError("Couldn't start the child process because the full command line could not be constructed.");
returnValue = -1;
}
return returnValue;
} // start
开发者ID:GluuFederation,项目名称:gluu-opendj,代码行数:51,代码来源:winlauncher.c
示例11: sizeof
bool SaffirePro24::discover() {
if (Dice::Device::discover()) {
fb_quadlet_t* version = (fb_quadlet_t *)calloc(2, sizeof(fb_quadlet_t));
getEAP()->readRegBlock(Dice::EAP::eRT_Application, SAFFIRE_PRO24_REGISTER_APP_VERSION, version, 1*sizeof(fb_quadlet_t));
// On August 2013, Focusrite released a new firmware.
// Version numbering 2.0 (0x00020000) seems common to all Saffire
// Dice EAP devices.
// Note: 0x00010004 and 0x00010008 stands for a firmware version
// not for a device identity. 0x00010004 is a pro24, 0x00010008
// is the pro24dsp.
if (version[0] != 0x00010004 && version[0] != 0x00010008 && version[0] != 0x00020000) {
debugError("This is a Focusrite Saffire Pro24 but not the right firmware. Better stop here before something goes wrong.\n");
debugError("This device has firmware 0x%x while we only know about versions 0x%x, 0x%x and 0x%x.\n", version[0], 0x10004, 0x10008, 0x00020000);
return false;
}
// FIXME: What is the purpose of the following commented lines at this point ?
//getEAP()->readRegBlock(Dice::EAP::eRT_Command, 0x00, tmp, 2*sizeof(fb_quadlet_t)); // DEBUG
//hexDumpQuadlets(tmp, 2); // DEBUG
FocusriteEAP* eap = dynamic_cast<FocusriteEAP*>(getEAP());
SaffirePro24EAP::MonitorSection* monitor = new SaffirePro24EAP::MonitorSection(eap, "Monitoring");
getEAP()->addElement(monitor);
return true;
}
return false;
}
开发者ID:EMATech,项目名称:ffado,代码行数:27,代码来源:saffire_pro24.cpp
示例12: debugError
// this has to wait until the ISO channel numbers are written
bool
SlaveDevice::startStreamByIndex(int i) {
if (i<(int)m_receiveProcessors.size()) {
int n=i;
Streaming::StreamProcessor *p=m_receiveProcessors.at(n);
// the other side sends on this channel
nodeaddr_t iso_channel_offset = BOUNCE_REGISTER_RX_ISOCHANNEL;
iso_channel_offset += ((unsigned)n)*4;
if (!waitForRegisterNotEqualTo(iso_channel_offset, 0xFFFFFFFFLU)) {
debugError("Timeout waiting for stream %d to get an ISO channel\n",i);
return false;
}
fb_quadlet_t result;
// this will read from our own registers
if (!readReg(iso_channel_offset, &result)) {
debugError("Could not read ISO channel register for stream %d\n",i);
return false;
}
// set ISO channel
p->setChannel(result);
return true;
} else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) {
int n=i-m_receiveProcessors.size();
Streaming::StreamProcessor *p = m_transmitProcessors.at(n);
// the other side sends on this channel
nodeaddr_t iso_channel_offset = BOUNCE_REGISTER_TX_ISOCHANNEL;
iso_channel_offset += ((unsigned)n)*4;
if (!waitForRegisterNotEqualTo(iso_channel_offset, 0xFFFFFFFF)) {
debugError("Timeout waiting for stream %d to get an ISO channel\n",i);
return false;
}
fb_quadlet_t result;
// this will read from our own registers
if (!readReg(iso_channel_offset, &result)) {
debugError("Could not read ISO channel register for stream %d\n",i);
return false;
}
// set ISO channel
p->setChannel(result);
return true;
}
debugError("SP index %d out of range!\n",i);
return false;
}
开发者ID:EMATech,项目名称:ffado,代码行数:60,代码来源:bounce_slave_avdevice.cpp
示例13: debugOutput
void
PosixMutex::Lock()
{
int err;
debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, "(%s, %p) lock\n", m_id.c_str(), this);
#if DEBUG_LOCK_COLLISION_TRACING
if(TryLock()) {
// locking succeeded
m_locked_by = debugBacktraceGet( DEBUG_LOCK_COLLISION_TRACING_INDEX );
char name[ DEBUG_LOCK_COLLISION_TRACING_NAME_MAXLEN ];
name[0] = 0;
debugGetFunctionNameFromAddr(m_locked_by, name, DEBUG_LOCK_COLLISION_TRACING_NAME_MAXLEN);
debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE,
"(%s, %p) %s obtained lock\n",
m_id.c_str(), this, name);
return;
} else {
void *lock_try_by = debugBacktraceGet( DEBUG_LOCK_COLLISION_TRACING_INDEX );
char name1[ DEBUG_LOCK_COLLISION_TRACING_NAME_MAXLEN ];
name1[0] = 0;
debugGetFunctionNameFromAddr(lock_try_by, name1, DEBUG_LOCK_COLLISION_TRACING_NAME_MAXLEN);
char name2[ DEBUG_LOCK_COLLISION_TRACING_NAME_MAXLEN ];
name2[0] = 0;
debugGetFunctionNameFromAddr(m_locked_by, name2, DEBUG_LOCK_COLLISION_TRACING_NAME_MAXLEN);
debugWarning("(%s, %p) lock collision: %s wants lock, %s has lock\n",
m_id.c_str(), this, name1, name2);
if((err = pthread_mutex_lock(&m_mutex))) {
if (err == EDEADLK) {
debugError("(%s, %p) Resource deadlock detected\n", m_id.c_str(), this);
debugPrintBacktrace(10);
} else {
debugError("(%s, %p) Error locking the mutex: %d\n", m_id.c_str(), this, err);
}
} else {
debugWarning("(%s, %p) lock collision: %s got lock (from %s?)\n",
m_id.c_str(), this, name1, name2);
}
}
#else
#ifdef DEBUG
if((err = pthread_mutex_lock(&m_mutex))) {
if (err == EDEADLK) {
debugError("(%s, %p) Resource deadlock detected\n", m_id.c_str(), this);
debugPrintBacktrace(10);
} else {
debugError("(%s, %p) Error locking the mutex: %d\n", m_id.c_str(), this, err);
}
}
#else
pthread_mutex_lock(&m_mutex);
#endif
#endif
}
开发者ID:EMATech,项目名称:ffado,代码行数:57,代码来源:PosixMutex.cpp
示例14: main
// ----------------------------------------------------
// main function called by the executable. This code is
// called by the start-ds.bat, stop-ds.bat and statuspanel.bat batch files.
//
// The code assumes that the first passed argument is the subcommand to be
// executed and for start and stop the second argument the directory of the
// server.
// The rest of the arguments are the arguments specific to each subcommand (see
// the comments for the functions start, stop and launch).
// ----------------------------------------------------
int main(int argc, char* argv[])
{
int returnCode;
char* subcommand = NULL;
char* instanceDir = NULL;
int i;
debug("main called.");
for (i = 0; i < argc; i++) {
debug(" argv[%d] = '%s'", i, argv[i]);
}
if (argc < 3) {
char * msg =
"Expected command line args of [subcommand], but got %d arguments.\n";
debugError(msg, argc - 1);
fprintf(stderr, msg, argc - 1);
return -1;
}
subcommand = argv[1];
if (strcmp(subcommand, "start") == 0)
{
instanceDir = argv[2];
argv += 3;
returnCode = start(instanceDir, argv);
}
else if (strcmp(subcommand, "stop") == 0)
{
instanceDir = argv[2];
argv += 3;
returnCode = stop(instanceDir);
}
else if (strcmp(subcommand, "launch") == 0)
{
argv += 2;
returnCode = launch(argv);
}
else if (strcmp(subcommand, "run") == 0)
{
argv += 2;
returnCode = run(argv);
}
else
{
char * msg = "Unknown subcommand: [%s]\n";
debugError(msg, subcommand);
fprintf(stderr, msg, subcommand);
returnCode = -1;
}
debug("main finished. Returning %d", returnCode);
return returnCode;
}
开发者ID:GluuFederation,项目名称:gluu-opendj,代码行数:64,代码来源:winlauncher.c
示例15: IOMasterPort
int AoEProperties::configure_matching(void)
{
// debugVerbose("AoEProperties::configure_matching\n");
// Obtain ports for notifications (this will be used for all service matching notifications)
kern_return_t kresult;
mach_port_t MasterPort;
kresult = IOMasterPort(MACH_PORT_NULL, &MasterPort);
if ( kresult )
{
debugError("Could not get masterport. Error=%d\n", kresult);
return false;
}
ms_NotificationPort = IONotificationPortCreate(MasterPort);
ms_IOKitNotificationRunLoopSource = IONotificationPortGetRunLoopSource(ms_NotificationPort);
CFRunLoopAddSource(CFRunLoopGetCurrent(), ms_IOKitNotificationRunLoopSource, kCFRunLoopDefaultMode);
// SetUp Notification for matching to our device
CFMutableDictionaryRef MatchingDict = IOServiceMatching(AOE_KEXT_NAME_Q);
IOServiceAddMatchingNotification(ms_NotificationPort,
kIOMatchedNotification,
MatchingDict,
AoEProperties::matched_callback,
this,
&ms_MatchIt);
// Call the callback immediately to check if our iterator already contains our device (ie. the device is already loaded)
matched_callback(this, ms_MatchIt);
return m_fMatched ? 0 : -1;
}
开发者ID:ecashin,项目名称:aoe-osx,代码行数:34,代码来源:AoEProperties.cpp
示例16: debugOutput
bool
Watchdog::WatchdogHartbeatTask::Execute()
{
if (Watchdog::WatchdogTask::Execute() == false)
return false;
debugOutput(DEBUG_LEVEL_VERY_VERBOSE,
"(%p) watchdog %p hartbeat\n", this, &m_parent);
m_parent.setHartbeat();
#ifdef DEBUG
uint64_t now = Util::SystemTimeSource::getCurrentTimeAsUsecs();
int diff = now - m_last_loop_entry;
if(diff < 100) {
debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE,
"(%p) short loop detected (%d usec), cnt: %d\n",
this, diff, m_successive_short_loops);
m_successive_short_loops++;
if(m_successive_short_loops > 100) {
debugError("Shutting down runaway thread\n");
return false;
}
} else {
// reset the counter
m_successive_short_loops = 0;
}
m_last_loop_entry = now;
#endif
return true;
}
开发者ID:EMATech,项目名称:ffado,代码行数:31,代码来源:Watchdog.cpp
示例17: m_pConfigRom
FFADODevice::FFADODevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom ) )
: Control::Container()
, m_pConfigRom( configRom )
, m_pDeviceManager( d )
{
addOption(Util::OptionContainer::Option("id",std::string("dev?")));
std::ostringstream nodestr;
nodestr << "node" << getConfigRom().getNodeId();
if (!addElement(&getConfigRom())) {
debugWarning("failed to add ConfigRom to Control::Container\n");
}
m_genericContainer = new Control::Container("Generic");
if(m_genericContainer == NULL) {
debugError("Could not create Control::Container for generic controls\n");
} else {
if (!addElement(m_genericContainer)) {
debugWarning("failed to add generic container to Control::Container\n");
}
// add a generic control for the clock source selection
if(!m_genericContainer->addElement(new Control::ClockSelect(*this))) {
debugWarning("failed to add clock source control to container\n");
}
}
}
开发者ID:janosvitok,项目名称:ffado,代码行数:28,代码来源:ffadodevice.cpp
示例18: jassert
bool ModulatorSamplerSoundPool::loadMonolithicData(const ValueTree &sampleMap, const Array<File>& monolithicFiles, OwnedArray<ModulatorSamplerSound> &sounds)
{
jassert(!mc->getMainSynthChain()->areVoicesActive());
clearUnreferencedMonoliths();
loadedMonoliths.add(new MonolithInfoToUse(monolithicFiles));
MonolithInfoToUse* hmaf = loadedMonoliths.getLast();
try
{
hmaf->fillMetadataInfo(sampleMap);
}
catch (StreamingSamplerSound::LoadingError l)
{
String x;
x << "Error at loading sample " << l.fileName << ": " << l.errorDescription;
mc->getDebugLogger().logMessage(x);
#if USE_FRONTEND
mc->sendOverlayMessage(DeactiveOverlay::State::CustomErrorMessage, x);
#else
debugError(mc->getMainSynthChain(), x);
#endif
}
for (int i = 0; i < sampleMap.getNumChildren(); i++)
{
ValueTree sample = sampleMap.getChild(i);
if (sample.getNumChildren() == 0)
{
String fileName = sample.getProperty("FileName").toString().fromFirstOccurrenceOf("{PROJECT_FOLDER}", false, false);
StreamingSamplerSound* sound = new StreamingSamplerSound(hmaf, 0, i);
pool.add(sound);
sounds.add(new ModulatorSamplerSound(mc, sound, i));
}
else
{
StreamingSamplerSoundArray multiMicArray;
for (int j = 0; j < sample.getNumChildren(); j++)
{
StreamingSamplerSound* sound = new StreamingSamplerSound(hmaf, j, i);
pool.add(sound);
multiMicArray.add(sound);
}
sounds.add(new ModulatorSamplerSound(mc, multiMicArray, i));
}
}
sendChangeMessage();
return true;
}
开发者ID:azeteg,项目名称:HISE,代码行数:60,代码来源:ModulatorSamplerSound.cpp
示例19: MIN
void EInterfaces::recalculate_mtu(void)
{
UInt32 Min_MTU;
int n;
Min_MTU = 0;
for(n=0; n<numberof(m_aInterfaces); n++)
{
if ( m_aInterfaces[n].m_fEnabled )
{
if ( Min_MTU )
Min_MTU = MIN(ifnet_mtu(m_aInterfaces[n].m_ifnet), Min_MTU);
else
Min_MTU = ifnet_mtu(m_aInterfaces[n].m_ifnet);
}
}
if ( 0==Min_MTU )
{
debugError("Error in MTU calculation.\n");
m_Min_MTU = 1500; // Set to standard MTU size
}
m_Min_MTU = Min_MTU;
debug("Minimum MTU of %d interface(s) is %d bytes\n", m_nInterfacesInUse, m_Min_MTU);
}
开发者ID:ecashin,项目名称:aoe-osx,代码行数:28,代码来源:EInterfaces.cpp
示例20: thread_function
void* thread_function(void* arg)
{
struct thread_args* obj = (struct thread_args*)arg;
int err;
if ((err = pthread_setcanceltype(obj->fCancellation, NULL)) != 0) {
debugError("pthread_setcanceltype err = %s\n", strerror(err));
}
debugOutput( DEBUG_LEVEL_VERBOSE, "start %p\n", obj);
uint64_t now = getCurrentTimeAsUsecs();
uint64_t wake_at = now += SLEEP_PERIOD_USECS;
// If Init succeed start the thread loop
while (obj->fRunning) {
debugOutput( DEBUG_LEVEL_VERBOSE, "run %p\n", obj);
SleepUsecAbsolute(wake_at);
wake_at += SLEEP_PERIOD_USECS;
debugOutput(DEBUG_LEVEL_VERBOSE,
"cuckoo from %p at %012" PRI_FFADO_MICROSECS_T "\n",
obj, getCurrentTimeAsUsecs());
pthread_testcancel();
}
debugOutput( DEBUG_LEVEL_VERBOSE, "exit %p\n", obj);
return 0;
}
开发者ID:janosvitok,项目名称:ffado,代码行数:29,代码来源:test-clock_nanosleep.cpp
注:本文中的debugError函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论