changeset 5534:372ea4c0afb2

Move of-ocs PKG_XXXX to inst dir and add break patch * src/of-ocs-3-break-fixes.patch, src/of-ocs-4-pkgadd-fixes.patch: new files * dist-files.mk: add ref to files
author John Donoghue <john.donoghue@ieee.org>
date Sun, 13 Sep 2020 08:15:14 -0400
parents b982f2df58cf
children 9b92b671cbdc
files dist-files.mk src/of-ocs-3-break-fixes.patch src/of-ocs-4-pkgadd-fixes.patch
diffstat 3 files changed, 343 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dist-files.mk	Fri Sep 11 18:58:09 2020 -0400
+++ b/dist-files.mk	Sun Sep 13 08:15:14 2020 -0400
@@ -500,6 +500,8 @@
   of-nurbs.mk \
   of-ocs-1-cross-fixes.patch \
   of-ocs-2-dev-fixes.patch \
+  of-ocs-3-break-fixes.patch \
+  of-ocs-4-pkgadd-fixes.patch \
   of-ocs.mk \
   of-octcdf.mk \
   of-odepkg-1-fixes.patch \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/of-ocs-3-break-fixes.patch	Sun Sep 13 08:15:14 2020 -0400
@@ -0,0 +1,255 @@
+From 5df16dfd3522c2d1c4fdf7ed28f9efefc1b64df5 Mon Sep 17 00:00:00 2001
+From: JohnD <john.donoghue@ieee.org>
+Date: Fri, 4 May 2018 08:41:26 -0400
+Subject: [PATCH] remove 'break' statement from switch statements (Bug #51510)
+
+* inst/sbn/Mcapacitors.m, inst/sbn/Mcurrentsources.m,
+  inst/sbn/Mdiode.m, inst/sbn/Mnmosfet.m, inst/sbn/Mpmosfet.m,
+  inst/sbn/Mresistors.m, inst/sbn/Mshichmanhodgesmosfet.m,
+  inst/sbn/Mvoltagesources.m: remove break; from switch statements
+---
+ inst/sbn/Mcapacitors.m           | 6 +-----
+ inst/sbn/Mcurrentsources.m       | 2 --
+ inst/sbn/Mdiode.m                | 3 ---
+ inst/sbn/Mnmosfet.m              | 2 --
+ inst/sbn/Mpmosfet.m              | 3 ---
+ inst/sbn/Mresistors.m            | 5 -----
+ inst/sbn/Mshichmanhodgesmosfet.m | 7 +------
+ inst/sbn/Mvoltagesources.m       | 8 ++------
+ 8 files changed, 4 insertions(+), 32 deletions(-)
+
+diff --git a/inst/sbn/Mcapacitors.m b/inst/sbn/Mcapacitors.m
+index fdb22b1..7c3784e 100644
+--- a/inst/sbn/Mcapacitors.m
++++ b/inst/sbn/Mcapacitors.m
+@@ -72,7 +72,6 @@ function [a,b,c] = Mcapacitors(string,parameters,parameternames,extvar,intvar,t)
+       a = [0 0 1; 0 0 -1; 0 0 0];
+       b = [0 0 0;0 0 0;-C C 1];
+       c = [0 0 0]';
+-      break
+ 
+     case "MULTICAP"
+       
+@@ -83,8 +82,6 @@ function [a,b,c] = Mcapacitors(string,parameters,parameternames,extvar,intvar,t)
+       b = [zeros(n) zeros(n); -C eye(n)];
+       c = [zeros(2*n,1)]';
+       
+-      break  
+-
+       ##NLC part
+     case "PDE_NMOS"
+       
+@@ -111,7 +108,6 @@ function [a,b,c] = Mcapacitors(string,parameters,parameternames,extvar,intvar,t)
+       a = [0 0 1; 0 0 -1; 0 0 0];
+       b = [0 0 0;0 0 0;C -C -1];
+       c = [0 0 Q-q]';
+-      break  
+ 
+     otherwise
+       error (["unknown section:" string])
+@@ -175,4 +171,4 @@ function [Q,C]=Mnmoscap(tbulk,tox,Area,Vg,Na,Nnodes,toll,maxit);
+   C = Area*C*(q*ns*xs/Vs);
+   Q = Area*Q*(q*ns*xs);
+ 
+-endfunction
+\ No newline at end of file
++endfunction
+diff --git a/inst/sbn/Mcurrentsources.m b/inst/sbn/Mcurrentsources.m
+index 707aa75..e65078c 100644
+--- a/inst/sbn/Mcurrentsources.m
++++ b/inst/sbn/Mcurrentsources.m
+@@ -71,7 +71,6 @@ function [a,b,c] = Mcurrentsources (string,parameters,parameternames,extvar,intv
+       a = zeros(2);
+       b = a;
+       c = [I -I]';
+-      break
+ 
+     case "VCCS"
+       ## Voltage controlled current source
+@@ -96,7 +95,6 @@ function [a,b,c] = Mcurrentsources (string,parameters,parameternames,extvar,intv
+       a = zeros(2);
+       b = a;
+       c = [I -I]';
+-      break
+       
+     case "VCPS"
+       ## Voltage controlled power source
+diff --git a/inst/sbn/Mdiode.m b/inst/sbn/Mdiode.m
+index 9db5410..44a4b00 100644
+--- a/inst/sbn/Mdiode.m
++++ b/inst/sbn/Mdiode.m
+@@ -74,7 +74,6 @@ function [a,b,c] = Mdiode (string,parameters,parameternames,extvar,intvar,t)
+       a = zeros(2);
+       b = [geq -geq; -geq geq];
+       c = [I ; -I] ;
+-      break
+ 
+     case "PDEsymmetric"
+ 
+@@ -102,8 +101,6 @@ function [a,b,c] = Mdiode (string,parameters,parameternames,extvar,intvar,t)
+       b = [g -g; -g g];
+       c = [I ; -I] ;
+       
+-      break
+-
+     otherwise
+       error(["unknown section:" string])
+   endswitch
+diff --git a/inst/sbn/Mnmosfet.m b/inst/sbn/Mnmosfet.m
+index 5fe4962..e2b9504 100644
+--- a/inst/sbn/Mnmosfet.m
++++ b/inst/sbn/Mnmosfet.m
+@@ -112,7 +112,6 @@ function [a,b,c]=Mnmosfet(string,parameters,parameternames,extvar,intvar,t)
+ 	   0    0       0  0];
+       
+       c = [0 -id id 0]';
+-      break;
+ 
+     case "lincap"
+ 
+@@ -153,7 +152,6 @@ function [a,b,c]=Mnmosfet(string,parameters,parameternames,extvar,intvar,t)
+       b = B+Jac;
+       c = res + B*[extvar;intvar] + C;
+ 
+-      break;
+     otherwise
+       error(["unknown option:" string]);
+   endswitch
+diff --git a/inst/sbn/Mpmosfet.m b/inst/sbn/Mpmosfet.m
+index c4fbae3..58ef919 100644
+--- a/inst/sbn/Mpmosfet.m
++++ b/inst/sbn/Mpmosfet.m
+@@ -108,7 +108,6 @@ function [a,b,c]= Mpmosfet (string,parameters,parameternames,extvar,intvar,t)
+            0    0       0   0 ];
+       
+       c =[0 -id id 0]';
+-      break;
+ 
+     case "lincap"
+       
+@@ -144,8 +143,6 @@ function [a,b,c]= Mpmosfet (string,parameters,parameternames,extvar,intvar,t)
+       b = B+Jac;
+       c = res + B*[extvar;intvar] + C;
+ 
+-      break;
+-
+     otherwise
+       error(["unknown option:" string]);
+   endswitch
+diff --git a/inst/sbn/Mresistors.m b/inst/sbn/Mresistors.m
+index e8862b9..e0d43d4 100644
+--- a/inst/sbn/Mresistors.m
++++ b/inst/sbn/Mresistors.m
+@@ -75,7 +75,6 @@ function [a,b,c] = Mresistors (string, parameters, parameternames,
+       b = [1 -1 ;-1 1]/R;
+       c = -[0; 0];
+       
+-      break
+       ##NLCpart
+     case "THERMAL"
+ 
+@@ -100,8 +99,6 @@ function [a,b,c] = Mresistors (string, parameters, parameternames,
+ 	   -2*(v1-v2)/RT -2*(v2-v1)/RT (v1-v2)^2*dRdT/RT^2];
+       c = [i1 i2 P]';
+       
+-      break;
+-      
+       case "THERMAL1D"
+       	 
+ 	 for ii=1:length(parameternames)
+@@ -123,8 +120,6 @@ function [a,b,c] = Mresistors (string, parameters, parameternames,
+ 	 b = k*(S/h)*[B(ext,ext), B(ext,int); B(int,ext), B(int,int)];
+ 	 c = zeros(N+1,1);
+       
+-      break;
+-      
+       otherwise
+       error (["unknown section:" string])
+   endswitch
+diff --git a/inst/sbn/Mshichmanhodgesmosfet.m b/inst/sbn/Mshichmanhodgesmosfet.m
+index d5a2c93..893872d 100644
+--- a/inst/sbn/Mshichmanhodgesmosfet.m
++++ b/inst/sbn/Mshichmanhodgesmosfet.m
+@@ -140,9 +140,6 @@ function [a,b,c]= Mshichmanhodgesmosfet (string,parameters,parameternames,extvar
+ 	
+ 	c = [c1;c2];
+ 	
+-
+-	break;
+-
+       case "PMOS"
+ 	
+ 	rd   = 1e6;
+@@ -218,8 +215,6 @@ function [a,b,c]= Mshichmanhodgesmosfet (string,parameters,parameternames,extvar
+ 	
+ 	c = [c1;c2];
+ 	
+-	break;
+-
+       otherwise
+ 	error(["unknown option:" string]);
+     endswitch
+@@ -329,4 +324,4 @@ function [gm,gd,ids,didT,P,dPdT,dPdvgs,dPdvds] = pmos(extvar,mu0,Cox,W,L,Vth,rd,
+   dPdvgs  = -(gm*vds);
+   dPdvds  = -(gd*vds + ids);
+   
+-endfunction
+\ No newline at end of file
++endfunction
+diff --git a/inst/sbn/Mvoltagesources.m b/inst/sbn/Mvoltagesources.m
+index b0a9819..e0a2408 100644
+--- a/inst/sbn/Mvoltagesources.m
++++ b/inst/sbn/Mvoltagesources.m
+@@ -92,7 +92,7 @@ function [a,b,c] = Mvoltagesources (string,parameters,parameternames,extvar,intv
+       a = zeros(3);
+       b = [0 0 1;0 0 -1;1 -1 0];
+       c = [0 0 -V];
+-      break
++
+       ## NLC part
+     case "sinwave"
+       for ii=1:length(parameternames)
+@@ -105,7 +105,6 @@ function [a,b,c] = Mvoltagesources (string,parameters,parameternames,extvar,intv
+       a = zeros(3);
+       b = [0 0 1;0 0 -1;1 -1 0];
+       c = [0 0 -DV]' + b * [extvar;intvar];
+-      break
+     
+     case "pwl"
+ 
+@@ -118,7 +117,6 @@ function [a,b,c] = Mvoltagesources (string,parameters,parameternames,extvar,intv
+       a = zeros(3);
+       b = [0 0 1;0 0 -1;1 -1 0];
+       c = [0 0 -DV]' + b * [extvar;intvar];
+-      break
+       
+     case "squarewave"
+       for ii=1:length(parameternames)
+@@ -144,7 +142,6 @@ function [a,b,c] = Mvoltagesources (string,parameters,parameternames,extvar,intv
+       a = zeros(3);
+       b = [0 0 1;0 0 -1;1 -1 0];
+       c = [0 0 -DV]' + b * [extvar;intvar];
+-      break
+ 
+     case "step"
+       for ii=1:length(parameternames)
+@@ -162,7 +159,6 @@ function [a,b,c] = Mvoltagesources (string,parameters,parameternames,extvar,intv
+       a = zeros(3);
+       b = [0 0 1;0 0 -1;1 -1 0];
+       c = [0 0 -DV]' + b * [extvar;intvar];
+-      break
+       
+     case "VCVS"
+       K = 1;
+@@ -175,7 +171,7 @@ function [a,b,c] = Mvoltagesources (string,parameters,parameternames,extvar,intv
+       a = zeros(5);
+       b = [0 0 0 0 1;0 0 0 0 -1;0 0 0 0 0;0 0 0 0 0;1 -1 -K K 0];
+       c = zeros(5,1);
+-      break
++
+     otherwise
+       error (["unknown section:" string])
+   endswitch
+-- 
+2.14.3
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/of-ocs-4-pkgadd-fixes.patch	Sun Sep 13 08:15:14 2020 -0400
@@ -0,0 +1,86 @@
+diff -urN ocs.orig/inst/PKG_ADD ocs/inst/PKG_ADD
+--- ocs.orig/inst/PKG_ADD	1969-12-31 19:00:00.000000000 -0500
++++ ocs/inst/PKG_ADD	2020-09-13 08:06:36.699521609 -0400
+@@ -0,0 +1,18 @@
++dirlist = {"utl", "asm", "tst", "nls", "prs", "sbn"};
++dirname = fileparts (canonicalize_file_name (mfilename ("fullpath")));
++
++if (! exist (fullfile (dirname, "inst"), "dir"))
++  ## Run this if the package is installed
++  for ii=1:length (dirlist)
++    addpath (fullfile (dirname, dirlist{ii}), "-end")
++  endfor
++else
++  ## Run this if we are testing the package without installation
++  for ii=1:length(dirlist)
++    addpath (fullfile (dirname, "inst", dirlist{ii}))
++    addpath (fullfile (dirname, "src"))
++  endfor
++endif
++
++warning ("off", "Octave:fopen-file-in-path");
++clear dirlist dirname
+diff -urN ocs.orig/inst/PKG_DEL ocs/inst/PKG_DEL
+--- ocs.orig/inst/PKG_DEL	1969-12-31 19:00:00.000000000 -0500
++++ ocs/inst/PKG_DEL	2020-09-13 08:06:53.439465439 -0400
+@@ -0,0 +1,17 @@
++dirlist = {"utl", "asm", "tst", "nls", "prs", "sbn"};
++dirname = fileparts (canonicalize_file_name (mfilename ("fullpath")));
++
++if (! exist (fullfile (dirname, "inst"), "dir"))
++  ## Run this if the package is installed
++  for ii=1:length (dirlist)
++    rmpath (fullfile (dirname, dirlist{ii}))
++  endfor
++else
++  ## Run this if we are testing the package without installation
++  for ii=1:length (dirlist)
++    rmpath (fullfile (dirname, "inst", dirlist{ii}))
++  endfor
++  rmpath (fullfile (dirname, "src"))
++endif
++
++clear dirlist dirname
+diff -urN ocs.orig/PKG_ADD ocs/PKG_ADD
+--- ocs.orig/PKG_ADD	2020-09-13 07:58:33.528279580 -0400
++++ ocs/PKG_ADD	1969-12-31 19:00:00.000000000 -0500
+@@ -1,18 +0,0 @@
+-dirlist = {"utl", "asm", "tst", "nls", "prs", "sbn"};
+-dirname = fileparts (canonicalize_file_name (mfilename ("fullpath")));
+-
+-if (! exist (fullfile (dirname, "inst"), "dir"))
+-  ## Run this if the package is installed
+-  for ii=1:length (dirlist)
+-    addpath (fullfile (dirname, "..", dirlist{ii}), "-end")
+-  endfor
+-else
+-  ## Run this if we are testing the package without installation
+-  for ii=1:length(dirlist)
+-    addpath (fullfile (dirname, "inst", dirlist{ii}))
+-    addpath (fullfile (dirname, "src"))
+-  endfor
+-endif
+-
+-warning ("off", "Octave:fopen-file-in-path");
+-clear dirlist dirname
+diff -urN ocs.orig/PKG_DEL ocs/PKG_DEL
+--- ocs.orig/PKG_DEL	2020-09-13 07:58:33.528279580 -0400
++++ ocs/PKG_DEL	1969-12-31 19:00:00.000000000 -0500
+@@ -1,17 +0,0 @@
+-dirlist = {"utl", "asm", "tst", "nls", "prs", "sbn"};
+-dirname = fileparts (canonicalize_file_name (mfilename ("fullpath")));
+-
+-if (! exist (fullfile (dirname, "inst"), "dir"))
+-  ## Run this if the package is installed
+-  for ii=1:length (dirlist)
+-    rmpath (fullfile (dirname, "..", dirlist{ii}))
+-  endfor
+-else
+-  ## Run this if we are testing the package without installation
+-  for ii=1:length (dirlist)
+-    rmpath (fullfile (dirname, "inst", dirlist{ii}))
+-  endfor
+-  rmpath (fullfile (dirname, "src"))
+-endif
+-
+-clear dirlist dirname