Author: wyoung
Date: Sat Mar 4 09:30:25 2006
New Revision: 1217
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1217&view=rev
Log:
custom.pl now runs without complaint with warnings and strictness turned
on. Patch by "Waba".
Modified:
branches/v2.1-bakefile/lib/custom.pl
Modified: branches/v2.1-bakefile/lib/custom.pl
URL:
http://svn.gna.org/viewcvs/mysqlpp/branches/v2.1-bakefile/lib/custom.pl?rev=1217&r1=1216&r2=1217&view=diff
==============================================================================
--- branches/v2.1-bakefile/lib/custom.pl (original)
+++ branches/v2.1-bakefile/lib/custom.pl Sat Mar 4 09:30:25 2006
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
########################################################################
# custom.pl - Generates custom.h and custom-macros.h, as these files
@@ -38,6 +38,8 @@
# No user-serviceable parts below.
+use strict;
+
open (OUT0, ">custom.h");
open (OUT, ">custom-macros.h");
@@ -65,9 +67,9 @@
}
---
[EMAIL PROTECTED] = ("char", "unsigned char", "tiny_int", "int", "unsigned int",
+my @types = ("char", "unsigned char", "tiny_int", "int", "unsigned int",
"short int", "unsigned short int");
-foreach $type (@types) {
+foreach my $type (@types) {
print OUT0 << "---";
inline int sql_cmp($type a,$type b) {
@@ -77,7 +79,7 @@
}
@types = ("double", "float");
-foreach $type (@types) {
+foreach my $type (@types) {
print OUT0 << "---";
inline int sql_cmp($type a,$type b) {
@@ -89,7 +91,7 @@
}
@types = ("longlong", "ulonglong");
-foreach $type (@types) {
+foreach my $type (@types) {
print OUT0 << "---";
inline int sql_cmp($type a,$type b) {
@@ -140,7 +142,9 @@
{return sql_compare_##NAME<mysqlpp::sql_dummy>(*this,other);}
---
-foreach $j (1..$max_data_members) {
+my ($parm0, $parm1);
+
+foreach my $j (1..$max_data_members) {
$parm0 .= "T$j, C$j";
$parm0 .= ", " unless $j == $max_data_members;
$parm1 .= "C$j";
@@ -166,11 +170,13 @@
// ---------------------------------------------------
---
-foreach $i (1..$max_data_members) {
+
+foreach my $i (1..$max_data_members) {
+ my ($compr, $define, $compp, $set, $parm2);
$compr = ""; $parm2 = ""; $define = "";
$compr = " int cmp; \\\n" unless $i == 1;
$compp = "";
- foreach $j (1..$i) {
+ foreach my $j (1..$i) {
$compr .= " if (cmp = mysqlpp::sql_cmp(x.C$j , y.C$j )) return cmp;
\\\n"
unless $j == $i;
$compr .= " return mysqlpp::sql_cmp(x.C$j , y.C$j );" if $j == $i;
@@ -228,20 +234,20 @@
---
-foreach $i (1..$max_data_members) {
- $parm_complete = "";
- $parm_order = ""; $parm_order2c = "";
- $parm_simple = ""; $parm_simple2c = "";
- $parm_simple_b = ""; $parm_simple2c_b = "";
- $parm_names = ""; $parm_names2c = "";
- $defs = ""; $popul = ""; $parmc = ""; $parmC = "";
- $value_list = ""; $field_list = ""; $equal_list = "";
- $value_list_cus = ""; $cus_field_list = ""; $cus_equal_list = "";
- $create_bool = ""; $create_list = "";
- $cusparms1 = ""; $cusparms2 = ""; $cusparmsv = "";
- $cusparms11 = ""; $cusparms22 = "";
- $names = "";$enums = "";
- foreach $j (1 .. $i) {
+foreach my $i (1..$max_data_members) {
+ my $parm_complete = "";
+ my $parm_order = ""; my $parm_order2c = "";
+ my $parm_simple = ""; my $parm_simple2c = "";
+ my $parm_simple_b = ""; my $parm_simple2c_b = "";
+ my $parm_names = ""; my $parm_names2c = "";
+ my $defs = ""; my $popul = ""; my $parmc = ""; my $parmC = "";
+ my $value_list = ""; my $field_list = ""; my $equal_list = "";
+ my $value_list_cus = ""; my $cus_field_list = ""; my $cus_equal_list = "";
+ my $create_bool = ""; my $create_list = "";
+ my $cusparms1 = ""; my $cusparms2 = ""; my $cusparmsv = "";
+ my $cusparms11 = ""; my $cusparms22 = "";
+ my $names = "";my $enums = "";
+ foreach my $j (1 .. $i) {
$parm_complete .= "T$j, I$j, N$j, O$j";
$parm_complete .= ", " unless $j == $i;
$parm_order .= "T$j, I$j, O$j";
@@ -315,7 +321,7 @@
$parmc .= "I$j";
$parmc .= ", " unless $j == $max_data_members;
}
- foreach $j ($i+1 .. $max_data_members) {
+ foreach my $j ($i+1 .. $max_data_members) {
$parmC .= "0, 0";
$parmC .= ", " unless $j == $max_data_members;
$parmc .= "0";
@@ -327,7 +333,7 @@
// Begin Create $i
// ---------------------------------------------------
---
- $out = <<"---";
+ my $out = <<"---";
#define sql_create_basic_c_order_$i(NAME, CMP, CONTR, $parm_order)
struct NAME;
@@ -878,7 +884,7 @@
sub prepare {
- local $_ = @_[0];
+ local $_ = $_[0];
s/\n+$//;
s/\n[\n ]*\n/\n/g;
s/\n+/\\\n/g;
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits