Fix some clang warnings with -Wmissing-braces in pdfium.
[pdfium.git] / core / src / fxcrt / fx_basic_plex.cpp
1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "../../include/fxcrt/fx_memory.h"
8 #include "plex.h"
9
10 CFX_Plex* CFX_Plex::Create(CFX_Plex*& pHead, FX_DWORD nMax, FX_DWORD cbElement)
11 {
12     CFX_Plex* p = (CFX_Plex*)FX_Alloc(uint8_t, sizeof(CFX_Plex) + nMax * cbElement);
13     p->pNext = pHead;
14     pHead = p;
15     return p;
16 }
17 void CFX_Plex::FreeDataChain()
18 {
19     CFX_Plex* p = this;
20     while (p != NULL) {
21         uint8_t* bytes = (uint8_t*)p;
22         CFX_Plex* pNext = p->pNext;
23         FX_Free(bytes);
24         p = pNext;
25     }
26 }