[Libreoffice-commits] core.git: Branch 'aoo/trunk' - sal/osl
Pedro Giffuni
pfg at apache.org
Sat Oct 3 21:08:00 PDT 2015
sal/osl/unx/profile.c | 9 +++------
sal/osl/w32/profile.cxx | 9 +++------
2 files changed, 6 insertions(+), 12 deletions(-)
New commits:
commit fc4e91e7288d13c40cc78bfa680c7a1e6047c087
Author: Pedro Giffuni <pfg at apache.org>
Date: Sun Oct 4 02:07:53 2015 +0000
malloc + memset (0) --> calloc
Drop useless casts while here.
diff --git a/sal/osl/unx/profile.c b/sal/osl/unx/profile.c
index da342ef..6fb8d49 100644
--- a/sal/osl/unx/profile.c
+++ b/sal/osl/unx/profile.c
@@ -1526,8 +1526,7 @@ static sal_Char* addLine(osl_TProfileImpl* pProfile, const sal_Char* Line)
if (pProfile->m_Lines == NULL)
{
pProfile->m_MaxLines = LINES_INI;
- pProfile->m_Lines = (sal_Char **)malloc(pProfile->m_MaxLines * sizeof(sal_Char *));
- memset(pProfile->m_Lines,0,pProfile->m_MaxLines * sizeof(sal_Char *));
+ pProfile->m_Lines = calloc(pProfile->m_MaxLines, sizeof(sal_Char *));
}
else
{
@@ -1568,8 +1567,7 @@ static sal_Char* insertLine(osl_TProfileImpl* pProfile, const sal_Char* Line, sa
if (pProfile->m_Lines == NULL)
{
pProfile->m_MaxLines = LINES_INI;
- pProfile->m_Lines = (sal_Char **)malloc(pProfile->m_MaxLines * sizeof(sal_Char *));
- memset(pProfile->m_Lines,0,pProfile->m_MaxLines * sizeof(sal_Char *));
+ pProfile->m_Lines = calloc(pProfile->m_MaxLines, sizeof(sal_Char *));
}
else
{
@@ -1743,8 +1741,7 @@ static sal_Bool addSection(osl_TProfileImpl* pProfile, int Line, const sal_Char*
if (pProfile->m_Sections == NULL)
{
pProfile->m_MaxSections = SECTIONS_INI;
- pProfile->m_Sections = (osl_TProfileSection *)malloc(pProfile->m_MaxSections * sizeof(osl_TProfileSection));
- memset(pProfile->m_Sections,0,pProfile->m_MaxSections * sizeof(osl_TProfileSection));
+ pProfile->m_Sections = calloc(pProfile->m_MaxSections, sizeof(osl_TProfileSection));
}
else
{
diff --git a/sal/osl/w32/profile.cxx b/sal/osl/w32/profile.cxx
index b108657..3c7ef52 100644
--- a/sal/osl/w32/profile.cxx
+++ b/sal/osl/w32/profile.cxx
@@ -1584,8 +1584,7 @@ static const sal_Char* addLine(osl_TProfileImpl* pProfile, const sal_Char* Line)
if (pProfile->m_Lines == NULL)
{
pProfile->m_MaxLines = LINES_INI;
- pProfile->m_Lines = (sal_Char **)malloc(pProfile->m_MaxLines * sizeof(sal_Char *));
- memset(pProfile->m_Lines,0,pProfile->m_MaxLines * sizeof(sal_Char *));
+ pProfile->m_Lines = calloc(pProfile->m_MaxLines, sizeof(sal_Char *));
}
else
{
@@ -1626,8 +1625,7 @@ static const sal_Char* insertLine(osl_TProfileImpl* pProfile, const sal_Char* Li
if (pProfile->m_Lines == NULL)
{
pProfile->m_MaxLines = LINES_INI;
- pProfile->m_Lines = (sal_Char **)malloc(pProfile->m_MaxLines * sizeof(sal_Char *));
- memset(pProfile->m_Lines,0,pProfile->m_MaxLines * sizeof(sal_Char *));
+ pProfile->m_Lines = calloc(pProfile->m_MaxLines, sizeof(sal_Char *));
}
else
{
@@ -1801,8 +1799,7 @@ static sal_Bool addSection(osl_TProfileImpl* pProfile, int Line, const sal_Char*
if (pProfile->m_Sections == NULL)
{
pProfile->m_MaxSections = SECTIONS_INI;
- pProfile->m_Sections = (osl_TProfileSection *)malloc(pProfile->m_MaxSections * sizeof(osl_TProfileSection));
- memset(pProfile->m_Sections,0,pProfile->m_MaxSections * sizeof(osl_TProfileSection));
+ pProfile->m_Sections = calloc(pProfile->m_MaxSections, sizeof(osl_TProfileSection));
}
else
{
More information about the Libreoffice-commits
mailing list