Skip to content

Commit

Permalink
naming convention + solving an error + OGRMiraMonDriverIdentify() ins…
Browse files Browse the repository at this point in the history
…tead of poOpenInfo->bStatOK
  • Loading branch information
AbelPau committed Apr 4, 2024
1 parent 9679657 commit d6525fe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions ogr/ogrsf_frmts/miramon/mm_wrlayr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2850,7 +2850,7 @@ static void MMGetOffsetAlignedTo8(MM_FILE_OFFSET *Offset)
// Reading integers depending on the version being read.
int MMReadGUInt64DependingOnVersion(struct MiraMonVectLayerInfo *hMiraMonLayer,
struct MM_FLUSH_INFO *FlushInfo,
GUInt64 *nUI64)
GUInt64 *pnUI64)
{
uint32_t nUL32;

Expand All @@ -2866,12 +2866,12 @@ int MMReadGUInt64DependingOnVersion(struct MiraMonVectLayerInfo *hMiraMonLayer,
FlushInfo->pBlockToBeSaved = nullptr;
return 1;
}
*nUI64 = (GUInt64)nUL32;
*pnUI64 = (GUInt64)nUL32;
}
else
{
FlushInfo->pBlockToBeSaved = (void *)nUI64;
FlushInfo->SizeOfBlockToBeSaved = sizeof(&nUI64);
FlushInfo->pBlockToBeSaved = (void *)pnUI64;
FlushInfo->SizeOfBlockToBeSaved = sizeof(*pnUI64);
if (MMReadBlockFromBuffer(FlushInfo))
{
FlushInfo->pBlockToBeSaved = nullptr;
Expand All @@ -2885,7 +2885,7 @@ int MMReadGUInt64DependingOnVersion(struct MiraMonVectLayerInfo *hMiraMonLayer,
// Reading offsets depending on the version is being read.
int MMReadOffsetDependingOnVersion(struct MiraMonVectLayerInfo *hMiraMonLayer,
struct MM_FLUSH_INFO *FlushInfo,
MM_FILE_OFFSET *nUI64)
MM_FILE_OFFSET *pnUI64)
{
uint32_t nUL32;

Expand All @@ -2901,12 +2901,12 @@ int MMReadOffsetDependingOnVersion(struct MiraMonVectLayerInfo *hMiraMonLayer,
FlushInfo->pBlockToBeSaved = nullptr;
return 1;
}
*nUI64 = (MM_FILE_OFFSET)nUL32;
*pnUI64 = (MM_FILE_OFFSET)nUL32;
}
else
{
FlushInfo->pBlockToBeSaved = (void *)nUI64;
FlushInfo->SizeOfBlockToBeSaved = sizeof(&nUI64);
FlushInfo->pBlockToBeSaved = (void *)pnUI64;
FlushInfo->SizeOfBlockToBeSaved = sizeof(*pnUI64);
if (MMReadBlockFromBuffer(FlushInfo))
{
FlushInfo->pBlockToBeSaved = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion ogr/ogrsf_frmts/miramon/mm_wrlayr.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ int MMReadFlush(struct MM_FLUSH_INFO *pFlush);
int MMReadBlockFromBuffer(struct MM_FLUSH_INFO *FlushInfo);
int MMReadGUInt64DependingOnVersion(struct MiraMonVectLayerInfo *hMiraMonLayer,
struct MM_FLUSH_INFO *FlushInfo,
GUInt64 *nUI64);
GUInt64 *pnUI64);
int MMReadOffsetDependingOnVersion(struct MiraMonVectLayerInfo *hMiraMonLayer,
struct MM_FLUSH_INFO *FlushInfo,
MM_FILE_OFFSET *nUI64);
Expand Down
2 changes: 1 addition & 1 deletion ogr/ogrsf_frmts/miramon/ogrmiramondriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static int OGRMiraMonDriverIdentify(GDALOpenInfo *poOpenInfo)
static GDALDataset *OGRMiraMonDriverOpen(GDALOpenInfo *poOpenInfo)

{
if (!poOpenInfo->bStatOK)
if (OGRMiraMonDriverIdentify(poOpenInfo) == FALSE)
return nullptr;

OGRMiraMonDataSource *poDS = new OGRMiraMonDataSource();
Expand Down

0 comments on commit d6525fe

Please sign in to comment.