summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-07-11 14:32:07 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-07-11 14:32:07 +0200
commitf541b99855bd70781f8d7d655ab259ff9eb596f0 (patch)
tree162ea1823d835f484f08aaaf2390a9130a23d5e9 /hwpfilter
parent545d5157f26b7fd3c5648ae6e727b1e1addca68f (diff)
loplugin:nullptr: Better heuristic to determine code shared between C and C++
Change-Id: I51e1c5fa4639e51fac90f92adf3d87d12960d589
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/drawing.h34
-rw-r--r--hwpfilter/source/hbox.h4
-rw-r--r--hwpfilter/source/hinfo.h2
-rw-r--r--hwpfilter/source/hwpfile.h2
-rw-r--r--hwpfilter/source/nodes.h10
5 files changed, 26 insertions, 26 deletions
diff --git a/hwpfilter/source/drawing.h b/hwpfilter/source/drawing.h
index c3fc245207b0..00eef6335571 100644
--- a/hwpfilter/source/drawing.h
+++ b/hwpfilter/source/drawing.h
@@ -85,7 +85,7 @@ HWPDOFuncType HWPDOFuncTbl[] =
HWPDOFreeFormFunc,
};
-static HMemIODev *hmem = NULL;
+static HMemIODev *hmem = nullptr;
static int count = 0;
@@ -299,7 +299,7 @@ static bool LoadCommonHeader(HWPDrawingObject * hdo, unsigned short * link_info)
hdo->property.contrast = 0;
hdo->property.greyscale = 0;
}
- hdo->property.pPara = NULL;
+ hdo->property.pPara = nullptr;
if( ( size > common_size ) && (hdo->property.flag & HWPDO_FLAG_AS_TEXTBOX) )
{
@@ -324,7 +324,7 @@ static HWPDrawingObject *LoadDrawingObject(void)
unsigned short link_info;
- head = prev = NULL;
+ head = prev = nullptr;
do
{
hdo = new HWPDrawingObject;
@@ -342,7 +342,7 @@ static HWPDrawingObject *LoadDrawingObject(void)
}
else
{
- switch (int res = HWPDOFunc(hdo, OBJFUNC_LOAD, NULL, 0))
+ switch (int res = HWPDOFunc(hdo, OBJFUNC_LOAD, nullptr, 0))
{
case OBJRET_FILE_ERROR:
goto error;
@@ -358,12 +358,12 @@ static HWPDrawingObject *LoadDrawingObject(void)
if (link_info & HDOFILE_HAS_CHILD)
{
hdo->child = LoadDrawingObject();
- if (hdo->child == NULL)
+ if (hdo->child == nullptr)
{
goto error;
}
}
- if (prev == NULL)
+ if (prev == nullptr)
head = hdo;
else
prev->next = hdo;
@@ -376,23 +376,23 @@ static HWPDrawingObject *LoadDrawingObject(void)
// drawing object can be list.
// hdo = current item, head = list;
- if (hdo != NULL)
+ if (hdo != nullptr)
{
if (hdo->type < 0 || hdo->type >= HWPDO_NITEMS)
{
hdo->type = HWPDO_RECT;
}
- HWPDOFunc(hdo, OBJFUNC_FREE, NULL, 0);
+ HWPDOFunc(hdo, OBJFUNC_FREE, nullptr, 0);
delete hdo;
}
if( prev )
{
- prev->next = NULL;
+ prev->next = nullptr;
return head;
}
else
- return NULL;
+ return nullptr;
}
@@ -423,7 +423,7 @@ static bool LoadDrawingObjectBlock(Picture * pic)
return false;
pic->picinfo.picdraw.hdo = LoadDrawingObject();
- if (pic->picinfo.picdraw.hdo == NULL)
+ if (pic->picinfo.picdraw.hdo == nullptr)
return false;
return true;
}
@@ -557,7 +557,7 @@ int cmd, void *argp, int argv)
{
case OBJFUNC_LOAD:
{
- hdo->u.freeform.pt = NULL;
+ hdo->u.freeform.pt = nullptr;
if (ReadSizeField(4) < 4)
return OBJRET_FILE_ERROR;
if (!hmem->read4b(hdo->u.freeform.npt))
@@ -575,7 +575,7 @@ int cmd, void *argp, int argv)
{
hdo->u.freeform.pt =
::comphelper::newArray_null<ZZPoint>(hdo->u.freeform.npt);
- if (hdo->u.freeform.pt == NULL)
+ if (hdo->u.freeform.pt == nullptr)
{
hdo->u.freeform.npt = 0;
return OBJRET_FILE_ERROR;
@@ -625,7 +625,7 @@ static void FreeParaList(HWPPara * para)
static HWPPara *LoadParaList()
{
if (!hmem)
- return NULL;
+ return nullptr;
HWPFile *hwpf = GetCurrentDoc();
HIODev *hio = hwpf->SetIODevice(hmem);
@@ -635,7 +635,7 @@ static HWPPara *LoadParaList()
hwpf->ReadParaList(plist);
hwpf->SetIODevice(hio);
- return plist.size()? plist.front() : NULL;
+ return plist.size()? plist.front() : nullptr;
}
@@ -656,7 +656,7 @@ int cmd, void *argp, int argv)
if (hdo->u.textbox.h)
{
FreeParaList(hdo->u.textbox.h);
- hdo->u.textbox.h = NULL;
+ hdo->u.textbox.h = nullptr;
}
break;
default:
@@ -690,7 +690,7 @@ HWPDrawingObject::~HWPDrawingObject()
if (next)
delete next;
- HWPDOFunc(this, OBJFUNC_FREE, NULL, 0);
+ HWPDOFunc(this, OBJFUNC_FREE, nullptr, 0);
}
#endif
diff --git a/hwpfilter/source/hbox.h b/hwpfilter/source/hbox.h
index 36b8a146467f..fd4b22a566d6 100644
--- a/hwpfilter/source/hbox.h
+++ b/hwpfilter/source/hbox.h
@@ -281,7 +281,7 @@ struct FBoxStyle
, boxnum(0)
, boxtype(0)
, cap_len(0)
- , cell(NULL)
+ , cell(nullptr)
{
memset(margin, 0, sizeof(margin));
}
@@ -521,7 +521,7 @@ struct TCell
struct Table
{
- Table() : box(NULL) {};
+ Table() : box(nullptr) {};
~Table() {
std::list<TCell*>::iterator it = cells.begin();
for( ; it != cells.end(); ++it)
diff --git a/hwpfilter/source/hinfo.h b/hwpfilter/source/hinfo.h
index b080150e30c8..d16da5d09013 100644
--- a/hwpfilter/source/hinfo.h
+++ b/hwpfilter/source/hinfo.h
@@ -87,7 +87,7 @@ struct PaperBackInfo
, flag(0)
, range(0)
, size(0)
- , data(NULL)
+ , data(nullptr)
, isset(false)
{
memset(reserved1, 0, sizeof(reserved1));
diff --git a/hwpfilter/source/hwpfile.h b/hwpfilter/source/hwpfile.h
index 497593f5fb80..36e332de80c8 100644
--- a/hwpfilter/source/hwpfile.h
+++ b/hwpfilter/source/hwpfile.h
@@ -73,7 +73,7 @@ struct ColumnInfo{
explicit ColumnInfo(int num){
start_page = num;
bIsSet = false;
- coldef = NULL;
+ coldef = nullptr;
}
};
diff --git a/hwpfilter/source/nodes.h b/hwpfilter/source/nodes.h
index 539452244d5a..60626c530d6c 100644
--- a/hwpfilter/source/nodes.h
+++ b/hwpfilter/source/nodes.h
@@ -64,9 +64,9 @@ class Node{
public:
explicit Node(int _id) : id(_id)
{
- value = NULL;
- child = NULL;
- next = NULL;
+ value = nullptr;
+ child = nullptr;
+ next = nullptr;
#ifdef NODE_DEBUG
count++;
printf("Node count : [%d]\n",count);
@@ -77,8 +77,8 @@ public:
if( value ) free( value );
// if( child ) delete child;
// if( next ) delete next;
- next = NULL;
- child = NULL;
+ next = nullptr;
+ child = nullptr;
#ifdef NODE_DEBUG
count--;
printf("Node count : [%d]\n",count);