[libcamera-devel] [PATCH 01/11] Fixes Bug 156, which breaks libcamera on Android < 12.

Nicholas Roth nicholas at rothemail.net
Thu Oct 27 23:52:46 CEST 2022


Hey, so now I'm *really* confused by the post-commit. It almost seems like
it wants me to use a mix of spaces and tabs, which I've never seen before.
Let me know what you make of this:

I start with this suggestion:
--- src/ipa/ipu3/algorithms/agc.cpp
+++ src/ipa/ipu3/algorithms/agc.cpp
@@ -101,7 +101,7 @@
        /* Configure the default exposure and gain. */
        activeState.agc.gain = std::max(minAnalogueGain_, kMinAnalogueGain);
        activeState.agc.exposure = 10ms /
-
std::chrono::duration(configuration.sensor.lineDuration);
+
 std::chrono::duration(configuration.sensor.lineDuration);

        frameCount_ = 0;
        return 0;

Then when I delete a tab as suggested, I end up with this:
--- src/ipa/ipu3/algorithms/agc.cpp
+++ src/ipa/ipu3/algorithms/agc.cpp
@@ -101,7 +101,7 @@
        /* Configure the default exposure and gain. */
        activeState.agc.gain = std::max(minAnalogueGain_, kMinAnalogueGain);
        activeState.agc.exposure = 10ms /
-
std::chrono::duration(configuration.sensor.lineDuration);
+
 std::chrono::duration(configuration.sensor.lineDuration);

        frameCount_ = 0;
        return 0;

If a mix of tabs and spaces is what's standard for us, I'll do it. I just
thought to ask first since it would be the first time I've seen a project
with this convention.

Thanks,
-Nicholas

On Thu, Oct 27, 2022 at 6:18 AM Kieran Bingham <
kieran.bingham at ideasonboard.com> wrote:

> Quoting Nicholas Roth (2022-10-27 05:24:28)
> > >  cp utils/hooks/post-commit .git/hooks/post-commit
> > The post-commits seem to want me to replace my tabs with spaces. I use
> tabs
> > to be consistent with the surrounding codebase. Is it OK to ignore these
> > errors, or should I do something else?
>
> That's odd - it shouldn't be changing tabs for spaces?
>
> What's your tabsize set to ? We use 8-character tabs.
>
>
> > Example:
> > --- src/android/camera_hal_config.cpp
> > +++ src/android/camera_hal_config.cpp
> > @@ -164,7 +164,7 @@
> >         File file(filePath);
> >         if (!file.exist()) {
> >                 LOG(HALConfig, Debug)
> > -                                       << "Configuration file: \"" <<
> > filePath << "\" not found";
> > +                       << "Configuration file: \"" << filePath << "\"
> not
> > found";
> >                 return -ENOENT;
>
> In my terminal, this change looks correct:
>
>                 LOG(HALConfig, Debug)
>                         << "Configuration file: \"" << filePath << "\" not
> found";
>
> We often take the debug print lines to the following line to allow a
> longer length without breaking the text, or hitting our line length
> limit. We only use a single indentation from the start of the previous
> line
>
> --
> Kieran
>
>
> >         }
> >
> > ---
> > 1 potential issue detected, please review
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20221027/cafe6bd2/attachment.htm>


More information about the libcamera-devel mailing list