[WIP] Introduce aliases DocId, DeviceId and Inode
Needs ReviewPublic

Authored by michaelh on Feb 25 2018, 10:58 AM.

Details

Reviewers
adridg
Group Reviewers
Baloo
Frameworks
Summary

This is the first step of porting away from using quint64 as Document id
and turning it into a class.

It is done by find/replace quint64 and adding #include "idutils.h" until it compiled

Test Plan

make test

Diff Detail

Repository
R293 Baloo
Branch
aliases (branched from flexible-docid)
Lint
No Linters Available
Unit
No Unit Test Coverage
michaelh created this revision.Feb 25 2018, 10:58 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 25 2018, 10:58 AM
michaelh requested review of this revision.Feb 25 2018, 10:58 AM
michaelh added a dependency: D10823: idutils: Fix typo.

This gives a bunch of warnings like

src/engine/idutils.h:48:43: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    return *(reinterpret-cast<DocId*>(arr));

Were these before...?

This gives a bunch of warnings like

src/engine/idutils.h:48:43: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     return *(reinterpret-cast<DocId*>(arr));

Were these before...?

I haven't seen those. I wouldn't have submitted it otherwise. I'll have a look, what this means.

michaelh added inline comments.Feb 25 2018, 11:39 AM
src/engine/idutils.h
49

@alexeymin: This will become

return DocumentId(devId, inode);

The warning should be gone after that.

Nice job, looks good. No compilation warnings for me, no test failures, and all functionality that I tested still works. I found a few minor formatting issues; see the below comments.

src/engine/idtreedb.cpp
80

Unintentional indentation?

src/file/extractor/result.h
44

Can we #include "idutils.h" on this file too, so we don't have to use the Baloo:: namespace prefix here and in the implementation file?

src/tools/balooshow/main.cpp
114

Ditto.

michaelh marked an inline comment as done.Feb 26 2018, 7:11 AM

@alexeymin , @ngraham: I asked IRC:kdevelop how to turn -Wstrict-aliasing on and was pointed to cmake docs. If this setting is defined in one of the cmake-files, why do they differ? Could it be an internal setting of the IDE? I'm using KDevelop and there seems to be no option to switch that on.

src/engine/idtreedb.cpp
80

I wonder how that came about.

michaelh updated this revision to Diff 28088.Feb 26 2018, 7:11 AM
michaelh marked an inline comment as done.
michaelh edited the summary of this revision. (Show Details)
  • Merge branch 'flexible-docid' of git://anongit.kde.org/baloo into aliases
  • Correct indentation
michaelh retitled this revision from Introduce aliases DocId, DeviceId and Inode to [WIP] Introduce aliases DocId, DeviceId and Inode.Feb 28 2018, 9:58 AM

This looks abandoned with 2 years of no movement. @michaelh do you still feel this is a WIP?

Restricted Application added a subscriber: kde-frameworks-devel. · View Herald TranscriptMay 30 2020, 3:53 PM