Windows: In-depth cleanup (see details) #320

Merged
merged 1 commit into from Oct 12, 2012

Projects

None yet

4 participants

Contributor
ChrisTX commented Oct 7, 2012

This became a bit huge, so I'll detail what it does here:

  • Fix x64 builds for Windows. Now all configurations compile.
  • Remove the non-working rebase stuff.
  • Remove the Windows fork hack and instead use FreeConsole() to emulate the behavior. This directly allows us to compile with ASLR, which is turned on now.
  • Remove the old IPC mechanism for the removed GUI. This is not needed anymore as the GUI wasn't ever supported on anything newer than 1.2
  • Remove the WIN32/WINDOWS macros. _WIN32 is supported on all x86-based VC++ targets, so that's what we need.
  • Enable optimizations for release builds.
  • De-duplicate printf_c(), it was previously copy-pasted into colors.h for configure
  • Add the VC++ specific bad files in .gitignore
  • Disable PID writing on Windows. This is only making sense for *nix builds.
  • Replace the CPU usage retrieval with an algorithm analogous to the *nix behavior. Also supports separated now/total values. (Tested with a dummy busy loop - seems working)
  • Removed certain unused functions and variables
  • Replaced random/srandom with inline functions instead of exports, so this doesn't add overhead
  • Remove stdint defines from the windows wrapper
  • Remove CRT debug alloc. This is a bad idea as it would define a macro to replace free which breaks builds.
  • Re-evaluated the warnings list, commented it.

Updated:

  • Moved inspircd_config/_version to include/ to match *nix
  • Removed the creation of inspircd_se_config, as it isn't used at all.
  • Made non-git builds show as "r0" instead of "r" (thanks to @SaberUK for pointing this out)
  • Fixed up m_spanningtree's project paths. Now all configurations (debug/release x86/x64) have been tested and build properly.
  • Moved FindDNS out of the wrapper and matched its log behavior with *nix. (It's pointless having it in the wrapper after the recent slimming down)
  • Replaced random/srandom wrappers with a mechanism that tries to use Windows' Random API first is no SSL module is loaded.
  • Removed more old junk from support for compilers older than VC++ 2010 (we don't have project files for these, so compiling them would be hard anyways)
  • Removed the unused ClearConsole()
  • Removed unused includes from the wrapper. Also, do not include psapi.h here if we don't link psapi.lib. This should be done where appropriate.
  • Made inet_aton an inline function for increased performance

I don't think this will break anything since I've carefully tested it, but considering the size/amount of the changes, this should be reviewed by somebody else in a thorough manner.

Member
Adam- commented Oct 7, 2012

Three quick things:

Ignore *.dll in .gitignore. I place DLLs in win/ right before building the installer so it can package them.

Some indenting in cmd_stats.cpp and inspircd.cpp is messed up.

Contributor
ChrisTX commented Oct 8, 2012

Done, thanks for the indent hint - they showed fine in VS.

I've tested now all configurations and they work. I should however note I've only done so with VC++2012 which uses the same project files (yes - they seriously got around keeping the format this time!), so I haven't compiled it with VC++2010. There should be no difference, but who knows.

I suppose I should excuse myself for the huge amount of changes that I've stuck inside a single pull request here, but it would have been really hard to do this otherwise, as many of the changes require each other.
However, because this only affects Windows (or should only unless I've done something wrong), it should be possible to ensure this doesn't break anything.

Member
Adam- commented Oct 10, 2012

Can you check and be sure this work okay on VS 2010? If so I'll merge it

Contributor
ChrisTX commented Oct 10, 2012

I don't have VS2010, that's why I worked with 2012. I could test it but I'd need to download VS2010 first then - if anybody else would have it ready and could try it out, that'd be great.

Contributor
SaberUK commented Oct 10, 2012

I can confirm that it builds but it does have some (mostly repeated) warnings:

Warning 197 warning C4701: potentially uninitialized local variable 'cached' used   c:\users\saberuk\desktop\christx-inspircd-ab02637\src\modules\m_spanningtree\main.cpp   311 1   m_spanningtree
Warning 198 warning C4701: potentially uninitialized local variable 'cached' used   c:\users\saberuk\desktop\christx-inspircd-ab02637\src\modules\m_spanningtree\resolvers.cpp  76  1   m_spanningtree
Warning 199 warning C4701: potentially uninitialized local variable 'cached' used   c:\users\saberuk\desktop\christx-inspircd-ab02637\src\modules\m_spanningtree\resolvers.cpp  107 1   m_spanningtree
Warning 200 warning C4701: potentially uninitialized local variable 'cached' used   c:\users\saberuk\desktop\christx-inspircd-ab02637\src\modules\m_spanningtree\utils.cpp  319 1   m_spanningtree
Warning 1   warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\src\users.cpp 221 1   inspircd
Warning 2   warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 3   warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 4   warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 5   warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 6   warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 7   warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 8   warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 9   warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 10  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 11  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 12  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 13  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 14  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 15  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 16  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 17  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 18  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 19  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 20  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 21  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 22  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 23  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 24  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 25  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 26  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 27  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 28  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 29  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 30  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 31  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 32  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 33  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 34  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 35  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 36  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 37  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 38  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 39  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 40  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 41  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 42  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 43  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 44  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 45  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 46  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 47  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 48  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 49  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 50  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 51  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 52  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 53  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\cmd_whowas.cpp    inspircd
Warning 54  warning C4355: 'this' : used in base member initializer list    c:\users\saberuk\desktop\christx-inspircd-ab02637\include\inspircd.h    873 1   inspircd
Warning 55  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_allowinvite.cpp inspircd
Warning 56  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_alltime.cpp inspircd
Warning 57  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_auditorium.cpp  inspircd
Warning 58  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_autoop.cpp  inspircd
Warning 59  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_banexception.cpp    inspircd
Warning 60  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_banredirect.cpp inspircd
Warning 61  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_blockamsg.cpp   inspircd
Warning 62  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_blockcaps.cpp   inspircd
Warning 63  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_blockcolor.cpp  inspircd
Warning 64  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_botmode.cpp inspircd
Warning 65  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_callerid.cpp    inspircd
Warning 66  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_callerid.cpp    inspircd
Warning 67  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_cap.cpp inspircd
Warning 68  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_cban.cpp    inspircd
Warning 69  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_censor.cpp  inspircd
Warning 70  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_censor.cpp  inspircd
Warning 71  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_cgiirc.cpp  inspircd
Warning 72  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_cgiirc.cpp  inspircd
Warning 73  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_chanfilter.cpp  inspircd
Warning 74  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_chanhistory.cpp inspircd
Warning 75  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_chanprotect.cpp inspircd
Warning 76  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_chanprotect.cpp inspircd
Warning 77  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_check.cpp   inspircd
Warning 78  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_chghost.cpp inspircd
Warning 79  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_chgident.cpp    inspircd
Warning 80  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_chgname.cpp inspircd
Warning 81  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_cloaking.cpp    inspircd
Warning 82  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_cloaking.cpp    inspircd
Warning 83  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_cloaking.cpp    inspircd
Warning 84  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_clones.cpp  inspircd
Warning 85  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_close.cpp   inspircd
Warning 86  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_commonchans.cpp inspircd
Warning 87  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_conn_waitpong.cpp   inspircd
Warning 88  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_customtitle.cpp inspircd
Warning 89  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_cycle.cpp   inspircd
Warning 90  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_dccallow.cpp    inspircd
Warning 91  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_deaf.cpp    inspircd
Warning 92  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_delayjoin.cpp   inspircd
Warning 93  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_delayjoin.cpp   inspircd
Warning 94  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_delaymsg.cpp    inspircd
Warning 95  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_devoice.cpp inspircd
Warning 96  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_dnsbl.cpp   inspircd
Warning 97  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_dnsbl.cpp   inspircd
Warning 98  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_exemptchanops.cpp   inspircd
Warning 99  warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_filter.cpp  inspircd
Warning 100 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_filter.cpp  inspircd
Warning 101 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_globalload.cpp  inspircd
Warning 102 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_globalload.cpp  inspircd
Warning 103 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_globalload.cpp  inspircd
Warning 104 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_globops.cpp inspircd
Warning 105 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_halfop.cpp  inspircd
Warning 106 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_helpop.cpp  inspircd
Warning 107 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_helpop.cpp  inspircd
Warning 108 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_hidechans.cpp   inspircd
Warning 109 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_hideoper.cpp    inspircd
Warning 110 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_ident.cpp   inspircd
Warning 111 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_inviteexception.cpp inspircd
Warning 112 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_ircv3.cpp   inspircd
Warning 113 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_ircv3.cpp   inspircd
Warning 114 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_ircv3.cpp   inspircd
Warning 115 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_joinflood.cpp   inspircd
Warning 116 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_jumpserver.cpp  inspircd
Warning 117 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_kicknorejoin.cpp    inspircd
Warning 118 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_knock.cpp   inspircd
Warning 119 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_knock.cpp   inspircd
Warning 120 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_lockserv.cpp    inspircd
Warning 121 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_lockserv.cpp    inspircd
Warning 122 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_md5.cpp inspircd
Warning 123 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_messageflood.cpp    inspircd
Warning 124 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_mlock.cpp   inspircd
Warning 125 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_namedmodes.cpp  inspircd
Warning 126 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_namedmodes.cpp  inspircd
Warning 127 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_namesx.cpp  inspircd
Warning 128 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_nickflood.cpp   inspircd
Warning 129 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_nicklock.cpp    inspircd
Warning 130 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_nicklock.cpp    inspircd
Warning 131 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_nicklock.cpp    inspircd
Warning 132 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_noctcp.cpp  inspircd
Warning 133 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_nokicks.cpp inspircd
Warning 134 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_nonicks.cpp inspircd
Warning 135 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_nonotice.cpp    inspircd
Warning 136 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_ojoin.cpp   inspircd
Warning 137 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_operchans.cpp   inspircd
Warning 138 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_opermotd.cpp    inspircd
Warning 139 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_password_hash.cpp   inspircd
Warning 140 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_permchannels.cpp    inspircd
Warning 141 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_randquote.cpp   inspircd
Warning 142 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_redirect.cpp    inspircd
Warning 143 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_redirect.cpp    inspircd
Warning 144 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_regex_glob.cpp  inspircd
Warning 145 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_remove.cpp  inspircd
Warning 146 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_remove.cpp  inspircd
Warning 147 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_ripemd160.cpp   inspircd
Warning 148 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_rline.cpp   inspircd
Warning 149 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_rline.cpp   inspircd
Warning 150 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sajoin.cpp  inspircd
Warning 151 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sakick.cpp  inspircd
Warning 152 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_samode.cpp  inspircd
Warning 153 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sanick.cpp  inspircd
Warning 154 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sapart.cpp  inspircd
Warning 155 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_saquit.cpp  inspircd
Warning 156 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sasl.cpp    inspircd
Warning 157 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sasl.cpp    inspircd
Warning 158 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sasl.cpp    inspircd
Warning 159 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sasl.cpp    inspircd
Warning 160 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_satopic.cpp inspircd
Warning 161 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_services_account.cpp    inspircd
Warning 162 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_services_account.cpp    inspircd
Warning 163 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_services_account.cpp    inspircd
Warning 164 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_services_account.cpp    inspircd
Warning 165 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_services_account.cpp    inspircd
Warning 166 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_services_account.cpp    inspircd
Warning 167 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_servprotect.cpp inspircd
Warning 168 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sethost.cpp inspircd
Warning 169 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_setident.cpp    inspircd
Warning 170 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_setidle.cpp inspircd
Warning 171 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_setname.cpp inspircd
Warning 172 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sha256.cpp  inspircd
Warning 173 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_showwhois.cpp   inspircd
Warning 174 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_shun.cpp    inspircd
Warning 175 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_silence.cpp inspircd
Warning 176 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_silence.cpp inspircd
Warning 177 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sqlauth.cpp inspircd
Warning 178 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sqlauth.cpp inspircd
Warning 179 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sqloper.cpp inspircd
Warning 180 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sslinfo.cpp inspircd
Warning 181 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_sslmodes.cpp    inspircd
Warning 182 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_stripcolor.cpp  inspircd
Warning 183 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_stripcolor.cpp  inspircd
Warning 184 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_svshold.cpp inspircd
Warning 185 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_swhois.cpp  inspircd
Warning 186 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_testnet.cpp inspircd
Warning 187 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_timedbans.cpp   inspircd
Warning 188 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_tline.cpp   inspircd
Warning 189 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_topiclock.cpp   inspircd
Warning 190 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_topiclock.cpp   inspircd
Warning 191 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_uhnames.cpp inspircd
Warning 192 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_uninvite.cpp    inspircd
Warning 193 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_userip.cpp  inspircd
Warning 194 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_vhost.cpp   inspircd
Warning 195 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_watch.cpp   inspircd
Warning 196 warning C4355: 'this' : used in base member initializer list    C:\Users\SaberUK\Desktop\ChrisTX-inspircd-ab02637\win\m_watch.cpp   inspircd
Member
Adam- commented Oct 10, 2012

It looks like warning C4355 was ignored in the old code but removed from this change. Can you reignore it and any other exceptionally spammy warnings such as it?

Also, I just saw now you are trying to remove the VS 2008 hashmap support. This is a good thing, however it is a bit more involved than just removing some of the mess in hash_map.h. Grep the source for #if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED), anything in there can go. It's in more than a few places.

Contributor
ChrisTX commented Oct 10, 2012

I removed all warning blockers and added them on a case-by-case basis. C4355 is disabled by default since VS2012, so I haven't seen it. C4701 and C4800 have been resolved through out the source.

Updated it some more, I'd however like to get rid of the opendir/readdir/closedir wrappers as these add overhead and unnecessary complication.

Thanks again for the hint on the hash_map, I only looked for _MSC_VER in the source and didn't notice.

By the way, http://screencast.com/t/D1TXwewca <- any ideas why the whitespace looks now wrong in VS?

Member
Adam- commented Oct 10, 2012

What you're doing now in this latest change in threadengine_win32.cpp to get the error when a thread can not be created is horribly bad. .c_str() is a const char* for a reason, there is no guarantee modifying what it points to will modify the string internally. Any reason you cant use your RetrieveLastError function here?

Also, whats with all of the pointer ? true : false statements? Unless the implicit casting of the pointer to a bool is calling an overloaded bool operator I see no reason for this. If you feel that you must at least use pointer != NULL (or nullptr?).

Can you rebase or merge insp20 into this an then fix the compile error currently on head to due the files the mode handlers were in being moved around?

Contributor
ChrisTX commented Oct 11, 2012

Ugh, I really shouldn't code when I'm too tired - every time I do this, I mess something up badly.

Yes, the string thing was a shit idea, it was essentially a result of the thinking: "oh, std::string's size won't change here because I set it to 100..." except for it does because the length is due for the null terminator (and of course, compilers other than VC++ might handle .c_str() differently)

The x?a:b stuff came because of C4800. I however replaced that with nullptr/0 where appropriate now. Another stupid thinking while being tired.
Of all the C4800's, one occasion (ssl.h) did have an actual 'fix', that being replacing .length() with .empty(). This is faster. In general, C4800 should be taken seriously and reviewed because at times it's possible to re-gain speed - that's why I didn't want to disable it, but instead resolve it at the source.

Member
Adam- commented Oct 11, 2012

If we want to start using nullptr though we have to remain compatible with non C++11 compilers (most are). Use NULL for now and maybe later someone can go through and set them to nullptr while having the proper defines to not break non C++11 compilers.

Can you go through now and do an interactive rebase and do a squash into one large commit? Many of the previous commits change the same code multiple times and it is harder to follow.

Contributor
ChrisTX commented Oct 11, 2012

Oh blub, I'm used to VS which has had nullptr for ages, I'll change that.

About the rebase, I'll remove this opendir hell wrapper first, it's more code than to write a proper implementation at the single place it's used

Owner

Why remove the opendir wrapper? It's nicer to have one than #ifdefing in modmanager_dynamic.cpp

Contributor
ChrisTX commented Oct 11, 2012

Not exactly. In the UNIX version, we use opendir, and afterwards match with "cmd_.so" - this makes no sense with using FindFirstFile. It might look nicer there, but overall, you have some weird wrapper converting data structures and could combine these two calls. If we just FindFirstFile'd "cmd_.so", the subsequent call to Match can be dropped and this will increase performance.

Owner

I disagree with this change in 2.0. The performance impact of this is negligible, it runs once in the lifetime of the server when it starts up. Also the real matching is done in both cases anyway, in theory you could only get rid of a match against "*" (or not even that as the implementation can skip the matching entirely when you give it a match-all wildcard).
We'll do this properly in 2.2.

Contributor
ChrisTX commented Oct 12, 2012

Being stubborn as I am, I implemented it: http://screencast.com/t/BHK2FDlo :P
Indeed, it adds 3 #ifdefs, which looks somewhat ugly, but it's less code than the opendir wrapper is. Furthermore, this saves the weird conversion into the DIR/dirent data structures and this handle_first hack. I won't commit it if you don't like it, but since we already have a lot of #ifdef's, this makes little difference imho. Personally, I think it's easier to debug than the opendir wrapper, in case you ever have to do such.

I'm also aware this is only run once, but I dislike code being not as fast as it could be (weird psychic thing, never mind :P)
Furthermore, no this doesn't only save the match against "*", but it also allows the filesystem to perform an optimization in that it knows that only files that start with cmd_ are in question for the matching, whereas the wrapper matches all files.

Contributor
ChrisTX commented Oct 12, 2012

After some discussion, this opendir issue is likely solved better in a different way. For now, I've squashed the commits into a single on, with nullptr replaced with NULL again.

This has been tested and build successfully with VC++ and GCC.

ChrisTX Windows: In-depth cleanup (see details)
-Fix x64 builds for Windows. Now all configurations compile.
-Remove the non-working rebase stuff.
-Remove the Windows fork hack and instead use FreeConsole() to emulate the behavior. This directly allows us to compile with ASLR, which is turned on now.
-Remove the old IPC mechanism for the removed GUI. This is not needed anymore as the GUI wasn't ever supported on anything newer than 1.2
-Remove the WIN32/WINDOWS macros. _WIN32 is supported on all x86-based VC++ targets, so that's what we need.
-Enable optimizations for release builds.
-De-duplicate printf_c(), it was previously copy-pasted into colors.h for configure
-Add the VC++ specific bad files in .gitignore
-Disable PID writing on Windows. This is only making sense for *nix builds.
-Replace the CPU usage retrieval with an algorithm analogous to the *nix behavior. Also supports separated now/total values. (Tested with a dummy busy loop - seems working)
-Removed certain unused functions and variables
-Remove stdint defines from the windows wrapper
-Remove CRT debug alloc. This is a bad idea as it would define a macro to replace free which breaks builds.
-Re-evaluated the warnings list, commented it.
-Moved inspircd_config/_version to include/ to match *nix
-Removed the creation of inspircd_se_config, as it isn't used at all.
-Made non-git builds show as "r0" instead of "r" (thanks to @SaberUK for pointing this out)
-Fixed up m_spanningtree's project paths. Now all configurations (debug/release x86/x64) have been tested and build properly.
-Moved FindDNS out of the wrapper and matched its log behavior with *nix. (It's pointless having it in the wrapper after the recent slimming down)
-Replaced random/srandom wrappers with a mechanism that tries to use Windows' Random API first is no SSL module is loaded.
-Removed more old junk from support for compilers older than VC++ 2010 (we don't have project files for these, so compiling them would be hard anyways)
-Removed the unused ClearConsole()
-Removed unused includes from the wrapper. Also, do not include psapi.h here if we don't link psapi.lib. This should be done where appropriate.
-Made inet_aton an inline function for increased performance
-C4800, performance warning about bool forcing, resolved at all occurrences.
-C4701, uninitialized variable 'cached', resolved at all occurrences.
-dlerror() was migrated out of the wrapper for more thread safety (no global buffer being shared) and increased performance.
-Removed the wrong CRT debug flags. This drains a lot of performance.
-Removed the clock_gettime/gettimeofday wrappers
-Replaced all TCHAR/ANSI mix-ups of functions with the correct respective function.
-Added a block of C4355 for < VS2012
-Update project files for c870714
5b96822
@Adam- Adam- merged commit c05ad37 into inspircd:insp20 Oct 12, 2012
Owner

@ChrisTX thank you for your efforts :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment