diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-10-14 16:55:02 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-10-16 14:19:09 +0000 |
commit | a217e0d012919a4cc06ee87aa39ee49350aeb558 (patch) | |
tree | d22f58e0d58d70457b86b018370edf104affa19f | |
parent | 1a98de0ee1438c1a0dd4c59cf1016d81d8b1b7f3 (diff) |
clang-cl loplugin: hwpfilter
Change-Id: I63677cea6ee2cec0589bd853ca9b135931df63d4
Reviewed-on: https://gerrit.libreoffice.org/29863
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | hwpfilter/source/hcode.cxx | 2 | ||||
-rw-r--r-- | hwpfilter/source/htags.cxx | 8 | ||||
-rw-r--r-- | hwpfilter/source/hwpreader.cxx | 14 |
3 files changed, 12 insertions, 12 deletions
diff --git a/hwpfilter/source/hcode.cxx b/hwpfilter/source/hcode.cxx index 271eb9dd4209..e9a088c97137 100644 --- a/hwpfilter/source/hcode.cxx +++ b/hwpfilter/source/hcode.cxx @@ -1377,7 +1377,7 @@ char *hcolor2str(uchar color, uchar shade, char *buf, bool bIsChar) } } } - for (unsigned int i = 0; i < strlen(src); i++) + for (size_t i = 0; i < strlen(src); i++) { if (src[i] == '\\') { ret.push_back('/'); diff --git a/hwpfilter/source/htags.cxx b/hwpfilter/source/htags.cxx index 044f7d2a6a61..7a9ebabe82be 100644 --- a/hwpfilter/source/htags.cxx +++ b/hwpfilter/source/htags.cxx @@ -120,7 +120,7 @@ void OlePicture::Read(HWPFile & hwpf) char tname[200]; wchar_t wtname[200]; tmpnam(tname); - if (0 == (fp = fopen(tname, "wb"))) + if (nullptr == (fp = fopen(tname, "wb"))) { delete [] data; return; @@ -129,10 +129,10 @@ void OlePicture::Read(HWPFile & hwpf) delete [] data; fclose(fp); MultiByteToWideChar(CP_ACP, 0, tname, -1, wtname, 200); - if( StgOpenStorage(wtname, NULL, + if( StgOpenStorage(wtname, nullptr, STGM_READWRITE|STGM_SHARE_EXCLUSIVE|STGM_TRANSACTED, - NULL, 0, &pis) != S_OK ) { - pis = 0; + nullptr, 0, &pis) != S_OK ) { + pis = nullptr; unlink(tname); return; } diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index 3e8cf81a2969..e02301a87a02 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -1721,7 +1721,7 @@ void HwpReader::makePageStyle() if( hwpinfo.back_info.type == 1 ){ #ifdef _WIN32 padd("xlink:href", sXML_CDATA, - reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr((uchar*) urltowin(hwpinfo.back_info.filename).c_str()).c_str()))); + reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr(reinterpret_cast<uchar const *>(urltowin(hwpinfo.back_info.filename).c_str())).c_str()))); #else padd("xlink:href", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr( reinterpret_cast<uchar const *>(urltounix(hwpinfo.back_info.filename).c_str())).c_str()))); @@ -3732,7 +3732,7 @@ void HwpReader::makeHyperText(TxtBox * hbox) ::std::string const tmp = hstr2ksstr(hypert->bookmark); ::std::string const tmp2 = hstr2ksstr(kstr2hstr( #ifdef _WIN32 - (uchar *) urltowin((char *)hypert->filename).c_str()).c_str()); + reinterpret_cast<uchar const *>(urltowin(reinterpret_cast<char *>(hypert->filename)).c_str())).c_str()); #else reinterpret_cast<uchar const *>(urltounix(reinterpret_cast<char *>(hypert->filename)).c_str())).c_str()); #endif @@ -3891,7 +3891,7 @@ void HwpReader::makePicture(Picture * hbox) if ( hbox->pictype == PICTYPE_FILE ){ #ifdef _WIN32 sprintf(buf, "file:///%s", hbox->picinfo.picun.path ); - padd("xlink:href", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr((uchar *) buf).c_str()))); + padd("xlink:href", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr(reinterpret_cast<uchar *>(buf)).c_str()))); #else padd("xlink:href", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr(reinterpret_cast<uchar const *>(urltounix(hbox->picinfo.picun.path).c_str())).c_str()))); @@ -3926,19 +3926,19 @@ void HwpReader::makePicture(Picture * hbox) wchar_t pathname[200]; MultiByteToWideChar(CP_ACP, 0, hbox->picinfo.picole.embname, -1, pathname, 200); - int rc = hwpfile.oledata->pis->OpenStorage(pathname, 0, - STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_TRANSACTED, NULL, 0, &srcsto); + int rc = hwpfile.oledata->pis->OpenStorage(pathname, nullptr, + STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_TRANSACTED, nullptr, 0, &srcsto); if (rc != S_OK) { rchars(""); } else{ - rc = OleLoad(srcsto, IID_IUnknown, NULL, (LPVOID*)&pObj); + rc = OleLoad(srcsto, IID_IUnknown, nullptr, reinterpret_cast<LPVOID*>(&pObj)); if( rc != S_OK ){ srcsto->Release(); rchars(""); } else{ - std::shared_ptr<char> pStr(base64_encode_string( (uchar *)pObj, strlen((char *)pObj)), Free<char>()); + std::shared_ptr<char> pStr(base64_encode_string( reinterpret_cast<uchar *>(pObj), strlen(reinterpret_cast<char *>(pObj))), Free<char>()); rchars(ascii(pStr.get())); pObj->Release(); srcsto->Release(); |