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


C++ debug_message函数代码示例

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


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

示例1: opendir

bool CConfigList::Load (void)
{
  DIR *dptr;
  struct dirent *fptr;

  dptr = opendir(m_directory);
  if (dptr == NULL) {
    error_message("Can't open directory %s", m_directory);
    return false;
  }
  
  while ((fptr = readdir(dptr)) != NULL) {
    char fname[PATH_MAX];
    sprintf(fname, "%s/%s", m_directory, fptr->d_name);
    struct stat buf;
    if (stat(fname, &buf) >= 0 &&
	S_ISREG(buf.st_mode)) {
      debug_message("trying %s", fname);
      m_config_list = CreateConfigInt(fname, m_config_list);
      m_config_list->Initialize();
      if (m_config_list->IsValid()) {
	m_config_count++;
	debug_message("loaded %s config %s", 
		      m_config_type, 
		      m_config_list->GetName());
	m_config_list->Update();
      }
    }
  }
  closedir(dptr);
  return true;
}
开发者ID:dazzle-multimedia,项目名称:mpeg4ip,代码行数:32,代码来源:config_list.cpp

示例2: debug_message

// Audio encoding main process
int CAudioEncoder::ThreadMain(void) 
{
  CMsg* pMsg;
  bool stop = false;

  debug_message("audio encoder thread %s %s %s start", Profile()->GetName(),
		Profile()->GetStringValue(CFG_AUDIO_ENCODER), 
		Profile()->GetStringValue(CFG_AUDIO_ENCODING));

  while (stop == false && SDL_SemWait(m_myMsgQueueSemaphore) == 0) {
    pMsg = m_myMsgQueue.get_message();
    if (pMsg != NULL) {
      switch (pMsg->get_value()) {
      case MSG_NODE_STOP_THREAD:
	DoStopAudio();
	stop = true;
	break;
      case MSG_NODE_START:
	// DoStartTransmit();  Anything ?
	break;
      case MSG_NODE_STOP:
	DoStopAudio();
	break;
      case MSG_SINK_FRAME: {
	uint32_t dontcare;
	CMediaFrame *mf = (CMediaFrame*)pMsg->get_message(dontcare);
	if (m_stop_thread == false)
	  ProcessAudioFrame(mf);
	if (mf->RemoveReference()) {
	  delete mf;
	}
	break;
      }
      }
      
      delete pMsg;
    }
  }
  while ((pMsg = m_myMsgQueue.get_message()) != NULL) {
    if (pMsg->get_value() == MSG_SINK_FRAME) {
      uint32_t dontcare;
      CMediaFrame *mf = (CMediaFrame*)pMsg->get_message(dontcare);
      if (mf->RemoveReference()) {
	delete mf;
      }
    }
    delete pMsg;
  }

  if (m_audioResample != NULL) {
    for (uint ix = 0; ix < m_audioDstChannels; ix++) {
      st_resample_stop(m_audioResample[ix]);
      m_audioResample[ix] = NULL;
    }
    free(m_audioResample);
  }
  CHECK_AND_FREE(m_audioPreEncodingBuffer);
  debug_message("audio encoder thread %s exit", Profile()->GetName());
  return 0;
}
开发者ID:BluePandaLi,项目名称:mpeg4ip,代码行数:61,代码来源:audio_encoder_class.cpp

示例3: msvcrt_delete

static void
msvcrt_delete(void *p)
{
  debug_message("delete(%p) called: ", p);
  w32api_mem_free(p);
  debug_message("deleted.\n");
}
开发者ID:ashie,项目名称:gimageview,代码行数:7,代码来源:msvcrt.c

示例4: restore_stat_list

static void restore_stat_list (const char * file, mudlib_stats_t ** list)
{
    FILE *f;
    char fname_buf[MAXPATHLEN];
    char *fname = fname_buf;
    mudlib_stats_t *entry;

    if (file) {
	if (strchr(file, '/')) {
	    if (file[0] == '/')
		file++;
	    f = fopen(file, "r");
	} else {
	    sprintf(fname, "%s/%s", LOG_DIR, file);
	    if (fname[0] == '/')
		fname++;
	    f = fopen(fname, "r");
	}
    } else {
	debug_message("*Warning: call to save_stat_list with null filename\n");
	return;
    }
    if (!f) {
	debug_message("*Warning: unable to open stat file %s for reading.\n",
		file);
	return;
    }
    while (fscanf(f, "%s", fname) != EOF) {
	entry = add_stat_entry(fname, list);
	fscanf(f, "%d %d\n", &entry->moves, &entry->heart_beats);
    }
    fclose(f);
}
开发者ID:BPotato,项目名称:fluffos,代码行数:33,代码来源:mudlib_stats.c

示例5: save_stat_list

static void save_stat_list (const char * file, mudlib_stats_t * list)
{
    FILE *f;
    char fname_buf[MAXPATHLEN];
    char *fname = fname_buf;

    if (file) {
	if (strchr(file, '/')) {
	    if (file[0] == '/')
		file++;
	    f = fopen(file, "w");
	} else {
	    sprintf(fname, "%s/%s", LOG_DIR, file);
	    if (fname[0] == '/')
		fname++;
	    f = fopen(fname, "w");
	}
    } else {
	debug_message("*Warning: call to save_stat_list with null filename\n");
	return;
    }
    if (!f) {
	debug_message("*Error: unable to open stat file %s for writing.\n",
		file);
	return;
    }
    while (list) {
	fprintf(f, "%s %d %d\n", list->name,
		list->moves, list->heart_beats);
	list = list->next;
    }
    fclose(f);
}
开发者ID:BPotato,项目名称:fluffos,代码行数:33,代码来源:mudlib_stats.c

示例6: ReadNextLine

static bool ReadNextLine (text_file_data_t *tptr)
{
    off_t start;
    start = ftello(tptr->m_file);
    if (fgets(tptr->m_buffer, PATH_MAX, tptr->m_file) == NULL) {
        tptr->m_max_index = tptr->m_index;
        return false;
    }
    char *end = tptr->m_buffer + strlen(tptr->m_buffer) - 1;
    while (isspace(*end) && end > tptr->m_buffer) {
        *end = '\0';
        end--;
    }
    debug_message("Read line %u %s", tptr->m_index, tptr->m_buffer);

    if (tptr->m_line_offset_tail == NULL ||
            tptr->m_line_offset_tail->index < tptr->m_index) {
        text_line_offset_t *tlptr = MALLOC_STRUCTURE(text_line_offset_t);
        tlptr->next_line = NULL;
        tlptr->index = tptr->m_index;
        tlptr->offset = start;
        if (tptr->m_line_offset_head == NULL) {
            tptr->m_line_offset_head = tptr->m_line_offset_tail = tlptr;
        } else {
            tptr->m_line_offset_tail->next_line = tlptr;
            tptr->m_line_offset_tail = tlptr;
        }
        debug_message("Add to end");
    }
    tptr->m_index++;
    return true;
}
开发者ID:qmwd2006,项目名称:mpeg4ip,代码行数:32,代码来源:text_dialog.cpp

示例7: InstallSignalHandler

void InstallSignalHandler (const char *sig,
			   void (*sighandler)(int),
			   bool setsigint)
{
  struct sigaction act;
  bool sigintset = false;

  act.sa_handler = sighandler;
  sigemptyset(&act.sa_mask);
  act.sa_flags = 0;

  int maxsigs = sizeof(sig_str_to_value) / sizeof(sig_str_to_value[0]);
  if (sig != NULL && *sig != '\0') {
    debug_message("sigals are %s", sig);
    for (int ix = 0; ix < maxsigs; ix++) {
      if (strcasestr(sig, sig_str_to_value[ix].str) != NULL) {
	debug_message("installing sig %s", sig_str_to_value[ix].str);
	sigaction(sig_str_to_value[ix].value, &act, 0);
	if (sig_str_to_value[ix].value == SIGINT) {
	  sigintset = true;
	}
      }
    }
  }

  if (setsigint && sigintset == false) {
    sigaction(SIGINT, &act, 0);
  }
}
开发者ID:BluePandaLi,项目名称:mpeg4ip,代码行数:29,代码来源:mp4live_common.cpp

示例8: GoToLine

static void GoToLine (text_file_data_t *tptr, uint index)
{
    uint ix;
    debug_message("go to line %u", index);
    if (tptr->m_line_offset_tail != NULL) {
        debug_message("tail index %u", index);
    }
    if (tptr->m_line_offset_tail != NULL &&
            tptr->m_line_offset_tail->index >= index) {
        debug_message("Looking for tail");
        text_line_offset_t *tlptr;
        for (ix = 0, tlptr = tptr->m_line_offset_head; ix < index; ix++) {
            tlptr = tlptr->next_line;
        }
        if (tlptr->index != index) {
            error_message("Seek not right %u %u", tlptr->index, index);
        }
        GoToLine(tptr, tlptr);
        return;
    }
    uint start_index = 0;
    if (tptr->m_line_offset_tail) {
        start_index = tptr->m_line_offset_tail->index;
        GoToLine(tptr, tptr->m_line_offset_tail);
    }
    for (ix = start_index; ix < index; ix++) {
        if (ReadNextLine(tptr) == false)
            return;
    }
}
开发者ID:qmwd2006,项目名称:mpeg4ip,代码行数:30,代码来源:text_dialog.cpp

示例9: debug_message

bool CMediaSource::AddSink(CMediaSink* pSink) 
{
  bool rc = false;
  int i;
  if (SDL_LockMutex(m_pSinksMutex) == -1) {
    debug_message("AddSink LockMutex error");
    return rc;
  }
  for (i = 0; i < MAX_SINKS; i++) {
    if (m_sinks[i] == pSink) {
      SDL_UnlockMutex(m_pSinksMutex);
      return true;
    }
  }
  for (i = 0; i < MAX_SINKS; i++) {
    if (m_sinks[i] == NULL) {
      m_sinks[i] = pSink;
      rc = true;
      break;
    }
  }
  if (SDL_UnlockMutex(m_pSinksMutex) == -1) {
    debug_message("UnlockMutex error");
  }
  return rc;
}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:26,代码来源:media_source.cpp

示例10: free_vector

void 
free_vector(struct vector *p)
{
    int i;
    
    if (!p->ref || --p->ref > 0)
	return;
#if 0
    if (p->ref < 0) {
	debug_message("Array reference count < 0 in free_vector.\n");
	return;
    }
#endif
#if defined(DEBUG)
    if (p == &null_vector)
    {
	p->ref = 1;
	debug_message("Tried to free the zero-size shared vector.\n");
	return;
    }
#endif
    for (i = 0; i < p->size; i++)
	free_svalue(&p->item[i]);
    num_arrays--;
    total_array_size -= sizeof (struct vector) + sizeof (struct svalue) *
	(p->size-1);
    free((char *)p);
}
开发者ID:DruSatori,项目名称:AEMud,代码行数:28,代码来源:array.c

示例11: al_store_state

bool Player::load(void)
{
   ALLEGRO_STATE state;
   al_store_state(&state, ALLEGRO_STATE_TARGET_BITMAP | ALLEGRO_STATE_BLENDER);

   bitmap = al_load_bitmap(getResource("gfx/ship.tga"));
   if (!bitmap) {
      debug_message("Error loading %s\n", getResource("gfx/ship.tga"));
      return false;
   }

   trans_bitmap = al_create_bitmap(al_get_bitmap_width(bitmap),
      al_get_bitmap_height(bitmap));
   if (!trans_bitmap) {
      debug_message("Error loading %s\n", getResource("gfx/ship_trans.tga"));
      al_destroy_bitmap(bitmap);
      return false;
   }

   /* Make a translucent copy of the ship */
   al_set_target_bitmap(trans_bitmap);
   al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO);
   al_draw_tinted_bitmap(bitmap, al_map_rgba(255, 255, 255, 160),
      0, 0, 0);
   al_restore_state(&state);

   trail_bitmap = al_load_bitmap(getResource("gfx/trail.tga"));
   if (!trail_bitmap) {
      debug_message("Error loading %s\n", getResource("gfx/trail.tga"));
      al_destroy_bitmap(bitmap);
      al_destroy_bitmap(trans_bitmap);
      return false;
   }

   icon = al_load_bitmap(getResource("gfx/ship_icon.tga"));
   if (!icon) {
      debug_message("Error loading %s\n", getResource("gfx/icon.tga"));
      al_destroy_bitmap(bitmap);
      al_destroy_bitmap(trans_bitmap);
      al_destroy_bitmap(trail_bitmap);
      return false;
   }

   highscoreBitmap = al_create_bitmap(300, 200);
   al_set_target_bitmap(highscoreBitmap);
   al_clear_to_color(al_map_rgba(0, 0, 0, 0));

   al_restore_state(&state);

   draw_radius = al_get_bitmap_width(bitmap)/2;
   radius = draw_radius / 2;

   newGame();
   reset();

   return true;
}
开发者ID:EricMayberryIV,项目名称:COP3330-Introduction-to-OOP,代码行数:57,代码来源:Player.cpp

示例12: string_list

void
string_list(void)
{
    debug_message(
        "-------------------- String Table ------------------------\n");
    table_walk_items(gdata->string_table, &list_item, NULL);
    debug_message(
        "----------------------------------------------------------\n");
}
开发者ID:4T-Shirt,项目名称:OpenJDK-Research,代码行数:9,代码来源:hprof_string.c

示例13: loader_list

void
loader_list(void)
{
    debug_message(
        "--------------------- Loader Table ------------------------\n");
    table_walk_items(gdata->loader_table, &list_item, NULL);
    debug_message(
        "----------------------------------------------------------\n");
}
开发者ID:Spencerx,项目名称:ManagedRuntimeInitiative,代码行数:9,代码来源:hprof_loader.c

示例14: object_list

void
object_list(void)
{
    debug_message( 
        "--------------------- Object Table ------------------------\n");
    table_walk_items(gdata->object_table, &list_item, NULL);
    debug_message(
        "----------------------------------------------------------\n");
}
开发者ID:KallolModak,项目名称:StockhouseTestNG,代码行数:9,代码来源:hprof_object.c

示例15: frame_list

void
frame_list(void)
{
    debug_message(
        "--------------------- Frame Table ------------------------\n");
    table_walk_items(gdata->frame_table, &list_item, NULL);
    debug_message(
        "----------------------------------------------------------\n");
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:9,代码来源:hprof_frame.c


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