[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdesdk/ebn/krazy/plugins
From:       Allen Winter <winter () kde ! org>
Date:       2007-02-01 0:18:49
Message-ID: 1170289129.566523.22514.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 628939 by winterz:

Now complains about any constructor that can take only 1 argument.

so the following constructors should all be explicit:
   ctor(QString str);
   ctor(QString str=0);
   ctor(QString str, int i=0);
   ctor(QString str=0, int i=0);

CCMAIL: bramschoenmakers@kde.nl


 M  +8 -6      explicit  


--- trunk/KDE/kdesdk/ebn/krazy/plugins/explicit #628938:628939
@@ -23,6 +23,14 @@
 ###############################################################################
 
 # Tests KDE source for C++ constructors that should be declared explicit.
+# Each constructor that may take only one argument should be marked explicit
+# unless the whole point of the constructor is to allow implicit casting.
+#
+# so the following constructors should all be explicit:
+#   ctor(QString str);
+#   ctor(QString str=0);
+#   ctor(QString str, int i=0);
+#   ctor(QString str=0, int i=0);
 
 # Program options:
 #   --help:          print one-line help message and exit
@@ -180,13 +188,7 @@
       $args = $l;
       $args =~ s/^[[:space:]]*$cname[[:space:]]*\(//;
       ($a1,$a2) = split(",",$args);
-      return 0 if ($a1 =~ m/=/);
       return 0 if ($a2 !~ m/=/);
-    } else {
-      # a constructor with only 1 arg
-      $args = $l;
-      $args =~ s/^[[:space:]]*$cname[[:space:]]*\(//;
-      return 0 if ($args =~ m/=/);
     }
   } else {
     # not a constructor
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic