• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ debug_message函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: debug_message

int CALSAAudioSource::ThreadMain(void) 
{
  debug_message("alsa start");
  while (true) {
    int rc;

    if (m_source) {
      rc = SDL_SemTryWait(m_myMsgQueueSemaphore);
    } else {
      rc = SDL_SemWait(m_myMsgQueueSemaphore);
    }

    // semaphore error
    if (rc == -1) {
      break;
    } 

    // message pending
    if (rc == 0) {
      CMsg* pMsg = m_myMsgQueue.get_message();
		
      if (pMsg != NULL) {
        switch (pMsg->get_value()) {
        case MSG_NODE_STOP_THREAD:
          DoStopCapture();	// ensure things get cleaned up
          delete pMsg;
          debug_message("alsa stop thread");
          return 0;
        case MSG_NODE_START:
          DoStartCapture();
          break;
        case MSG_NODE_STOP:
          DoStopCapture();
          break;
        }

        delete pMsg;
      }
    }

    if (m_source) {
      try {
        //debug_message("processaudio");
        ProcessAudio();
      }
      catch (...) {
        error_message("alsa stop capture");
        DoStopCapture();	
        break;
      }
    }
  }

  debug_message("alsa thread exit");
  return -1;
}
开发者ID:BluePandaLi,项目名称:mpeg4ip,代码行数:56,代码来源:audio_alsa_source.cpp


示例17: set_master

/* 将ob设置为master对象 */
void set_master(object_t *  ob) {
#if defined(PACKAGE_UIDS) || defined(PACKAGE_MUDLIB_STATS)
    int first_load = (!master_ob);
#endif
#ifdef PACKAGE_UIDS
    svalue_t *ret;
#endif

    get_master_applies(ob);			/* master load好之后,要apply一下? */
    master_ob = ob;
    /* Make sure master_ob is never made a dangling pointer. */
    add_ref(master_ob, "set_master");
#ifndef PACKAGE_UIDS
#  ifdef PACKAGE_MUDLIB_STATS
    if (first_load) {
        set_backbone_domain("BACKBONE");
        set_master_author("NONAME");
    }
#  endif
#else
    ret = apply_master_ob(APPLY_GET_ROOT_UID, 0);
    /* can't be -1 or we wouldn't be here */
    if (!ret) {
        debug_message("No function %s() in master object; possibly the mudlib doesn't want PACKAGE_UIDS to be defined.\n",
                      applies_table[APPLY_GET_ROOT_UID]);
        exit(-1);
    }
    if (ret->type != T_STRING) {
        debug_message("%s() in master object does not work.\n",
                      applies_table[APPLY_GET_ROOT_UID]);
        exit(-1);
    }
    if (first_load) {											/* 第一次load master? */
        master_ob->uid = set_root_uid(ret->u.string);
        master_ob->euid = master_ob->uid;
#  ifdef PACKAGE_MUDLIB_STATS
        set_master_author(ret->u.string);
#  endif
        ret = apply_master_ob(APPLY_GET_BACKBONE_UID, 0);
        if (ret == 0 || ret->type != T_STRING) {
            debug_message("%s() in the master file does not work\n",
                          applies_table[APPLY_GET_BACKBONE_UID]);		/* apply有多个,装table */
            exit(-1);
        }
        set_backbone_uid(ret->u.string);
#  ifdef PACKAGE_MUDLIB_STATS
        set_backbone_domain(ret->u.string);
#  endif
    } else {
        master_ob->uid = add_uid(ret->u.string);
        master_ob->euid = master_ob->uid;
    }
#endif
}
开发者ID:xcw0579,项目名称:mudOS,代码行数:55,代码来源:master.c


示例18: myread

void myread(int file, char *cmd, char *buffer) {
	debug_message("READ1\n");

	int len;
	mywrite(file, cmd);
	len = read(file, buffer, BUFFER_SIZE);

	if (len >= 0) buffer[len] = 0; 
	else buffer[0] = 0;

	debug_message("BUFFER: %s\n", buffer);
	debug_message("READ2\n");
}
开发者ID:ram1,项目名称:data-collector,代码行数:13,代码来源:power.c


示例19: ValidateIpAddressAndPort

// ValidateAddressAndPort does a number of things - verifies that the
// address and port are in a valid range, set all streams with similiar
// profiles to that address, and makes sure there are no duplicate addresses
void ValidateIpAddressAndPort (CMediaStreamList *stream_list, 
			       CMediaStream *s,
			       config_index_t profile_ix, 
			       config_index_t fixed_ix,
			       config_index_t addr_ix, 
			       config_index_t port_ix)
{
  bool corrected;
  debug_message("Checking %s %s %s %s:%u",
		s->GetName(),
		s->GetNameFromIndex(profile_ix),
		s->GetStringValue(profile_ix),
		s->GetStringValue(addr_ix),
		s->GetIntegerValue(port_ix));
  do {
    if (ValidateIpAddress(s->GetStringValue(addr_ix)) == false) {
      struct in_addr in;
      debug_message("Stream %s %s address was invalid \"%s\"",
		    s->GetName(),
		    s->GetNameFromIndex(profile_ix),
		    s->GetStringValue(addr_ix));
      in.s_addr = GetRandomMcastAddress();
      s->SetStringValue(addr_ix, inet_ntoa(in));
      debug_message("changed to \"%s\"", s->GetStringValue(addr_ix));
    }
    
    if (s->GetIntegerValue(port_ix) >= 0xffff ||
	ValidateIpPort(s->GetIntegerValue(port_ix)) == false) {
      debug_message("Stream %s %s address was invalid %u",
		    s->GetName(),
		    s->GetNameFromIndex(profile_ix),
		    s->GetIntegerValue(port_ix));
      s->SetIntegerValue(port_ix, GetRandomPort());
      debug_message("Changed to %u", s->GetIntegerValue(port_ix));
    }

    if (s->GetBoolValue(fixed_ix) == false) {
      SetRestOfProfile(s, profile_ix, fixed_ix, addr_ix, port_ix);
    }
    corrected = CheckAddressForDup(stream_list, 
				   s,
				   profile_ix,
				   addr_ix, 
				   port_ix);
    if (corrected == true) {
      // keep address, move port - by setting port to 0, we will trigger
      // the above 
      s->SetIntegerValue(port_ix, 0);
    }
  } while (corrected);
}
开发者ID:BluePandaLi,项目名称:mpeg4ip,代码行数:54,代码来源:media_flow.cpp


示例20: render_printmatrix

void render_printmatrix(matrix* mat) // FLAG use this? erase?
{

	debug_message("Matrix:\n");
	int i,j;
	for(i=0;i<4;i++)
	{
		for(j=0;j<4;j++)
		{
			debug_message(" %2.3f",mat->cell[i+4*j]);
		}
		debug_message("\n");
	}
}
开发者ID:adeshar00,项目名称:Skygunner,代码行数:14,代码来源:render.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ debug_msg函数代码示例发布时间:2022-05-30
下一篇:
C++ debug_log_entity_args函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap