[haiku-commits] Re: r42036 - haiku/trunk/src/add-ons/kernel/file_systems/ramfs

  • From: "Ingo Weinhold" <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 08 Jun 2011 04:32:01 +0200


> ----- Ursprüngliche Nachricht -----
> Von: kallisti5@xxxxxxxxxxx
> Gesendet: 08.06.11 02:42 Uhr
> An: haiku-commits@xxxxxxxxxxxxx
> Betreff: [haiku-commits] r42036 - 
> haiku/trunk/src/add-ons/kernel/file_systems/ramfs
> 
> Author: kallisti5
> Date: 2011-06-08 02:42:51 +0200 (Wed, 08 Jun 2011)
> New Revision: 42036
> Changeset: https://dev.haiku-os.org/changeset/42036
> 
> Modified:
>  haiku/trunk/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp
> Log:
> first round of style cleanup on ramfs driver; change node _dir to pointer in 
> ramfs_lookup function
> 
> Modified: 
> haiku/trunk/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp
> ===================================================================
> --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp 
> 2011-06-08 00:27:31 UTC (rev 42035)
> +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp 
> 2011-06-08 00:42:51 UTC (rev 42036)
[...]
> @@ -734,28 +751,32 @@
>  // FileCookie
>  class FileCookie {
>  public:
> - FileCookie(int openMode) : fOpenMode(openMode), fLastNotificationTime(0) {}
> + FileCookie(int openMode) : fOpenMode(openMode),
> + fLastNotificationTime(0) {}
>  
> - inline int GetOpenMode() { return fOpenMode; }
> + inline int GetOpenMode() { return fOpenMode; }
>  
> - inline bigtime_t GetLastNotificationTime()
> - { return fLastNotificationTime; }
> + inline bigtime_t GetLastNotificationTime()
> + { return fLastNotificationTime; }
>  
> - inline bool NotificationIntervalElapsed(bool set = false)
> - {
> - bigtime_t currentTime = system_time();
> - bool result = (currentTime - fLastNotificationTime
> - > kNotificationInterval);
> - if (set && result)
> - fLastNotificationTime = currentTime;
> - return result;
> - }
> + inline bool NotificationIntervalElapsed(bool set = false)
> + {
> + bigtime_t currentTime = system_time();
> + bool result = (currentTime
> + - fLastNotificationTime
> + > kNotificationInterval);
> + if (set && result)
> + fLastNotificationTime = currentTime;
>  
> + return result;
> + }
>  private:
> - int fOpenMode;
> - bigtime_t fLastNotificationTime;
> + int fOpenMode;
> + bigtime_t fLastNotificationTime;
>  };

For classes implemented fully in the class definition simple indentation (no 
columns) is fine. Otherwise one gets exactly such results for multi-line 
methods as we see here for NotificationIntervalElapsed(). Either pull the 
method out of the class definition or undo this change. The implementation 
blocks for GetOpenMode() and GetLastNotificationTime() should be changed, 
though (to normal multi-line blocks).

CU, Ingo

Other related posts: