vala r2412 - in trunk: . gobject vala
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r2412 - in trunk: . gobject vala
- Date: Sat, 31 Jan 2009 10:24:35 +0000 (UTC)
Author: juergbi
Date: Sat Jan 31 10:24:35 2009
New Revision: 2412
URL: http://svn.gnome.org/viewvc/vala?rev=2412&view=rev
Log:
2009-01-31 JÃrg Billeter <j bitron ch>
* vala/valaflowanalyzer.vala:
* vala/valasymbol.vala:
Report unused internal methods
* gobject/valaccodearraymodule.vala:
* gobject/valaccodeassignmentmodule.vala:
* gobject/valaccodebasemodule.vala:
* gobject/valaccodecontrolflowmodule.vala:
* gobject/valaccodedelegatemodule.vala:
* gobject/valaccodememberaccessmodule.vala:
* gobject/valaccodemethodcallmodule.vala:
* gobject/valaccodemethodmodule.vala:
* gobject/valaccodestructmodule.vala:
* gobject/valadbusclientmodule.vala:
* gobject/valadbusmodule.vala:
* gobject/valadbusservermodule.vala:
* gobject/valagasyncmodule.vala:
* gobject/valagerrormodule.vala:
* gobject/valagobjectmodule.vala:
* gobject/valagsignalmodule.vala:
* gobject/valagtypemodule.vala:
Mark modules as internal
Modified:
trunk/ChangeLog
trunk/gobject/valaccodearraymodule.vala
trunk/gobject/valaccodeassignmentmodule.vala
trunk/gobject/valaccodebasemodule.vala
trunk/gobject/valaccodecontrolflowmodule.vala
trunk/gobject/valaccodedelegatemodule.vala
trunk/gobject/valaccodememberaccessmodule.vala
trunk/gobject/valaccodemethodcallmodule.vala
trunk/gobject/valaccodemethodmodule.vala
trunk/gobject/valaccodestructmodule.vala
trunk/gobject/valadbusclientmodule.vala
trunk/gobject/valadbusmodule.vala
trunk/gobject/valadbusservermodule.vala
trunk/gobject/valagasyncmodule.vala
trunk/gobject/valagerrormodule.vala
trunk/gobject/valagobjectmodule.vala
trunk/gobject/valagsignalmodule.vala
trunk/gobject/valagtypemodule.vala
trunk/vala/valaflowanalyzer.vala
trunk/vala/valasymbol.vala
Modified: trunk/gobject/valaccodearraymodule.vala
==============================================================================
--- trunk/gobject/valaccodearraymodule.vala (original)
+++ trunk/gobject/valaccodearraymodule.vala Sat Jan 31 10:24:35 2009
@@ -24,7 +24,7 @@
using Gee;
-public class Vala.CCodeArrayModule : CCodeMethodCallModule {
+class Vala.CCodeArrayModule : CCodeMethodCallModule {
int next_array_dup_id = 0;
int next_array_add_id = 0;
Modified: trunk/gobject/valaccodeassignmentmodule.vala
==============================================================================
--- trunk/gobject/valaccodeassignmentmodule.vala (original)
+++ trunk/gobject/valaccodeassignmentmodule.vala Sat Jan 31 10:24:35 2009
@@ -28,7 +28,7 @@
/**
* The link between an assignment and generated code.
*/
-public class Vala.CCodeAssignmentModule : CCodeMemberAccessModule {
+class Vala.CCodeAssignmentModule : CCodeMemberAccessModule {
public CCodeAssignmentModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
Modified: trunk/gobject/valaccodebasemodule.vala
==============================================================================
--- trunk/gobject/valaccodebasemodule.vala (original)
+++ trunk/gobject/valaccodebasemodule.vala Sat Jan 31 10:24:35 2009
@@ -27,7 +27,7 @@
/**
* Code visitor generating C Code.
*/
-public class Vala.CCodeBaseModule : CCodeModule {
+class Vala.CCodeBaseModule : CCodeModule {
public CodeContext context { get; set; }
public Symbol root_symbol;
@@ -70,7 +70,6 @@
public CCodeEnum prop_enum;
public CCodeEnum cenum;
public CCodeFunction function;
- public CCodeBlock block;
// code nodes to be inserted before the current statement
// used by async method calls in coroutines
Modified: trunk/gobject/valaccodecontrolflowmodule.vala
==============================================================================
--- trunk/gobject/valaccodecontrolflowmodule.vala (original)
+++ trunk/gobject/valaccodecontrolflowmodule.vala Sat Jan 31 10:24:35 2009
@@ -24,7 +24,7 @@
using GLib;
using Gee;
-public class Vala.CCodeControlFlowModule : CCodeMethodModule {
+class Vala.CCodeControlFlowModule : CCodeMethodModule {
public CCodeControlFlowModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
Modified: trunk/gobject/valaccodedelegatemodule.vala
==============================================================================
--- trunk/gobject/valaccodedelegatemodule.vala (original)
+++ trunk/gobject/valaccodedelegatemodule.vala Sat Jan 31 10:24:35 2009
@@ -27,7 +27,7 @@
/**
* The link between an assignment and generated code.
*/
-public class Vala.CCodeDelegateModule : CCodeArrayModule {
+class Vala.CCodeDelegateModule : CCodeArrayModule {
public CCodeDelegateModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
Modified: trunk/gobject/valaccodememberaccessmodule.vala
==============================================================================
--- trunk/gobject/valaccodememberaccessmodule.vala (original)
+++ trunk/gobject/valaccodememberaccessmodule.vala Sat Jan 31 10:24:35 2009
@@ -24,7 +24,7 @@
using GLib;
-public class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
+class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
public CCodeMemberAccessModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
Modified: trunk/gobject/valaccodemethodcallmodule.vala
==============================================================================
--- trunk/gobject/valaccodemethodcallmodule.vala (original)
+++ trunk/gobject/valaccodemethodcallmodule.vala Sat Jan 31 10:24:35 2009
@@ -25,7 +25,7 @@
using GLib;
using Gee;
-public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
+class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
public CCodeMethodCallModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
Modified: trunk/gobject/valaccodemethodmodule.vala
==============================================================================
--- trunk/gobject/valaccodemethodmodule.vala (original)
+++ trunk/gobject/valaccodemethodmodule.vala Sat Jan 31 10:24:35 2009
@@ -27,7 +27,7 @@
/**
* The link between a method and generated code.
*/
-public class Vala.CCodeMethodModule : CCodeStructModule {
+class Vala.CCodeMethodModule : CCodeStructModule {
public CCodeMethodModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
Modified: trunk/gobject/valaccodestructmodule.vala
==============================================================================
--- trunk/gobject/valaccodestructmodule.vala (original)
+++ trunk/gobject/valaccodestructmodule.vala Sat Jan 31 10:24:35 2009
@@ -23,7 +23,7 @@
using GLib;
-public class Vala.CCodeStructModule : CCodeBaseModule {
+class Vala.CCodeStructModule : CCodeBaseModule {
public CCodeStructModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
Modified: trunk/gobject/valadbusclientmodule.vala
==============================================================================
--- trunk/gobject/valadbusclientmodule.vala (original)
+++ trunk/gobject/valadbusclientmodule.vala Sat Jan 31 10:24:35 2009
@@ -28,7 +28,7 @@
/**
* The link between a dynamic method and generated code.
*/
-public class Vala.DBusClientModule : DBusModule {
+class Vala.DBusClientModule : DBusModule {
int dynamic_property_id;
public DBusClientModule (CCodeGenerator codegen, CCodeModule? next) {
Modified: trunk/gobject/valadbusmodule.vala
==============================================================================
--- trunk/gobject/valadbusmodule.vala (original)
+++ trunk/gobject/valadbusmodule.vala Sat Jan 31 10:24:35 2009
@@ -20,7 +20,7 @@
* JÃrg Billeter <j bitron ch>
*/
-public class Vala.DBusModule : GAsyncModule {
+class Vala.DBusModule : GAsyncModule {
struct BasicTypeInfo {
public weak string signature;
public weak string type_name;
Modified: trunk/gobject/valadbusservermodule.vala
==============================================================================
--- trunk/gobject/valadbusservermodule.vala (original)
+++ trunk/gobject/valadbusservermodule.vala Sat Jan 31 10:24:35 2009
@@ -28,7 +28,7 @@
/**
* The link between a dynamic method and generated code.
*/
-public class Vala.DBusServerModule : DBusClientModule {
+class Vala.DBusServerModule : DBusClientModule {
public DBusServerModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
Modified: trunk/gobject/valagasyncmodule.vala
==============================================================================
--- trunk/gobject/valagasyncmodule.vala (original)
+++ trunk/gobject/valagasyncmodule.vala Sat Jan 31 10:24:35 2009
@@ -23,7 +23,7 @@
using GLib;
using Gee;
-public class Vala.GAsyncModule : GSignalModule {
+class Vala.GAsyncModule : GSignalModule {
public GAsyncModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
Modified: trunk/gobject/valagerrormodule.vala
==============================================================================
--- trunk/gobject/valagerrormodule.vala (original)
+++ trunk/gobject/valagerrormodule.vala Sat Jan 31 10:24:35 2009
@@ -23,7 +23,7 @@
using GLib;
using Gee;
-public class Vala.GErrorModule : CCodeDelegateModule {
+class Vala.GErrorModule : CCodeDelegateModule {
private int current_try_id = 0;
private int next_try_id = 0;
Modified: trunk/gobject/valagobjectmodule.vala
==============================================================================
--- trunk/gobject/valagobjectmodule.vala (original)
+++ trunk/gobject/valagobjectmodule.vala Sat Jan 31 10:24:35 2009
@@ -24,7 +24,7 @@
using Gee;
-public class Vala.GObjectModule : GTypeModule {
+class Vala.GObjectModule : GTypeModule {
int dynamic_property_id;
int signal_wrapper_id;
Modified: trunk/gobject/valagsignalmodule.vala
==============================================================================
--- trunk/gobject/valagsignalmodule.vala (original)
+++ trunk/gobject/valagsignalmodule.vala Sat Jan 31 10:24:35 2009
@@ -23,7 +23,7 @@
using GLib;
-public class Vala.GSignalModule : GObjectModule {
+class Vala.GSignalModule : GObjectModule {
public GSignalModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
Modified: trunk/gobject/valagtypemodule.vala
==============================================================================
--- trunk/gobject/valagtypemodule.vala (original)
+++ trunk/gobject/valagtypemodule.vala Sat Jan 31 10:24:35 2009
@@ -23,7 +23,7 @@
using GLib;
-public class Vala.GTypeModule : GErrorModule {
+class Vala.GTypeModule : GErrorModule {
public GTypeModule (CCodeGenerator codegen, CCodeModule? next) {
base (codegen, next);
}
Modified: trunk/vala/valaflowanalyzer.vala
==============================================================================
--- trunk/vala/valaflowanalyzer.vala (original)
+++ trunk/vala/valaflowanalyzer.vala Sat Jan 31 10:24:35 2009
@@ -123,17 +123,15 @@
}
public override void visit_field (Field f) {
- if (f.access != SymbolAccessibility.PUBLIC
- && f.access != SymbolAccessibility.PROTECTED
- && !f.used) {
+ if (f.is_library_internal_symbol () && !f.used) {
Report.warning (f.source_reference, "field `%s' never used".printf (f.get_full_name ()));
}
}
public override void visit_method (Method m) {
- if (m.access != SymbolAccessibility.PUBLIC
- && m.access != SymbolAccessibility.PROTECTED
- && !m.used && !m.entry_point) {
+ if (m.is_library_internal_symbol () && !m.used && !m.entry_point
+ && !m.overrides && (m.base_interface_method == null || m.base_interface_method == m)
+ && !(m is CreationMethod)) {
Report.warning (m.source_reference, "method `%s' never used".printf (m.get_full_name ()));
}
Modified: trunk/vala/valasymbol.vala
==============================================================================
--- trunk/vala/valasymbol.vala (original)
+++ trunk/vala/valasymbol.vala Sat Jan 31 10:24:35 2009
@@ -101,6 +101,17 @@
return false;
}
+ public bool is_library_internal_symbol () {
+ for (Symbol sym = this; null != sym; sym = sym.parent_symbol) {
+ if (sym.access == SymbolAccessibility.PRIVATE
+ || sym.access == SymbolAccessibility.INTERNAL) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
public Scope scope {
get { return _scope; }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]