On Fri, 22 Apr 2011 00:37:09 +0300 Sergey Senozhatsky <[email protected]> wrote:
> On (04/21/11 14:27), Kristen Carlson Accardi wrote: > > On Thu, 14 Apr 2011 13:27:23 +0300 > > Sergey Senozhatsky <[email protected]> wrote: > > > > > Catch exceptions as a reference in ahci::start/end_measurement. > > > > > > Signed-off-by: Sergey Senozhatsky <[email protected]> > > > > > > --- > > > > > > diff --git a/devices/ahci.cpp b/devices/ahci.cpp > > > index d505642..3ca52f2 100644 > > > --- a/devices/ahci.cpp > > > +++ b/devices/ahci.cpp > > > @@ -168,7 +168,8 @@ void ahci::start_measurement(void) > > > file >> start_slumber; > > > } > > > file.close(); > > > - } catch (std::ios_base::failure c) { > > > + } catch (std::ios_base::failure &c) { > > > + fprintf(stderr, "%s\n", c.what()); > > > } > > > > > > } > > > @@ -199,7 +200,8 @@ void ahci::end_measurement(void) > > > file >> end_slumber; > > > } > > > file.close(); > > > - } catch (std::ios_base::failure c) { > > > + } catch (std::ios_base::failure &c) { > > > + fprintf(stderr, "%s\n", c.what()); > > > } > > > > > > if (end_active < start_active) > > > @@ -293,4 +295,5 @@ double ahci::power_usage(struct result_bundle > > > *result, struct parameter_bundle * > > > power += util * factor / 100.0; > > > > > > return power; > > > -} > > > \ No newline at end of file > > > +} > > > + > > > > I would prefer that you do not add the extra line of whitespace to the > > end of the file. > > > > As far as I know, missed new line makes some gcc versions unhappy > (prior to 4.3 I guess) (specifically with -Werror enabled). > > > Sergey You want to add a newline after the }, but you don't need the extra newline. So your patch would replace the existing } with "}\n" and leave off the extra line. _______________________________________________ Discuss mailing list [email protected] http://lists.lesswatts.org/listinfo/discuss
