Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0039049

Browse files
committed
Fix compile-time warnings on all perl code
This patch does two things. First, it silences a number of compile-timewarnings in the msvc tools files, mainly those due to the fact that insome cases we have more than one package per file. Second it supplies adummy Perl library with just enough of the Windows API referred to inour code to let it run these checks cleanly, even on Unix machines wherethe code is never supposed to run. The dummy library should only be usedfor that purpose, as its README notes.
1 parentd3b10f0 commit0039049

File tree

9 files changed

+81
-0
lines changed

9 files changed

+81
-0
lines changed

‎src/tools/msvc/MSBuildProject.pm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use strict;
1111
use warnings;
1212
use baseqw(Project);
1313

14+
no warningsqw(redefine);## no critic
15+
1416
sub_new
1517
{
1618
my$classname =shift;
@@ -399,6 +401,8 @@ use strict;
399401
use warnings;
400402
use baseqw(MSBuildProject);
401403

404+
no warningsqw(redefine);## no critic
405+
402406
subnew
403407
{
404408
my$classname =shift;
@@ -420,6 +424,8 @@ use strict;
420424
use warnings;
421425
use baseqw(MSBuildProject);
422426

427+
no warningsqw(redefine);## no critic
428+
423429
subnew
424430
{
425431
my$classname =shift;
@@ -464,6 +470,8 @@ use strict;
464470
use warnings;
465471
use baseqw(VC2012Project);
466472

473+
no warningsqw(redefine);## no critic
474+
467475
subnew
468476
{
469477
my$classname =shift;
@@ -487,6 +495,8 @@ use strict;
487495
use warnings;
488496
use baseqw(VC2012Project);
489497

498+
no warningsqw(redefine);## no critic
499+
490500
subnew
491501
{
492502
my$classname =shift;
@@ -510,6 +520,8 @@ use strict;
510520
use warnings;
511521
use baseqw(VC2012Project);
512522

523+
no warningsqw(redefine);## no critic
524+
513525
subnew
514526
{
515527
my$classname =shift;

‎src/tools/msvc/Project.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ sub AddDir
229229

230230
if ($filtereq"LIBOBJS")
231231
{
232+
no warningsqw(once);
232233
if (grep(/$p/,@main::pgportfiles,@main::pgcommonfiles)
233234
== 1)
234235
{

‎src/tools/msvc/Solution.pm

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ use strict;
1010
use warnings;
1111
use VSObjectFactory;
1212

13+
no warningsqw(redefine);## no critic
14+
1315
sub_new
1416
{
1517
my$classname =shift;
@@ -768,6 +770,8 @@ use strict;
768770
use warnings;
769771
use baseqw(Solution);
770772

773+
no warningsqw(redefine);## no critic
774+
771775
subnew
772776
{
773777
my$classname =shift;
@@ -791,6 +795,8 @@ use strict;
791795
use warnings;
792796
use baseqw(Solution);
793797

798+
no warningsqw(redefine);## no critic
799+
794800
subnew
795801
{
796802
my$classname =shift;
@@ -815,6 +821,8 @@ use strict;
815821
use warnings;
816822
use baseqw(Solution);
817823

824+
no warningsqw(redefine);## no critic
825+
818826
subnew
819827
{
820828
my$classname =shift;
@@ -839,6 +847,8 @@ use strict;
839847
use warnings;
840848
use baseqw(Solution);
841849

850+
no warningsqw(redefine);## no critic
851+
842852
subnew
843853
{
844854
my$classname =shift;
@@ -863,6 +873,8 @@ use strict;
863873
use warnings;
864874
use baseqw(Solution);
865875

876+
no warningsqw(redefine);## no critic
877+
866878
subnew
867879
{
868880
my$classname =shift;
@@ -889,6 +901,8 @@ use strict;
889901
use warnings;
890902
use baseqw(Solution);
891903

904+
no warningsqw(redefine);## no critic
905+
892906
subnew
893907
{
894908
my$classname =shift;
@@ -915,6 +929,8 @@ use strict;
915929
use warnings;
916930
use baseqw(Solution);
917931

932+
no warningsqw(redefine);## no critic
933+
918934
subnew
919935
{
920936
my$classname =shift;

‎src/tools/msvc/VCBuildProject.pm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use strict;
1111
use warnings;
1212
use baseqw(Project);
1313

14+
no warningsqw(redefine);## no critic
15+
1416
sub_new
1517
{
1618
my$classname =shift;
@@ -268,6 +270,8 @@ use strict;
268270
use warnings;
269271
use baseqw(VCBuildProject);
270272

273+
no warningsqw(redefine);## no critic
274+
271275
subnew
272276
{
273277
my$classname =shift;
@@ -289,6 +293,8 @@ use strict;
289293
use warnings;
290294
use baseqw(VCBuildProject);
291295

296+
no warningsqw(redefine);## no critic
297+
292298
subnew
293299
{
294300
my$classname =shift;

‎src/tools/msvc/VSObjectFactory.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ our (@ISA, @EXPORT);
2020
@ISA =qw(Exporter);
2121
@EXPORT =qw(CreateSolution CreateProject DetermineVisualStudioVersion);
2222

23+
no warningsqw(redefine);## no critic
24+
2325
subCreateSolution
2426
{
2527
my$visualStudioVersion =shift;

‎src/tools/msvc/dummylib/README

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
src/tools/msvc/dummylib
3+
4+
This directory contains just enough of a dummy library to allow checking of
5+
the programs in src/tools/msvc and src/tools/win32tzlist.pl with
6+
perl -cw, even on machines that lack the Win32 perl infrastructure.
7+
8+
invoke via:
9+
10+
PERL5LIB=src/tools/msvc/dummylib perl -cw $file
11+
12+
This is the only use that should be made of this directory. Attempting actually
13+
running of any programs using this library will result in a lot of grief.

‎src/tools/msvc/dummylib/Win32.pm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
packageWin32;
2+
use strict;
3+
use warnings;
4+
1;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
packageWin32::Registry;
2+
3+
use strict;
4+
use warnings;
5+
6+
use varsqw($HKEY_LOCAL_MACHINE);
7+
8+
use Exporter ();
9+
our (@EXPORT,@ISA);
10+
@ISA =qw(Exporter);
11+
@EXPORT =qw($HKEY_LOCAL_MACHINE);
12+
13+
1;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
packageWin32API::File;
2+
3+
use strict;
4+
use warnings;
5+
6+
use constant {SEM_FAILCRITICALERRORS=> 1,SEM_NOGPFAULTERRORBOX=> 2 };
7+
subSetErrormode {};
8+
use Exporter;
9+
our(@ISA,@EXPORT_OK,%EXPORT_TAGS);
10+
@ISA =qw(Exporter);
11+
@EXPORT_OK =qw(SetErrorMode SEM_FAILCRITICALERRORS SEM_NOGPFAULTERRORBOX);
12+
%EXPORT_TAGS = (SEM_=> [qw(SEM_FAILCRITICALERRORS SEM_NOGPFAULTERRORBOX)]);
13+
14+
1;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp