diff options
author | Pedro Giffuni <pfg@apache.org> | 2015-10-04 02:07:53 +0000 |
---|---|---|
committer | Pedro Giffuni <pfg@apache.org> | 2015-10-04 02:07:53 +0000 |
commit | fc4e91e7288d13c40cc78bfa680c7a1e6047c087 (patch) | |
tree | ed5b06ecf4a65d7d7e04543893897dedc8fa9809 /sal | |
parent | 389cc5a97f0d3fbf88fa15b92e849d821131ba6c (diff) |
malloc + memset (0) --> calloc
Drop useless casts while here.
Notes
Notes:
merged as: 06d89e05b2dce1808a3d509c37719042b1c445d8
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/profile.c | 9 | ||||
-rw-r--r-- | sal/osl/w32/profile.cxx | 9 |
2 files changed, 6 insertions, 12 deletions
diff --git a/sal/osl/unx/profile.c b/sal/osl/unx/profile.c index da342ef08157..6fb8d4921c29 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 b108657a4182..3c7ef52a62b4 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 { |