GUI: fixes to save cfg files properly in the library editor

This commit is contained in:
Daniel Marjamäki 2015-09-06 08:48:13 +02:00
parent c8662a7880
commit 0e5f7fe567
2 changed files with 46 additions and 50 deletions

View File

@ -2321,9 +2321,9 @@
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="3">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
<not-uninit/>
</arg>
</function>
<!-- wchar_t * wmemcpy(wchar_t *ct, const wchar_t *cs, size_t n);-->
@ -2340,9 +2340,9 @@
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="3">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
<not-uninit/>
</arg>
</function>
<!-- void * memmove(void *ct, const void *cs, size_t n); -->
@ -2359,9 +2359,9 @@
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="3">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
<not-uninit/>
</arg>
</function>
<!-- wchar_t * wmemmove(wchar_t *ct, const wchar_t *cs, size_t n); -->
@ -2378,9 +2378,9 @@
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="3">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
<not-uninit/>
</arg>
</function>
<!-- void *memset(void *s, int c, size_t n); -->
@ -2395,9 +2395,9 @@
<not-uninit/>
</arg>
<arg nr="3">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
<not-uninit/>
</arg>
</function>
<!-- wchar_t *wmemset(wchar_t *s, wchar_t c, size_t n); -->
@ -2412,9 +2412,9 @@
<not-uninit/>
</arg>
<arg nr="3">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
<not-uninit/>
</arg>
</function>
<!-- time_t mktime(struct tm *tp); -->
@ -2754,24 +2754,24 @@
<leak-ignore/>
<formatstr scan="true"/>
<arg nr="1">
<not-uninit/>
<formatstr/>
<not-null/>
<not-uninit/>
</arg>
</function>
<!-- int vsscanf(const char *s, const char *format, va_list arg); -->
<function name="vsscanf,std::vsscanf">
<noreturn>false</noreturn>
<leak-ignore/>
<formatstr scan="true"/>
<arg nr="1">
<not-uninit/>
<not-null/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<formatstr scan="true"/>
<arg nr="2">
<formatstr/>
<not-null/>
<not-uninit/>
</arg>
<arg nr="3"/>
</function>
@ -2779,15 +2779,15 @@
<function name="vswscanf,std::vswscanf">
<noreturn>false</noreturn>
<leak-ignore/>
<formatstr scan="true"/>
<arg nr="1">
<not-uninit/>
<not-null/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<formatstr scan="true"/>
<arg nr="2">
<formatstr/>
<not-null/>
<not-uninit/>
</arg>
<arg nr="3"/>
</function>
@ -2797,9 +2797,9 @@
<leak-ignore/>
<formatstr scan="true"/>
<arg nr="1">
<not-uninit/>
<formatstr/>
<not-null/>
<not-uninit/>
</arg>
<arg nr="2"/>
</function>
@ -2850,16 +2850,6 @@
<leak-ignore/>
<arg nr="1"/>
</function>
<memory>
<dealloc>free</dealloc>
<alloc init="false">malloc</alloc>
<alloc init="true">calloc</alloc>
</memory>
<resource>
<dealloc>fclose</dealloc>
<alloc init="true">fopen</alloc>
<alloc init="true">tmpfile</alloc>
</resource>
<!-- char * strcat(char *deststr, const char *srcstr); -->
<function name="strcat,std::strcat">
<noreturn>false</noreturn>
@ -3392,9 +3382,8 @@
</function>
<!-- char *strtok(char *s, const char *ct); -->
<function name="strtok">
<!-- strtok may modify the first argument, so using the return value is not mandatory -->
<noreturn>false</noreturn>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
@ -3591,13 +3580,13 @@
<function name="sprintf">
<noreturn>false</noreturn>
<leak-ignore/>
<formatstr/>
<arg nr="1">
<minsize type="strlen" arg="2"/>
</arg>
<arg nr="2">
<not-null/>
<formatstr/>
<arg nr="2">
<formatstr/>
<not-null/>
</arg>
</function>
<!-- int swprintf(wchar_t *s, size_t n, const wchar_t *format, ...); -->
@ -3783,17 +3772,39 @@
</function>
<!-- struct tmx *zonetime(const time_t *tp, int zone); -->
<function name="zonetime">
<use-retval/>
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<arg nr="1">
<not-uninit/>
<not-null/>
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
</function>
<!--Not part of standard, but widely supported by runtime libraries-->
<function name="itoa">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-null/>
</arg>
<arg nr="3"/>
</function>
<memory>
<alloc init="false">malloc</alloc>
<alloc init="true">calloc</alloc>
<dealloc>free</dealloc>
</memory>
<resource>
<alloc init="true">fopen</alloc>
<alloc init="true">tmpfile</alloc>
<dealloc>fclose</dealloc>
</resource>
<container id="stdContainer" endPattern="&gt; !!::">
<type templateParameter="0"/>
<size>
@ -3867,8 +3878,7 @@
<container id="stdBasicString" startPattern="std :: basic_string &lt;" inherits="stdAllString">
<type templateParameter="0"/>
</container>
<container id="stdString" startPattern="std :: string|wstring|u16string|u32string" endPattern="" inherits="stdAllString">
</container>
<container id="stdString" startPattern="std :: string|wstring|u16string|u32string" endPattern="" inherits="stdAllString"/>
<podtype name="int8_t" sign="s" size="1"/>
<podtype name="int16_t" sign="s" size="2"/>
<podtype name="int32_t" sign="s" size="4"/>
@ -3919,16 +3929,4 @@
<podtype name="mbstate_t"/>
<podtype name="wint_t"/>
<podtype name="jmp_buf"/>
<!--Not part of standard, but widely supported by runtime libraries-->
<function name="itoa">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-null/>
</arg>
<arg nr="3"/>
</function>
</def>

View File

@ -243,7 +243,7 @@ static void writeContainer(QXmlStreamWriter &xmlWriter, const CppcheckLibraryDat
xmlWriter.writeAttribute("id", container.id);
if (!container.startPattern.isEmpty())
xmlWriter.writeAttribute("startPattern", container.startPattern);
if (!container.endPattern.isEmpty())
if (!container.endPattern.isNull())
xmlWriter.writeAttribute("endPattern", container.endPattern);
if (!container.inherits.isEmpty())
xmlWriter.writeAttribute("inherits", container.inherits);
@ -329,8 +329,7 @@ static void writeMemoryResource(QXmlStreamWriter &xmlWriter, const CppcheckLibra
xmlWriter.writeStartElement(mr.type);
foreach(const CppcheckLibraryData::MemoryResource::Alloc &alloc, mr.alloc) {
xmlWriter.writeStartElement("alloc");
if (alloc.init)
xmlWriter.writeAttribute("init", "true");
xmlWriter.writeAttribute("init", alloc.init ? "true" : "false");
xmlWriter.writeCharacters(alloc.name);
xmlWriter.writeEndElement();
}
@ -343,7 +342,6 @@ static void writeMemoryResource(QXmlStreamWriter &xmlWriter, const CppcheckLibra
xmlWriter.writeEndElement();
}
QString CppcheckLibraryData::toString() const
{
QString outputString;