}
}
+#ifdef MEMORY_DEBUG
static const size_t maxprint = 32;
+#endif
void check_mem_leak(const char *program_name)
{
}
if( !domain[0] && NULL != (fp=fopen("/etc/defaultdomain","r")) ) {
- fgets(domain, sizeof(domain), fp);
+ (void)fgets(domain, sizeof(domain), fp);
fclose(fp);
}
"Content-length: %lu\r\n\r\n"
"%s", page, host, (unsigned long)strlen(poststr), poststr);
- write(sockfd, sendline, strlen(sendline));
+ (void)write(sockfd, sendline, strlen(sendline));
/*while ((n = read(sockfd, recvline, MAXLINE)) > 0) {
recvline[n] = '\0';
printf("%s", recvline);
// All we can do is store NULLs for the unused namespaces.
size_t num_xml_namespaces = namespaces.size();
if (moduletype == MOD_TTCN) { //TODO remove this when ASN.1 gets EXER
- output->source.global_vars = mputprintf(output->source.global_vars,
#ifndef NDEBUG
+ output->source.global_vars = mputprintf(output->source.global_vars,
"// written by %s in " __FILE__ " at %d\n"
-#endif
- "static const size_t num_namespaces = %lu;\n"
-#ifndef NDEBUG
, __FUNCTION__, __LINE__
-#endif
- , (unsigned long)num_xml_namespaces
);
+#endif
+
if (num_xml_namespaces != 0 || (control_ns && control_ns_prefix)) {
- output->source.global_vars = mputstr(output->source.global_vars,
- "static const namespace_t xml_namespaces[num_namespaces+1] = {\n");
+ output->source.global_vars = mputprintf(output->source.global_vars,
+ "static const size_t num_namespaces = %lu;\n"
+ "static const namespace_t xml_namespaces[num_namespaces+1] = {\n"
+ , (unsigned long)num_xml_namespaces
+ );
for (size_t i=0; i < namespaces.size(); ++i) {
if (used_namespaces.has_key(i)) {
output->source.global_vars = mputprintf(output->source.global_vars,
{
size_t length = encoded_value.size();
if (0 == length) return new string();
- if (length % 2 || 0 > length) {
+ if (length % 2) {
ERROR("remove_bom(): Wrong string. The number of nibbles (%d) in string "
"shall be divisible by 2", static_cast<int>(length));
return new string(encoded_value);
{
size_t length = encoded_value.size();
if (0 == length) return new string("<unknown>");
- if (length % 2 || 0 > length) {
+ if (length % 2) {
ERROR("get_stringencoding(): Wrong string. The number of nibbles (%d) in string "
"shall be divisible by 2", static_cast<int>(length));
return new string("<unknown>");
"\"record of\"" : "\"set of\"");
} else {
// set the number of elements for arrays
- char* size_str = mprintf("%lu", get_nof_comps());
+ char* size_str = mprintf("%zu", get_nof_comps());
json.put_next_token(JSON_TOKEN_NAME, "minItems");
json.put_next_token(JSON_TOKEN_NUMBER, size_str);
json.put_next_token(JSON_TOKEN_NAME, "maxItems");
{
if ($3->get_nof_logargs() != 1) {
Location loc(infile, @1);
- loc.error("The any2unistr function takes exactly one argument, not %lu.",
+ loc.error("The any2unistr function takes exactly one argument, not %zu.",
$3->get_nof_logargs());
delete $3;
$$ = new Value(Value::OPTYPE_ANY2UNISTR, new LogArguments());
// number of lines and functions
if (p_flags & STATS_NUMBER_OF_LINES) {
- line_func_count_str = mputprintf(line_func_count_str, "%s:\t%lu lines,\t%lu functions\n",
+ line_func_count_str = mputprintf(line_func_count_str, "%s:\t%zu lines,\t%zu functions\n",
p_db[i].filename, p_db[i].lines.size(), p_db[i].functions.size());
}
total_code_lines += p_db[i].lines.size();
if (p_flags & STATS_NUMBER_OF_LINES) {
line_func_count_str = mputprintf(line_func_count_str,
"--------------------------------------\n"
- "Total:\t%lu lines,\t%lu functions\n", total_code_lines, total_functions);
+ "Total:\t%zu lines,\t%zu functions\n", total_code_lines, total_functions);
}
if (p_flags & (STATS_TOP10_ALL_DATA | STATS_ALL_DATA_SORTED)) {
class Base_Type;
#ifdef TITAN_RUNTIME_2
class Record_Of_Type;
-class Erroneous_descriptor_t;
+struct Erroneous_descriptor_t;
#else
namespace PreGenRecordOf {
class PREGEN__RECORD__OF__UNIVERSAL__CHARSTRING;
}
}
- delete metainfo;
+ delete[] metainfo;
return dec_len;
}
return isAnyAttr;
}
+ void printToFile(FILE* file) {
+ printToFile(file, 0);
+ }
void printToFile(FILE* file, unsigned level);
void dump(unsigned int depth) const;