summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/AVS/acc.cpp12
-rw-r--r--plugins/AssocMgr/assoclist.c42
-rw-r--r--plugins/AssocMgr/dde.c16
-rw-r--r--plugins/AssocMgr/main.c8
-rw-r--r--plugins/AssocMgr/reg.c166
-rw-r--r--plugins/AssocMgr/test.c92
-rw-r--r--plugins/AssocMgr/utils.c16
-rw-r--r--plugins/Boltun/boltun.cpp10
-rw-r--r--plugins/Boltun/config.cpp2
-rw-r--r--plugins/BossKeyPlus/BossKey.cpp4
-rw-r--r--plugins/BuddyExpectator/options.cpp2
-rw-r--r--plugins/CSList/strpos.h2
-rw-r--r--plugins/Chat/richutil.c4
-rw-r--r--plugins/Clist_nicer/CLUIFrames/cluiframes.cpp4
-rw-r--r--plugins/Clist_nicer/CLUIFrames/framesmenu.cpp2
-rw-r--r--plugins/Clist_nicer/INCLUDE/rowheight_funcs.h4
-rw-r--r--plugins/Clist_nicer/SRC/CLCButton.cpp10
-rw-r--r--plugins/Clist_nicer/SRC/Docking.cpp2
-rw-r--r--plugins/Clist_nicer/SRC/alphablend.cpp2
-rw-r--r--plugins/Clist_nicer/SRC/clcitems.cpp14
-rw-r--r--plugins/Clist_nicer/SRC/clcopts.cpp20
-rw-r--r--plugins/Clist_nicer/SRC/clcpaint.cpp34
-rw-r--r--plugins/Clist_nicer/SRC/clcutils.cpp10
-rw-r--r--plugins/Clist_nicer/SRC/clistevents.cpp2
-rw-r--r--plugins/Clist_nicer/SRC/clistmenus.cpp2
-rw-r--r--plugins/Clist_nicer/SRC/clistmod.cpp2
-rw-r--r--plugins/Clist_nicer/SRC/clistopts.cpp2
-rw-r--r--plugins/Clist_nicer/SRC/clistsettings.cpp2
-rw-r--r--plugins/Clist_nicer/SRC/clui.cpp4
-rw-r--r--plugins/Clist_nicer/SRC/cluiopts.cpp8
-rw-r--r--plugins/Clist_nicer/SRC/cluiservices.cpp6
-rw-r--r--plugins/Clist_nicer/SRC/contact.cpp8
-rw-r--r--plugins/Clist_nicer/SRC/extBackg.cpp62
-rw-r--r--plugins/Clist_nicer/SRC/init.cpp6
-rw-r--r--plugins/Clist_nicer/SRC/rowheight_funcs.cpp4
-rw-r--r--plugins/Clist_nicer/SRC/statusbar.cpp6
-rw-r--r--plugins/Clist_nicer/SRC/statusfloater.cpp42
-rw-r--r--plugins/Clist_nicer/SRC/viewmodes.cpp20
-rw-r--r--plugins/Clist_nicer/coolsb/coolsblib.cpp94
-rw-r--r--plugins/Clist_nicer/coolsb/coolscroll.cpp38
-rw-r--r--plugins/ContactsPlus/contacts.vcxproj2
-rw-r--r--plugins/ContactsPlus/send.cpp2
-rw-r--r--plugins/ContactsPlus/utils.cpp6
-rw-r--r--plugins/CountryFlags/countrylistext.c4
-rw-r--r--plugins/CountryFlags/extraimg.c14
-rw-r--r--plugins/CountryFlags/huffman.c48
-rw-r--r--plugins/CountryFlags/icons.c2
-rw-r--r--plugins/CountryFlags/ip2country.c22
-rw-r--r--plugins/CountryFlags/main.c6
-rw-r--r--plugins/CountryFlags/utils.c10
-rw-r--r--plugins/CryptoPP/GPGw/gpg.c26
-rw-r--r--plugins/CryptoPP/GPGw/main.c40
-rw-r--r--plugins/CryptoPP/GPGw/pipeexec.c12
-rw-r--r--plugins/CryptoPP/GPGw/tools.c2
-rw-r--r--plugins/CryptoPP/PGPw/main.cpp6
-rw-r--r--plugins/CryptoPP/base16.cpp4
-rw-r--r--plugins/CryptoPP/base64.cpp2
-rw-r--r--plugins/CryptoPP/commonheaders.cpp14
-rw-r--r--plugins/CryptoPP/cpp_cntx.cpp38
-rw-r--r--plugins/CryptoPP/cpp_gpgw.cpp30
-rw-r--r--plugins/CryptoPP/cpp_keys.cpp18
-rw-r--r--plugins/CryptoPP/cpp_misc.cpp24
-rw-r--r--plugins/CryptoPP/cpp_pgpw.cpp34
-rw-r--r--plugins/CryptoPP/cpp_rsam.cpp152
-rw-r--r--plugins/CryptoPP/cpp_rsau.cpp22
-rw-r--r--plugins/CryptoPP/cpp_rsau.h10
-rw-r--r--plugins/CryptoPP/cpp_svcs.cpp28
-rw-r--r--plugins/CryptoPP/crypto/crc.cpp2
-rw-r--r--plugins/CryptoPP/crypto/des.cpp4
-rw-r--r--plugins/CryptoPP/crypto/gzip.cpp4
-rw-r--r--plugins/CryptoPP/crypto/mars.cpp2
-rw-r--r--plugins/CryptoPP/crypto/osrng.cpp2
-rw-r--r--plugins/CryptoPP/main.cpp2
-rw-r--r--plugins/Db3x/dbcache.c2
-rw-r--r--plugins/Db3x/dbcontacts.c2
-rw-r--r--plugins/Db3x/dbevents.c12
-rw-r--r--plugins/Db3x/dbsettings.c12
-rw-r--r--plugins/Db3x_mmap/dbcache.c2
-rw-r--r--plugins/Db3x_mmap/dbcontacts.c2
-rw-r--r--plugins/Db3x_mmap/dbevents.c12
-rw-r--r--plugins/Db3x_mmap/dbsettings.c10
-rw-r--r--plugins/Db_autobackups/backup.c8
-rw-r--r--plugins/Db_autobackups/options.c6
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/aggressive.cpp6
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/contactchain.cpp4
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/disk.cpp6
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/encryption.cpp10
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/eventchain.cpp12
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/finaltasks.cpp4
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/initialchecks.cpp4
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/langpack.cpp18
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp6
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/progress.cpp6
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/selectdb.cpp12
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/settingschain.cpp8
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/user.cpp4
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/wizard.cpp10
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/worker.cpp2
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/encryption.c12
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/mirabilis.c34
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/miranda.c4
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c4
-rw-r--r--plugins/Dbx_mmap_SA/dbcache.c2
-rw-r--r--plugins/Dbx_mmap_SA/dbcontacts.c2
-rw-r--r--plugins/Dbx_mmap_SA/dbevents.c12
-rw-r--r--plugins/Dbx_mmap_SA/dbsettings.c14
-rw-r--r--plugins/Dbx_mmap_SA/dialogs.c28
-rw-r--r--plugins/Dbx_mmap_SA/security.c22
-rw-r--r--plugins/Dbx_tree/sigslot.h56
-rw-r--r--plugins/ExternalAPI/m_assocmgr.h4
-rw-r--r--plugins/ExternalAPI/m_flags.h4
-rw-r--r--plugins/ExternalAPI/m_help.h2
-rw-r--r--plugins/ExternalAPI/m_mails.h2
-rw-r--r--plugins/FavContacts/src/main.cpp4
-rw-r--r--plugins/FingerPrintModPlus/src/fingerprint.cpp64
-rw-r--r--plugins/FingerPrintModPlus/src/utilities.cpp26
-rw-r--r--plugins/FlashAvatars/TigerHash.cpp2
-rw-r--r--plugins/FlashAvatars/cflash.cpp37
-rw-r--r--plugins/FlashAvatars/stdafx.h5
-rw-r--r--plugins/FloatingContacts/bitmap_funcs.cpp105
-rw-r--r--plugins/FloatingContacts/bitmap_funcs.h2
-rw-r--r--plugins/FloatingContacts/filedrop.cpp52
-rw-r--r--plugins/FloatingContacts/filedrop.h2
-rw-r--r--plugins/FloatingContacts/main.cpp629
-rw-r--r--plugins/FloatingContacts/options.cpp70
-rw-r--r--plugins/FloatingContacts/thumbs.cpp170
-rw-r--r--plugins/FreeImage/Miranda/main.cpp24
-rw-r--r--plugins/FreeImage/Source/FreeImage/BitmapAccess.cpp32
-rw-r--r--plugins/FreeImage/Source/FreeImage/Conversion.cpp14
-rw-r--r--plugins/FreeImage/Source/FreeImage/Conversion16_555.cpp2
-rw-r--r--plugins/FreeImage/Source/FreeImage/Conversion16_565.cpp2
-rw-r--r--plugins/FreeImage/Source/FreeImage/Conversion24.cpp4
-rw-r--r--plugins/FreeImage/Source/FreeImage/Conversion32.cpp4
-rw-r--r--plugins/FreeImage/Source/FreeImage/Conversion4.cpp6
-rw-r--r--plugins/FreeImage/Source/FreeImage/Conversion8.cpp8
-rw-r--r--plugins/FreeImage/Source/FreeImage/ConversionFloat.cpp8
-rw-r--r--plugins/FreeImage/Source/FreeImage/ConversionRGB16.cpp8
-rw-r--r--plugins/FreeImage/Source/FreeImage/ConversionRGBF.cpp8
-rw-r--r--plugins/FreeImage/Source/FreeImage/ConversionType.cpp10
-rw-r--r--plugins/FreeImage/Source/FreeImage/ConversionUINT16.cpp8
-rw-r--r--plugins/FreeImage/Source/FreeImage/FreeImageIO.cpp18
-rw-r--r--plugins/FreeImage/Source/FreeImage/Halftoning.cpp4
-rw-r--r--plugins/FreeImage/Source/FreeImage/J2KHelper.cpp8
-rw-r--r--plugins/FreeImage/Source/FreeImage/MultiPage.cpp10
-rw-r--r--plugins/FreeImage/Source/FreeImage/NNQuantizer.cpp4
-rw-r--r--plugins/FreeImage/Source/FreeImage/PSDParser.cpp24
-rw-r--r--plugins/FreeImage/Source/FreeImage/PixelAccess.cpp24
-rw-r--r--plugins/FreeImage/Source/FreeImage/Plugin.cpp2
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginBMP.cpp24
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginCUT.cpp2
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginDDS.cpp2
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginEXR.cpp44
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginG3.cpp4
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginGIF.cpp304
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginHDR.cpp42
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginICO.cpp26
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginIFF.cpp8
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginJ2K.cpp10
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginJP2.cpp10
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginJPEG.cpp36
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginPCD.cpp4
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginPCX.cpp16
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginPFM.cpp20
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginPICT.cpp2
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginPNG.cpp14
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginPNM.cpp14
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginRAS.cpp4
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginRAW.cpp14
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginSGI.cpp6
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginTARGA.cpp8
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginTIFF.cpp68
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginXBM.cpp32
-rw-r--r--plugins/FreeImage/Source/FreeImage/PluginXPM.cpp64
-rw-r--r--plugins/FreeImage/Source/FreeImage/ToneMapping.cpp6
-rw-r--r--plugins/FreeImage/Source/FreeImage/WuQuantizer.cpp6
-rw-r--r--plugins/FreeImage/Source/FreeImage/tmoColorConvert.cpp6
-rw-r--r--plugins/FreeImage/Source/FreeImage/tmoDrago03.cpp4
-rw-r--r--plugins/FreeImage/Source/FreeImage/tmoFattal02.cpp44
-rw-r--r--plugins/FreeImage/Source/FreeImage/tmoReinhard05.cpp14
-rw-r--r--plugins/FreeImage/Source/FreeImageToolkit/BSplineRotate.cpp20
-rw-r--r--plugins/FreeImage/Source/FreeImageToolkit/Channels.cpp42
-rw-r--r--plugins/FreeImage/Source/FreeImageToolkit/ClassicRotate.cpp36
-rw-r--r--plugins/FreeImage/Source/FreeImageToolkit/Colors.cpp16
-rw-r--r--plugins/FreeImage/Source/FreeImageToolkit/CopyPaste.cpp44
-rw-r--r--plugins/FreeImage/Source/FreeImageToolkit/Display.cpp10
-rw-r--r--plugins/FreeImage/Source/FreeImageToolkit/JPEGTransform.cpp14
-rw-r--r--plugins/FreeImage/Source/FreeImageToolkit/MultigridPoissonSolver.cpp22
-rw-r--r--plugins/FreeImage/Source/FreeImageToolkit/Rescale.cpp24
-rw-r--r--plugins/FreeImage/Source/FreeImageToolkit/Resize.cpp10
-rw-r--r--plugins/FreeImage/Source/LibPNG/pngrutil.c2
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_color.c6
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_dir.c12
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_dirinfo.c2
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_dirread.c30
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_dirwrite.c22
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_extension.c6
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_fax3.c6
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_fax3.h2
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_getimage.c40
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_jpeg.c54
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_luv.c4
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_lzw.c6
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_packbits.c4
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_predict.c10
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_read.c4
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_thunder.c2
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_unix.c4
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_win32.c4
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_write.c8
-rw-r--r--plugins/FreeImage/Source/LibTIFF/tif_zip.c6
-rw-r--r--plugins/FreeImage/Source/Metadata/Exif.cpp26
-rw-r--r--plugins/FreeImage/Source/Metadata/FreeImageTag.cpp14
-rw-r--r--plugins/FreeImage/Source/Metadata/IPTC.cpp6
-rw-r--r--plugins/FreeImage/Source/Metadata/TagConversion.cpp6
-rw-r--r--plugins/FreeImage/Source/Metadata/TagLib.cpp6
-rw-r--r--plugins/FreeImage/Source/Metadata/XTIFF.cpp16
-rw-r--r--plugins/FreeImage/Source/Utilities.h2
-rw-r--r--plugins/FreeImage/Source/Zlib/zutil.h2
-rw-r--r--plugins/HistoryLinkListPlus/linklist.c2
-rw-r--r--plugins/HistoryLinkListPlus/linklist_dlg.c4
-rw-r--r--plugins/HistoryLinkListPlus/linklist_fct.c28
-rw-r--r--plugins/HistorySweeperLight/historysweeperlight.h4
-rw-r--r--plugins/IEView/HTMLBuilder.cpp2
-rw-r--r--plugins/IEView/Options.cpp2
-rw-r--r--plugins/IEView/SRMMHTMLBuilder.cpp2
-rw-r--r--plugins/IEView/TabSRMMHTMLBuilder.cpp2
-rw-r--r--plugins/Import/mirabilis.c34
-rw-r--r--plugins/Import/mirandahistory.c4
-rw-r--r--plugins/JSON/Source/JSONChildren.h4
-rw-r--r--plugins/JSON/Source/JSONDebug.h4
-rw-r--r--plugins/JSON/Source/JSONIterators.cpp12
-rw-r--r--plugins/JSON/Source/JSONMemory.h6
-rw-r--r--plugins/JSON/Source/JSONNode.cpp28
-rw-r--r--plugins/JSON/Source/JSONNode.h12
-rw-r--r--plugins/JSON/Source/JSONNode_Mutex.cpp8
-rw-r--r--plugins/JSON/Source/JSONWorker.cpp44
-rw-r--r--plugins/JSON/Source/JSONWriter.cpp4
-rw-r--r--plugins/JSON/Source/JSON_Base64.cpp12
-rw-r--r--plugins/JSON/Source/NumberToString.h2
-rw-r--r--plugins/JSON/Source/internalJSONNode.cpp22
-rw-r--r--plugins/JSON/Source/internalJSONNode.h6
-rw-r--r--plugins/JSON/miminterface.cpp4
-rw-r--r--plugins/KeyboardNotify/EnumProc.cpp2
-rw-r--r--plugins/KeyboardNotify/flash.cpp2
-rw-r--r--plugins/KeyboardNotify/ignore.cpp2
-rw-r--r--plugins/KeyboardNotify/keyboard.cpp2
-rw-r--r--plugins/KeyboardNotify/main.cpp25
-rw-r--r--plugins/KeyboardNotify/options.cpp6
-rw-r--r--plugins/KeyboardNotify/protolist.h2
-rw-r--r--plugins/KeyboardNotify/trigger.cpp2
-rw-r--r--plugins/LangMan/langpack.c52
-rw-r--r--plugins/LangMan/options.c40
-rw-r--r--plugins/LangMan/utils.c2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foo_mlt.cpp2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/cfg_var.cpp2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/config_object.cpp2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/filesystem.cpp4
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/filesystem_helper.h2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/input.cpp2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/metadb_handle_list.cpp2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/tag_processor_id3v2.cpp2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/ProfileCache.h2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/ThreadUtils.h10
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/cue_creator.cpp2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/file_info_const_impl.cpp6
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/filetimetools.cpp2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/listview_helper.cpp2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/text_file_loader.cpp2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/wildcard.cpp2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/foobar2000/shared/shared.h2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/pfc/array.h2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/pfc/avltree.h6
-rw-r--r--plugins/ListeningTo/players/foo_mlt/pfc/base64.cpp6
-rw-r--r--plugins/ListeningTo/players/foo_mlt/pfc/guid.cpp2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/pfc/iterators.h4
-rw-r--r--plugins/ListeningTo/players/foo_mlt/pfc/other.cpp4
-rw-r--r--plugins/ListeningTo/players/foo_mlt/pfc/pathUtils.cpp2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/pfc/primitives.h8
-rw-r--r--plugins/ListeningTo/players/foo_mlt/pfc/string.cpp20
-rw-r--r--plugins/ListeningTo/players/foo_mlt/pfc/string.h8
-rw-r--r--plugins/ListeningTo/players/foo_mlt/pfc/stringNew.cpp4
-rw-r--r--plugins/ListeningTo/players/foo_mlt/pfc/stringNew.h2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/pfc/string_conv.cpp2
-rw-r--r--plugins/ListeningTo/players/foo_mlt/pfc/utf8.cpp10
-rw-r--r--plugins/ListeningTo/players/winamp_mlt/wa_ipc.h6
-rw-r--r--plugins/MenuItemEx/main.c44
-rw-r--r--plugins/MetaContacts/addto.c6
-rw-r--r--plugins/MetaContacts/edit.c6
-rw-r--r--plugins/MetaContacts/meta_api.c10
-rw-r--r--plugins/MetaContacts/meta_main.c4
-rw-r--r--plugins/MetaContacts/meta_menu.c20
-rw-r--r--plugins/MetaContacts/meta_options.c12
-rw-r--r--plugins/MetaContacts/meta_services.c112
-rw-r--r--plugins/MetaContacts/meta_utils.c112
-rw-r--r--plugins/MirOTR/MirOTR/dbfilter.cpp20
-rw-r--r--plugins/MirOTR/MirOTR/entities.cpp4
-rw-r--r--plugins/MirOTR/MirOTR/options.cpp2
-rw-r--r--plugins/MirOTR/MirOTR/otr.cpp4
-rw-r--r--plugins/MirOTR/MirOTR/svcs_menu.cpp12
-rw-r--r--plugins/MirOTR/MirOTR/svcs_proto.cpp14
-rw-r--r--plugins/MirOTR/MirOTR/svcs_srmm.cpp8
-rw-r--r--plugins/MirOTR/MirOTR/utils.cpp2
-rw-r--r--plugins/MirOTR/ekhtml/include/ekhtml_private.h4
-rw-r--r--plugins/MirOTR/ekhtml/src/ekhtml.c16
-rw-r--r--plugins/MirOTR/ekhtml/src/ekhtml_comment.c12
-rw-r--r--plugins/MirOTR/ekhtml/src/ekhtml_endtag.c10
-rw-r--r--plugins/MirOTR/ekhtml/src/ekhtml_mktables.c8
-rw-r--r--plugins/MirOTR/ekhtml/src/ekhtml_special.c6
-rw-r--r--plugins/MirOTR/ekhtml/src/ekhtml_starttag.c30
-rw-r--r--plugins/MirOTR/ekhtml/testsuite/tester.c6
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/arcfour.c6
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/blowfish.c18
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/camellia-glue.c2
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/cast5.c14
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/cipher.c6
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/des.c6
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/dsa.c24
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/ecc.c4
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/elgamal.c46
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/md4.c16
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/md5.c16
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/primegen.c30
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/pubkey.c2
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/rijndael.c2
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/rmd160.c16
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/rsa.c8
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/seed.c2
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/sha1.c4
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/tiger.c16
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/cipher/twofish.c6
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-add.c32
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c22
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-cmp.c10
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-div.c46
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-inline.h28
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-internal.h24
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-inv.c38
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-mpow.c24
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-mul.c32
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-pow.c2
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-scan.c32
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpicoder.c8
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpih-div.c76
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpih-mul.c86
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/mpi/mpiutil.c14
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/random/random-csprng.c8
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/random/rndegd.c28
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/random/rndlinux.c18
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/random/rndunix.c56
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/src/gcrypt.h2
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/src/gcryptrnd.c2
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/src/global.c10
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/src/misc.c2
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/src/missing-string.c4
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/src/sexp.c32
-rw-r--r--plugins/MirOTR/libgcrypt-1.4.6/src/stdmem.c2
-rw-r--r--plugins/MirOTR/libgpg-error-1.9/src/w32-gettext.c2
-rw-r--r--plugins/MirOTR/libotr-3.2.0/src/proto.c8
-rw-r--r--plugins/MirOTR/libotr-3.2.0/toolkit/aes.c60
-rw-r--r--plugins/ModernOpt/mopt_ignore.cpp2
-rw-r--r--plugins/Modernb/MString.cpp2
-rw-r--r--plugins/Modernb/_disabled_src/groups.c2
-rw-r--r--plugins/Modernb/hdr/MString.h136
-rw-r--r--plugins/Modernb/modern_clc.cpp52
-rw-r--r--plugins/Modernb/modern_clcidents.cpp12
-rw-r--r--plugins/Modernb/modern_clcitems.cpp16
-rw-r--r--plugins/Modernb/modern_clcopts.cpp48
-rw-r--r--plugins/Modernb/modern_clcpaint.cpp176
-rw-r--r--plugins/Modernb/modern_clcutils.cpp28
-rw-r--r--plugins/Modernb/modern_clistevents.cpp4
-rw-r--r--plugins/Modernb/modern_clistmod.cpp2
-rw-r--r--plugins/Modernb/modern_clistopts.cpp14
-rw-r--r--plugins/Modernb/modern_clistsettings.cpp10
-rw-r--r--plugins/Modernb/modern_clisttray.cpp4
-rw-r--r--plugins/Modernb/modern_clui.cpp28
-rw-r--r--plugins/Modernb/modern_cluiframes.cpp86
-rw-r--r--plugins/Modernb/modern_contact.cpp4
-rw-r--r--plugins/Modernb/modern_docking.cpp12
-rw-r--r--plugins/Modernb/modern_extraimage.cpp2
-rw-r--r--plugins/Modernb/modern_popup.cpp2
-rw-r--r--plugins/Modernb/modern_rowheight_funcs.cpp2
-rw-r--r--plugins/Modernb/modern_rowtemplateopt.cpp4
-rw-r--r--plugins/Modernb/modern_skineditor.cpp4
-rw-r--r--plugins/Modernb/modern_skinengine.cpp10
-rw-r--r--plugins/Modernb/modern_skinopt.cpp6
-rw-r--r--plugins/Modernb/modern_skinselector.cpp48
-rw-r--r--plugins/Modernb/modern_statusbar.cpp2
-rw-r--r--plugins/Modernb/modern_tbbutton.cpp8
-rw-r--r--plugins/Modernb/modern_toolbar.cpp6
-rw-r--r--plugins/Modernb/modern_viewmodebar.cpp24
-rw-r--r--plugins/Mwclist/BkgrCfg.c12
-rw-r--r--plugins/Mwclist/CLUIFrames/cluiframes.c44
-rw-r--r--plugins/Mwclist/CLUIFrames/extraimage.c4
-rw-r--r--plugins/Mwclist/CLUIFrames/statusbar.c4
-rw-r--r--plugins/Mwclist/clc.c10
-rw-r--r--plugins/Mwclist/clcidents.c18
-rw-r--r--plugins/Mwclist/clcitems.c40
-rw-r--r--plugins/Mwclist/clcopts.c28
-rw-r--r--plugins/Mwclist/clcpaint.c6
-rw-r--r--plugins/Mwclist/clcutils.c6
-rw-r--r--plugins/Mwclist/clistopts.c14
-rw-r--r--plugins/Mwclist/clistsettings.c14
-rw-r--r--plugins/Mwclist/clui.c8
-rw-r--r--plugins/Mwclist/cluiopts.c18
-rw-r--r--plugins/Mwclist/contact.c10
-rw-r--r--plugins/Mwclist/init.c2
-rw-r--r--plugins/NewXstatusNotify/indsnd.cpp2
-rw-r--r--plugins/NewXstatusNotify/main.cpp2
-rw-r--r--plugins/NewXstatusNotify/utils.cpp2
-rw-r--r--plugins/NewsAggregstor/NewsAggregator_10.vcxproj1
-rw-r--r--plugins/NewsAggregstor/Src/Entities.cpp4
-rw-r--r--plugins/NewsAggregstor/Src/Options.cpp2
-rw-r--r--plugins/NewsAggregstor/Src/Services.cpp6
-rw-r--r--plugins/NewsAggregstor/Src/Utils.cpp6
-rw-r--r--plugins/Nudge/main.cpp18
-rw-r--r--plugins/Nudge/nudge.cpp4
-rw-r--r--plugins/Nudge/options.cpp2
-rw-r--r--plugins/Nudge/shake.cpp6
-rw-r--r--plugins/PackUpdater/Src/Notifications.cpp10
-rw-r--r--plugins/PackUpdater/Src/Utils.cpp6
-rw-r--r--plugins/Popup/src/common.h4
-rw-r--r--plugins/Popup/src/config.cpp2
-rw-r--r--plugins/Popup/src/formula.cpp6
-rw-r--r--plugins/Popup/src/formula.h4
-rw-r--r--plugins/Popup/src/icons.cpp2
-rw-r--r--plugins/Popup/src/main.cpp8
-rw-r--r--plugins/Popup/src/notifications.cpp2
-rw-r--r--plugins/Popup/src/opt_adv.cpp12
-rw-r--r--plugins/Popup/src/opt_contacts.cpp2
-rw-r--r--plugins/Popup/src/opt_gen.cpp6
-rw-r--r--plugins/Popup/src/opt_skins.cpp12
-rw-r--r--plugins/Popup/src/popup_wnd2.cpp10
-rw-r--r--plugins/Popup/src/services.cpp4
-rw-r--r--plugins/Popup/src/skin.cpp2
-rw-r--r--plugins/QuickMessages/Utils.c26
-rw-r--r--plugins/QuickMessages/main.c28
-rw-r--r--plugins/QuickMessages/options.c92
-rw-r--r--plugins/QuickReplies/common.h8
-rw-r--r--plugins/QuickReplies/events.cpp6
-rw-r--r--plugins/QuickReplies/options.cpp32
-rw-r--r--plugins/Quotes/CurrencyConverter.cpp6
-rw-r--r--plugins/Quotes/Forex.cpp10
-rw-r--r--plugins/Quotes/HTTPSession.cpp10
-rw-r--r--plugins/Quotes/IHTMLEngine.h2
-rw-r--r--plugins/Quotes/IHTMLParser.h8
-rw-r--r--plugins/Quotes/IQuotesProvider.h4
-rw-r--r--plugins/Quotes/IXMLEngine.h8
-rw-r--r--plugins/Quotes/IconLib.cpp2
-rw-r--r--plugins/Quotes/ImportExport.cpp10
-rw-r--r--plugins/Quotes/IsWithinAccuracy.h2
-rw-r--r--plugins/Quotes/Locale.cpp4
-rw-r--r--plugins/Quotes/ModuleInfo.cpp12
-rw-r--r--plugins/Quotes/QuoteChart.cpp2
-rw-r--r--plugins/Quotes/QuoteInfoDlg.cpp4
-rw-r--r--plugins/Quotes/QuotesProviderFinance.cpp6
-rw-r--r--plugins/Quotes/QuotesProviderGoogle.cpp26
-rw-r--r--plugins/Quotes/QuotesProviderGoogleFinance.cpp8
-rw-r--r--plugins/Quotes/QuotesProviderVisitor.h4
-rw-r--r--plugins/Quotes/QuotesProviderYahoo.cpp12
-rw-r--r--plugins/Quotes/QuotesProviders.cpp2
-rw-r--r--plugins/Quotes/SettingsDlg.cpp14
-rw-r--r--plugins/Quotes/XMLEngineMI.cpp2
-rw-r--r--plugins/RecentContacts/RecentContacts.cpp4
-rw-r--r--plugins/SRMM/richutil.c2
-rw-r--r--plugins/SRMM/statusicon.c10
-rw-r--r--plugins/Scriver/chat/clist.c2
-rw-r--r--plugins/Scriver/chat/colorchooser.c2
-rw-r--r--plugins/Scriver/chat/options.c18
-rw-r--r--plugins/Scriver/chat/tools.c2
-rw-r--r--plugins/Scriver/msglog.c2
-rw-r--r--plugins/Scriver/msgwindow.c2
-rw-r--r--plugins/Scriver/richutil.c2
-rw-r--r--plugins/Scriver/statusicon.c10
-rw-r--r--plugins/SecureIM/commonheaders.cpp10
-rw-r--r--plugins/SecureIM/crypt_check.cpp78
-rw-r--r--plugins/SecureIM/crypt_dll.cpp20
-rw-r--r--plugins/SecureIM/crypt_icons.cpp32
-rw-r--r--plugins/SecureIM/crypt_lists.cpp46
-rw-r--r--plugins/SecureIM/crypt_metacontacts.cpp6
-rw-r--r--plugins/SecureIM/crypt_misc.cpp16
-rw-r--r--plugins/SecureIM/crypt_popups.cpp4
-rw-r--r--plugins/SecureIM/loadicons.cpp2
-rw-r--r--plugins/SecureIM/main.cpp14
-rw-r--r--plugins/SecureIM/mmi.cpp8
-rw-r--r--plugins/SecureIM/options.cpp156
-rw-r--r--plugins/SecureIM/splitmsg.cpp14
-rw-r--r--plugins/SecureIM/svcs_clist.cpp42
-rw-r--r--plugins/SecureIM/svcs_menu.cpp12
-rw-r--r--plugins/SecureIM/svcs_popup.cpp4
-rw-r--r--plugins/SecureIM/svcs_proto.cpp194
-rw-r--r--plugins/SecureIM/svcs_rsa.cpp22
-rw-r--r--plugins/SecureIM/svcs_srmm.cpp6
-rw-r--r--plugins/SeenPlugin/file.c6
-rw-r--r--plugins/SeenPlugin/main.c4
-rw-r--r--plugins/SeenPlugin/menu.c4
-rw-r--r--plugins/SeenPlugin/missed.c8
-rw-r--r--plugins/SeenPlugin/options.c16
-rw-r--r--plugins/SeenPlugin/userinfo.c4
-rw-r--r--plugins/SeenPlugin/utils.c92
-rw-r--r--plugins/Sessions/Src/Main.cpp24
-rw-r--r--plugins/Sessions/Src/Options.cpp20
-rw-r--r--plugins/Sessions/Src/Utils.cpp34
-rw-r--r--plugins/SmileyAdd/smileyroutines.cpp2
-rw-r--r--plugins/SpellChecker/autoreplace.cpp4
-rw-r--r--plugins/SpellChecker/spellchecker.cpp4
-rw-r--r--plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp4
-rw-r--r--plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp4
-rw-r--r--plugins/StatusPlugins/KeepStatus/action_keepstatus.cpp4
-rw-r--r--plugins/StatusPlugins/KeepStatus/keepstatus.cpp4
-rw-r--r--plugins/StatusPlugins/commonstatus.cpp2
-rw-r--r--plugins/StatusPlugins/confirmdialog.cpp4
-rw-r--r--plugins/StopSpamPlus/src/events.cpp16
-rw-r--r--plugins/StopSpamPlus/src/opt_proto.cpp2
-rw-r--r--plugins/Svc_crshdmp/utils.cpp2
-rw-r--r--plugins/Svc_dbepp/exportimport.cpp8
-rw-r--r--plugins/Svc_dbepp/main.cpp2
-rw-r--r--plugins/Svc_dbepp/main_window.cpp2
-rw-r--r--plugins/Svc_vi/utils.cpp6
-rw-r--r--plugins/TabSRMM/chat/clist.cpp2
-rw-r--r--plugins/TabSRMM/chat/muchighlight.cpp24
-rw-r--r--plugins/TabSRMM/chat/options.cpp4
-rw-r--r--plugins/TabSRMM/chat/services.cpp2
-rw-r--r--plugins/TabSRMM/chat/tools.cpp14
-rw-r--r--plugins/TabSRMM/chat/window.cpp28
-rw-r--r--plugins/TabSRMM/include/msgs.h2
-rw-r--r--plugins/TabSRMM/include/themes.h2
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp4
-rw-r--r--plugins/TabSRMM/src/contactcache.cpp2
-rw-r--r--plugins/TabSRMM/src/container.cpp10
-rw-r--r--plugins/TabSRMM/src/containeroptions.cpp6
-rw-r--r--plugins/TabSRMM/src/controls.cpp8
-rw-r--r--plugins/TabSRMM/src/eventpopups.cpp12
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp32
-rw-r--r--plugins/TabSRMM/src/globals.cpp8
-rw-r--r--plugins/TabSRMM/src/hotkeyhandler.cpp4
-rw-r--r--plugins/TabSRMM/src/infopanel.cpp58
-rw-r--r--plugins/TabSRMM/src/mim.cpp10
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp34
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp18
-rw-r--r--plugins/TabSRMM/src/msglog.cpp2
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp10
-rw-r--r--plugins/TabSRMM/src/msgs.cpp8
-rw-r--r--plugins/TabSRMM/src/selectcontainer.cpp2
-rw-r--r--plugins/TabSRMM/src/sendlater.cpp42
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp2
-rw-r--r--plugins/TabSRMM/src/sidebar.cpp36
-rw-r--r--plugins/TabSRMM/src/tabctrl.cpp4
-rw-r--r--plugins/TabSRMM/src/taskbar.cpp14
-rw-r--r--plugins/TabSRMM/src/themeio.cpp2
-rw-r--r--plugins/TabSRMM/src/themes.cpp24
-rw-r--r--plugins/TabSRMM/src/userprefs.cpp6
-rw-r--r--plugins/TabSRMM/src/utils.cpp22
-rw-r--r--plugins/TabSRMM/tabmodplus/modplus.cpp2
-rw-r--r--plugins/TabSRMM/tabsrmm_10.vcxproj22
-rw-r--r--plugins/TabSRMM/tabsrmm_10.vcxproj.filters12
-rw-r--r--plugins/TipperYM/options.cpp2
-rw-r--r--plugins/TooltipNotify/src/TooltipNotify.cpp6
-rw-r--r--plugins/TooltipNotify/src/TooltipNotify.h2
-rw-r--r--plugins/TooltipNotify/src/Utils.cpp9
-rw-r--r--plugins/TooltipNotify/src/Utils.h2
-rw-r--r--plugins/TooltipNotify/src/stdafx.h2
-rw-r--r--plugins/TranslitSwitcher/Src/Layoutproc.cpp2
-rw-r--r--plugins/Updater/allocations.h6
-rw-r--r--plugins/Updater/bzip2-1.0.3/bzlib.c2
-rw-r--r--plugins/Updater/bzip2-1.0.3/dlltest.c20
-rw-r--r--plugins/Updater/conf_comp_dialog.cpp6
-rw-r--r--plugins/Updater/conf_dialog.cpp16
-rw-r--r--plugins/Updater/extern.cpp10
-rw-r--r--plugins/Updater/options.cpp14
-rw-r--r--plugins/Updater/scan.cpp6
-rw-r--r--plugins/Updater/services.cpp14
-rw-r--r--plugins/Updater/socket.cpp2
-rw-r--r--plugins/Updater/updater_10.vcxproj1
-rw-r--r--plugins/Updater/updater_10.vcxproj.filters3
-rw-r--r--plugins/Updater/utils.cpp4
-rw-r--r--plugins/Updater/xmldata.cpp14
-rw-r--r--plugins/Updater/zbin/minizip/minizip.c8
-rw-r--r--plugins/Updater/zbin/minizip/unzip.c2
-rw-r--r--plugins/Updater/zbin/minizip/zip.c6
-rw-r--r--plugins/UserInfoEx/Flags/svc_countrylistext.cpp8
-rw-r--r--plugins/UserInfoEx/Flags/svc_flags.cpp44
-rw-r--r--plugins/UserInfoEx/Flags/svc_flagsicons.cpp8
-rw-r--r--plugins/UserInfoEx/UInfoEx_10.vcxproj6
-rw-r--r--plugins/UserInfoEx/classMAnnivDate.cpp4
-rw-r--r--plugins/UserInfoEx/commonheaders.cpp6
-rw-r--r--plugins/UserInfoEx/ctrl_tzcombo.h2
-rw-r--r--plugins/UserInfoEx/dlg_anniversarylist.cpp10
-rw-r--r--plugins/UserInfoEx/ex_import/classExImContactBase.cpp10
-rw-r--r--plugins/UserInfoEx/ex_import/classExImContactXML.cpp10
-rw-r--r--plugins/UserInfoEx/mir_db.cpp6
-rw-r--r--plugins/UserInfoEx/mir_menuitems.cpp8
-rw-r--r--plugins/UserInfoEx/psp_options.cpp2
-rw-r--r--plugins/UserInfoEx/psp_profile.cpp2
-rw-r--r--plugins/UserInfoEx/svc_constants.h2
-rw-r--r--plugins/UserInfoEx/svc_email.cpp2
-rw-r--r--plugins/Utils/mir_buffer.h2
-rw-r--r--plugins/Variables/contact.cpp2
-rw-r--r--plugins/YAMN/account.cpp2
-rw-r--r--plugins/YAMN/browser/mailbrowser.cpp54
-rw-r--r--plugins/YAMN/filter/Base/maindll.cpp14
-rw-r--r--plugins/YAMN/filter/Simple/maindll.cpp12
-rw-r--r--plugins/YAMN/mails/decode.cpp10
-rw-r--r--plugins/YAMN/mails/mime.cpp14
-rw-r--r--plugins/YAMN/main.cpp4
-rw-r--r--plugins/YAMN/proto/pop3/pop3.cpp2
-rw-r--r--plugins/YAMN/proto/pop3/pop3comm.cpp6
-rw-r--r--plugins/YAMN/services.cpp8
-rw-r--r--plugins/YAPP/message_pump.cpp4
-rw-r--r--plugins/YAPP/options.cpp6
-rw-r--r--plugins/YAPP/popwin.cpp8
-rw-r--r--plugins/YAPP/services.cpp12
-rw-r--r--plugins/ZeroNotification/main.c8
-rw-r--r--plugins/Zlib/zutil.h2
-rw-r--r--plugins/mTextControl/src/FormattedTextDraw.cpp8
-rw-r--r--plugins/mTextControl/src/dataobject.cpp4
-rw-r--r--protocols/AimOscar/connection.cpp50
-rw-r--r--protocols/AimOscar/conv.cpp12
-rw-r--r--protocols/AimOscar/links.cpp2
-rw-r--r--protocols/AimOscar/server.cpp10
-rw-r--r--protocols/AimOscar/services.cpp2
-rw-r--r--protocols/AimOscar/theme.cpp4
-rw-r--r--protocols/AimOscar/ui.cpp12
-rw-r--r--protocols/AimOscar/utility.cpp2
-rw-r--r--protocols/FacebookRM/chat.cpp2
-rw-r--r--protocols/FacebookRM/contacts.cpp18
-rw-r--r--protocols/FacebookRM/dialogs.cpp6
-rw-r--r--protocols/FacebookRM/messages.cpp6
-rw-r--r--protocols/FacebookRM/process.cpp4
-rw-r--r--protocols/FacebookRM/proto.cpp8
-rw-r--r--protocols/FacebookRM/theme.cpp4
-rw-r--r--protocols/GTalkExt/db.cpp2
-rw-r--r--protocols/GTalkExt/notifications.cpp2
-rw-r--r--protocols/Gadu-Gadu/core.c52
-rw-r--r--protocols/Gadu-Gadu/dialogs.c6
-rw-r--r--protocols/Gadu-Gadu/filetransfer.c22
-rw-r--r--protocols/Gadu-Gadu/groupchat.c24
-rw-r--r--protocols/Gadu-Gadu/import.c6
-rw-r--r--protocols/Gadu-Gadu/oauth.c12
-rw-r--r--protocols/Gadu-Gadu/ownerinfo.c4
-rw-r--r--protocols/Gadu-Gadu/services.c24
-rw-r--r--protocols/Gadu-Gadu/token.c2
-rw-r--r--protocols/Gadu-Gadu/userutils.c16
-rw-r--r--protocols/IRCG/MString.cpp2
-rw-r--r--protocols/IRCG/MString.h136
-rw-r--r--protocols/IRCG/commandmonitor.cpp12
-rw-r--r--protocols/IRCG/input.cpp4
-rw-r--r--protocols/IRCG/irclib.cpp30
-rw-r--r--protocols/IRCG/options.cpp16
-rw-r--r--protocols/IRCG/output.cpp2
-rw-r--r--protocols/IRCG/tools.cpp8
-rw-r--r--protocols/IRCG/userinfo.cpp2
-rw-r--r--protocols/IRCG/windows.cpp6
-rw-r--r--protocols/IcqOscarJ/chan_05ping.cpp2
-rw-r--r--protocols/IcqOscarJ/changeinfo/dlgproc.cpp4
-rw-r--r--protocols/IcqOscarJ/changeinfo/editstring.cpp20
-rw-r--r--protocols/IcqOscarJ/changeinfo/upload.cpp2
-rw-r--r--protocols/IcqOscarJ/i18n.cpp4
-rw-r--r--protocols/IcqOscarJ/icq_direct.cpp2
-rw-r--r--protocols/IcqOscarJ/icq_popups.cpp2
-rw-r--r--protocols/JabberG/MString.cpp2
-rw-r--r--protocols/JabberG/MString.h136
-rw-r--r--protocols/JabberG/jabber_adhoc.cpp2
-rw-r--r--protocols/JabberG/jabber_captcha.cpp8
-rw-r--r--protocols/JabberG/jabber_events.cpp2
-rw-r--r--protocols/JabberG/jabber_iq_handlers.cpp30
-rw-r--r--protocols/JabberG/jabber_iqid.cpp2
-rw-r--r--protocols/JabberG/jabber_iqid_muc.cpp2
-rw-r--r--protocols/JabberG/jabber_list.cpp4
-rw-r--r--protocols/JabberG/jabber_opt.cpp2
-rw-r--r--protocols/JabberG/jabber_privacy.cpp2
-rw-r--r--protocols/JabberG/jabber_proto.cpp6
-rw-r--r--protocols/JabberG/jabber_proxy.cpp16
-rw-r--r--protocols/JabberG/jabber_search.h4
-rw-r--r--protocols/JabberG/jabber_svc.cpp2
-rw-r--r--protocols/JabberG/jabber_thread.cpp2
-rw-r--r--protocols/JabberG/jabber_vcard.cpp4
-rw-r--r--protocols/JabberG/jabber_xstatus.cpp6
-rw-r--r--protocols/MRA/Mra.cpp2
-rw-r--r--protocols/MRA/MraAdvancedSearch.cpp2
-rw-r--r--protocols/MRA/MraAntiSpam.cpp4
-rw-r--r--protocols/MRA/MraAvatars.cpp2
-rw-r--r--protocols/MRA/MraFilesQueue.cpp4
-rw-r--r--protocols/MRA/MraFilesQueue_mod.cpp4
-rw-r--r--protocols/MRA/MraMRIMProxy.cpp2
-rw-r--r--protocols/MRA/MraPopUp.cpp2
-rw-r--r--protocols/MRA/MraSelectEMail.cpp2
-rw-r--r--protocols/MRA/Mra_functions.cpp10
-rw-r--r--protocols/MRA/Mra_options.cpp4
-rw-r--r--protocols/MRA/Mra_proto.cpp12
-rw-r--r--protocols/MRA/Sdk/Base64.h8
-rw-r--r--protocols/MSN/des.c18
-rw-r--r--protocols/MSN/msn_commands.cpp2
-rw-r--r--protocols/MSN/msn_threads.cpp2
-rw-r--r--protocols/Omegle/chat.cpp2
-rw-r--r--protocols/Omegle/dialogs.cpp2
-rw-r--r--protocols/Omegle/proto.cpp4
-rw-r--r--protocols/Omegle/theme.cpp4
-rw-r--r--protocols/Weather/weather.h2
-rw-r--r--protocols/Weather/weather_conv.cpp2
-rw-r--r--protocols/Yahoo/avatar.cpp12
-rw-r--r--protocols/Yahoo/file_transfer.cpp6
-rw-r--r--protocols/Yahoo/im.cpp12
-rw-r--r--protocols/Yahoo/libyahoo2/libyahoo2.c228
-rw-r--r--protocols/Yahoo/libyahoo2/yahoo_httplib.c32
-rw-r--r--protocols/Yahoo/libyahoo2/yahoo_list.c8
-rw-r--r--protocols/Yahoo/options.cpp2
-rw-r--r--protocols/Yahoo/proto.cpp14
-rw-r--r--protocols/Yahoo/services.cpp4
-rw-r--r--protocols/Yahoo/util.cpp4
-rw-r--r--protocols/Yahoo/yahoo.cpp10
-rw-r--r--src/core/miranda.cpp2
-rw-r--r--src/modules/database/dbini.cpp6
-rw-r--r--src/modules/findadd/findadd.cpp2
-rw-r--r--src/modules/xml/xmlParser.cpp10
714 files changed, 5612 insertions, 5645 deletions
diff --git a/plugins/AVS/acc.cpp b/plugins/AVS/acc.cpp
index f62009b43d..a804a09600 100644
--- a/plugins/AVS/acc.cpp
+++ b/plugins/AVS/acc.cpp
@@ -288,11 +288,11 @@ void AnimatedGifMountFrame(ACCData* data, int page)
RGBQUAD *pal = fei->FI_GetPalette(dib);
bool have_transparent = false;
int transparent_color = -1;
- if( fei->FI_IsTransparent(dib) ) {
+ if ( fei->FI_IsTransparent(dib) ) {
int count = fei->FI_GetTransparencyCount(dib);
BYTE *table = fei->FI_GetTransparencyTable(dib);
- for( int i = 0; i < count; i++ ) {
- if( table[i] == 0 ) {
+ for ( int i = 0; i < count; i++ ) {
+ if ( table[i] == 0 ) {
have_transparent = true;
transparent_color = i;
break;
@@ -301,11 +301,11 @@ void AnimatedGifMountFrame(ACCData* data, int page)
}
//copy page data into logical buffer, with full alpha opaqueness
- for( int y = 0; y < data->ag.frame.height; y++ ) {
+ for ( int y = 0; y < data->ag.frame.height; y++ ) {
RGBQUAD *scanline = (RGBQUAD *)fei->FI_GetScanLine(data->ag.dib, data->ag.logicalHeight - (y + data->ag.frame.top) - 1) + data->ag.frame.left;
BYTE *pageline = fei->FI_GetScanLine(dib, data->ag.frame.height - y - 1);
- for( int x = 0; x < data->ag.frame.width; x++ ) {
- if( !have_transparent || *pageline != transparent_color ) {
+ for ( int x = 0; x < data->ag.frame.width; x++ ) {
+ if ( !have_transparent || *pageline != transparent_color ) {
*scanline = pal[*pageline];
scanline->rgbReserved = 255;
}
diff --git a/plugins/AssocMgr/assoclist.c b/plugins/AssocMgr/assoclist.c
index 206f2cdd6d..26a72a43da 100644
--- a/plugins/AssocMgr/assoclist.c
+++ b/plugins/AssocMgr/assoclist.c
@@ -95,7 +95,7 @@ void CleanupAssocEnabledSettings(void)
for(i = 0;i<nSettingsCount;++i) {
pszSuffix = &ppszSettings[i][8];
mir_snprintf(szSetting, sizeof(szSetting), "module_%s", pszSuffix);
- if(!DBGetContactSettingTString(NULL, "AssocMgr", szSetting, &dbv)) {
+ if (!DBGetContactSettingTString(NULL, "AssocMgr", szSetting, &dbv)) {
if(CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)dbv.ptszVal, (LPARAM)szDLL)) {
/* file still exists? */
hFile = CreateFile(szDLL, 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
@@ -129,7 +129,7 @@ static __inline BOOL WasMimeTypeAdded(const char *pszMimeType)
DBVARIANT dbv;
BOOL fAdded = FALSE;
mir_snprintf(szSetting, sizeof(szSetting), "mime_%s", pszMimeType);
- if(!DBGetContactSetting(NULL, "AssocMgr", szSetting, &dbv)) fAdded = TRUE;
+ if (!DBGetContactSetting(NULL, "AssocMgr", szSetting, &dbv)) fAdded = TRUE;
else DBFreeVariant(&dbv);
return fAdded;
}
@@ -147,10 +147,10 @@ void CleanupMimeTypeAddedSettings(void)
for(i = 0;i<nSettingsCount;++i) {
pszSuffix = &ppszSettings[i][5];
for(j = 0;j<nAssocListCount;++j)
- if(!lstrcmpA(pszSuffix, pAssocList[j].pszMimeType))
+ if (!lstrcmpA(pszSuffix, pAssocList[j].pszMimeType))
break; /* mime type in current list */
if(j == nAssocListCount) { /* mime type not in current list */
- if(!DBGetContactSetting(NULL, "AssocMgr", ppszSettings[i], &dbv)) {
+ if (!DBGetContactSetting(NULL, "AssocMgr", ppszSettings[i], &dbv)) {
if(dbv.type == DBVT_ASCIIZ)
RemoveRegMimeType(pszSuffix, dbv.pszVal);
DBFreeVariant(&dbv);
@@ -201,7 +201,7 @@ static int FindAssocItem(const char *pszClassName)
{
int i;
for(i = 0;i<nAssocListCount;++i)
- if(!lstrcmpA(pszClassName, pAssocList[i].pszClassName))
+ if (!lstrcmpA(pszClassName, pAssocList[i].pszClassName))
return i;
return -1;
}
@@ -292,7 +292,7 @@ static BOOL IsAssocRegistered(const ASSOCDATA *assoc)
fSuccess = IsRegClass(assoc->pszClassName, pszRunCmd);
mir_free(pszRunCmd); /* does NULL check */
/* file ext */
- if(!fIsUrl)
+ if (!fIsUrl)
fSuccess = IsRegFileExt(assoc->pszFileExt, assoc->pszClassName);
return fSuccess;
@@ -312,10 +312,10 @@ static BOOL EnsureAssocRegistered(const ASSOCDATA *assoc)
if(pszRunCmd!= NULL) {
fSuccess = TRUE; /* tentatively */
/* do not overwrite user customized settings */
- if(!IsRegClass(assoc->pszClassName, pszRunCmd)) {
+ if (!IsRegClass(assoc->pszClassName, pszRunCmd)) {
/* class icon */
- if(!assoc->nIconResID && fIsUrl) pszIconLoc = MakeIconLocation(NULL, 0); /* miranda logo */
- else if(!assoc->nIconResID) pszIconLoc = MakeIconLocation(hInst, IDI_MIRANDAFILE); /* generic file */
+ if (!assoc->nIconResID && fIsUrl) pszIconLoc = MakeIconLocation(NULL, 0); /* miranda logo */
+ else if (!assoc->nIconResID) pszIconLoc = MakeIconLocation(hInst, IDI_MIRANDAFILE); /* generic file */
else pszIconLoc = MakeIconLocation(assoc->hInstance, assoc->nIconResID);
/* register class */
if(fUseMainCmdLine) pszDdeCmd = NULL;
@@ -362,7 +362,7 @@ static BOOL UnregisterAssoc(const ASSOCDATA *assoc)
mir_free(pszRunCmd); /* does NULL check */
/* file type */
- if(!fIsUrl) {
+ if (!fIsUrl) {
/* file extension */
RemoveRegFileExt(assoc->pszFileExt, assoc->pszClassName);
/* mime type */
@@ -473,7 +473,7 @@ static BOOL RemoveAssocItem_Worker(const char *pszClassName)
mir_free(assoc->pszMimeType); /* does NULL check */
/* resize storage array */
- if((index+1)<nAssocListCount)
+ if ((index+1)<nAssocListCount)
MoveMemory(assoc, &pAssocList[index+1], ((nAssocListCount-index-1)*sizeof(ASSOCDATA)));
pAssocListBuf = (ASSOCDATA*)mir_realloc(pAssocList, (nAssocListCount-1)*sizeof(ASSOCDATA));
if(pAssocListBuf!= NULL) pAssocList = pAssocListBuf;
@@ -518,7 +518,7 @@ static INT_PTR ServiceRemoveFileType(WPARAM wParam, LPARAM lParam)
char *pszClassName;
UNREFERENCED_PARAMETER(wParam);
- if((char*)lParam == NULL) return 2;
+ if ((char*)lParam == NULL) return 2;
pszClassName = MakeFileClassName((char*)lParam);
if(pszClassName!= NULL)
if(RemoveAssocItem_Worker(pszClassName)) {
@@ -557,7 +557,7 @@ static INT_PTR ServiceRemoveUrlType(WPARAM wParam, LPARAM lParam)
char *pszClassName;
UNREFERENCED_PARAMETER(wParam);
- if((char*)lParam == NULL) return 2;
+ if ((char*)lParam == NULL) return 2;
pszClassName = MakeUrlClassName((char*)lParam);
if(pszClassName!= NULL)
if(RemoveAssocItem_Worker(pszClassName)) {
@@ -590,7 +590,7 @@ static BOOL InvokeHandler_Worker(const char *pszClassName, const TCHAR *pszParam
EnsureAssocRegistered(assoc);
NotifyAssocChange(FALSE);
/* try main command line */
- if((int)ShellExecute(NULL, NULL, pszParam, NULL, NULL, SW_SHOWNORMAL) >= 32)
+ if ((int)ShellExecute(NULL, NULL, pszParam, NULL, NULL, SW_SHOWNORMAL) >= 32)
*res = 0; /* success */
return TRUE;
}
@@ -621,7 +621,7 @@ INT_PTR InvokeFileHandler(const TCHAR *pszFileName)
/* class name */
pszClassName = MakeFileClassName(pszFileExt);
if(pszClassName!= NULL)
- if(!InvokeHandler_Worker(pszClassName, pszFileName, &res)) {
+ if (!InvokeHandler_Worker(pszClassName, pszFileName, &res)) {
/* correct registry on error (no longer in list) */
RemoveRegFileExt(pszFileExt, pszClassName);
RemoveRegClass(pszClassName);
@@ -647,7 +647,7 @@ INT_PTR InvokeUrlHandler(const TCHAR *pszUrl)
/* class name */
pszClassName = MakeUrlClassName(pszProtoPrefix);
if(pszClassName!= NULL)
- if(!InvokeHandler_Worker(pszClassName, pszUrl, &res))
+ if (!InvokeHandler_Worker(pszClassName, pszUrl, &res))
/* correct registry on error (no longer in list) */
RemoveRegClass(pszClassName);
mir_free(pszClassName); /* does NULL check */
@@ -662,9 +662,9 @@ INT_PTR InvokeUrlHandler(const TCHAR *pszUrl)
static int CALLBACK ListViewSortDesc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
int cmp;
- if(((ASSOCDATA*)lParam1)->pszFileExt!= NULL && ((ASSOCDATA*)lParam2)->pszFileExt!= NULL)
+ if (((ASSOCDATA*)lParam1)->pszFileExt!= NULL && ((ASSOCDATA*)lParam2)->pszFileExt!= NULL)
cmp = CompareStringA((LCID)lParamSort, 0, ((ASSOCDATA*)lParam1)->pszFileExt, -1, ((ASSOCDATA*)lParam2)->pszFileExt, -1);
- else if(((ASSOCDATA*)lParam1)->pszFileExt == ((ASSOCDATA*)lParam2)->pszFileExt) /* both NULL */
+ else if (((ASSOCDATA*)lParam1)->pszFileExt == ((ASSOCDATA*)lParam2)->pszFileExt) /* both NULL */
cmp = CompareStringA((LCID)lParamSort, 0, ((ASSOCDATA*)lParam1)->pszClassName, -1, ((ASSOCDATA*)lParam2)->pszClassName, -1);
else /* different types, incomparable */
cmp = (((ASSOCDATA*)lParam1)->pszFileExt == NULL)?CSTR_LESS_THAN:CSTR_GREATER_THAN;
@@ -821,7 +821,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara
HTHEME hTheme;
hTheme = pfnGetWindowTheme((HWND)lParam);
if(hTheme!= NULL)
- if(!pfnGetThemeColor(hTheme, BP_GROUPBOX, GBS_NORMAL, TMT_TEXTCOLOR, &clr)) {
+ if (!pfnGetThemeColor(hTheme, BP_GROUPBOX, GBS_NORMAL, TMT_TEXTCOLOR, &clr)) {
SetBkMode((HDC)wParam, TRANSPARENT);
SetTextColor((HDC)wParam, clr);
}
@@ -877,7 +877,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara
lvi.iItem = ListView_GetNextItem(nmhdr->hwndFrom, lvi.iItem, LVNI_ABOVE);
if(lvi.iItem!= -1)
if(ListView_GetItem(nmhdr->hwndFrom, &lvi))
- if((ASSOCDATA*)lvi.lParam == NULL) /* groups */
+ if ((ASSOCDATA*)lvi.lParam == NULL) /* groups */
lvi.iItem = -1;
if(lvi.iItem == -1) {
SetWindowLong(hwndDlg, DWLP_MSGRESULT, TRUE); /* eat it */
@@ -893,7 +893,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara
lvi.iItem-= ListView_GetCountPerPage(nmhdr->hwndFrom);
if(lvi.iItem>= 0)
if(ListView_GetItem(nmhdr->hwndFrom, &lvi))
- if((ASSOCDATA*)lvi.lParam == NULL) /* groups */
+ if ((ASSOCDATA*)lvi.lParam == NULL) /* groups */
lvi.iItem = -1;
if(lvi.iItem<0) {
ListView_SetItemState(nmhdr->hwndFrom, 0, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);
diff --git a/plugins/AssocMgr/dde.c b/plugins/AssocMgr/dde.c
index 7be9f1fbcf..0804be855c 100644
--- a/plugins/AssocMgr/dde.c
+++ b/plugins/AssocMgr/dde.c
@@ -90,7 +90,7 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM
{ ATOM hSzApp,hSzTopic;
hSzApp=LOWORD(lParam); /* no UnpackDDElParam() here */
hSzTopic=HIWORD(lParam);
- if((hSzApp==GlobalFindAtom(DDEAPP) && hSzTopic==GlobalFindAtom(DDETOPIC)) || !hSzApp) {
+ if ((hSzApp==GlobalFindAtom(DDEAPP) && hSzTopic==GlobalFindAtom(DDETOPIC)) || !hSzApp) {
hSzApp=GlobalAddAtom(DDEAPP);
hSzTopic=GlobalAddAtom(DDETOPIC);
if(hSzApp && hSzTopic)
@@ -119,11 +119,11 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM
if(pszArg!=NULL) {
/* we are inside miranda here, we make it async so the shell does
* not timeout regardless what the plugins try to do. */
- if(!lstrcmpi(pszAction,_T("file")))
+ if (!lstrcmpi(pszAction,_T("file")))
ack.fAck=(short)(CallFunctionAsync(FileActionAsync,pszArg)!=0);
- else if(!lstrcmpi(pszAction,_T("url")))
+ else if (!lstrcmpi(pszAction,_T("url")))
ack.fAck=(short)(CallFunctionAsync(UrlActionAsync,pszArg)!=0);
- if(!ack.fAck) mir_free(pszArg); /* otherwise freed by asyncproc */
+ if (!ack.fAck) mir_free(pszArg); /* otherwise freed by asyncproc */
}
GlobalUnlock(hCommand);
}
@@ -131,7 +131,7 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM
}
#endif
lParam=ReuseDDElParam(lParam,msg,WM_DDE_ACK,*(PUINT)&ack,(UINT)hCommand);
- if(!PostMessage((HWND)wParam,WM_DDE_ACK,(WPARAM)hwnd,lParam)) {
+ if (!PostMessage((HWND)wParam,WM_DDE_ACK,(WPARAM)hwnd,lParam)) {
GlobalFree(hCommand);
FreeDDElParam(WM_DDE_ACK,lParam);
}
@@ -151,7 +151,7 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM
ZeroMemory(&ack,sizeof(ack));
if(UnpackDDElParam(msg,lParam,NULL,(PUINT)&hSzItem)) {
lParam=ReuseDDElParam(lParam,msg,WM_DDE_ACK,*(PUINT)&ack,(UINT)hSzItem);
- if(!PostMessage((HWND)wParam,WM_DDE_ACK,(WPARAM)hwnd,lParam)) {
+ if (!PostMessage((HWND)wParam,WM_DDE_ACK,(WPARAM)hwnd,lParam)) {
if(hSzItem) GlobalDeleteAtom(hSzItem);
FreeDDElParam(WM_DDE_ACK,lParam);
}
@@ -170,7 +170,7 @@ static HANDLE StartupMainProcess(TCHAR *pszDatabasePath)
STARTUPINFO si;
/* we are inside RunDll32 here */
- if(!GetModuleFileName(hInst,szPath,SIZEOF(szPath))) return NULL;
+ if (!GetModuleFileName(hInst,szPath,SIZEOF(szPath))) return NULL;
p=_tcsrchr(szPath,_T('\\'));
if(p!=NULL) { *p=0; p=_tcsrchr(szPath,_T('\\')); }
if(p==NULL) return NULL;
@@ -178,7 +178,7 @@ static HANDLE StartupMainProcess(TCHAR *pszDatabasePath)
/* inherit startup data from RunDll32 process */
GetStartupInfo(&si);
- if(!CreateProcess(szPath,pszDatabasePath,NULL,NULL,TRUE,GetPriorityClass(GetCurrentProcess()),NULL,NULL,&si,&pi))
+ if (!CreateProcess(szPath,pszDatabasePath,NULL,NULL,TRUE,GetPriorityClass(GetCurrentProcess()),NULL,NULL,&si,&pi))
return NULL;
CloseHandle(pi.hThread);
return pi.hProcess;
diff --git a/plugins/AssocMgr/main.c b/plugins/AssocMgr/main.c
index 60d6a8b5a0..55c93fa40d 100644
--- a/plugins/AssocMgr/main.c
+++ b/plugins/AssocMgr/main.c
@@ -72,7 +72,7 @@ static void InstallFile(const TCHAR *pszFileName,const TCHAR *pszDestSubDir)
TCHAR szFileFrom[MAX_PATH+1],szFileTo[MAX_PATH+1],*p;
HANDLE hFile;
- if(!GetModuleFileName(hInst,szFileFrom,SIZEOF(szFileFrom)-lstrlen(pszFileName)))
+ if (!GetModuleFileName(hInst,szFileFrom,SIZEOF(szFileFrom)-lstrlen(pszFileName)))
return;
p=_tcsrchr(szFileFrom,_T('\\'));
if(p!=NULL) *(++p)=0;
@@ -82,7 +82,7 @@ static void InstallFile(const TCHAR *pszFileName,const TCHAR *pszDestSubDir)
if(hFile==INVALID_HANDLE_VALUE) return;
CloseHandle(hFile);
- if(!GetModuleFileNameWorkaround(NULL,szFileTo,SIZEOF(szFileTo)-lstrlen(pszDestSubDir)-lstrlen(pszFileName)))
+ if (!GetModuleFileNameWorkaround(NULL,szFileTo,SIZEOF(szFileTo)-lstrlen(pszDestSubDir)-lstrlen(pszFileName)))
return;
p=_tcsrchr(szFileTo,_T('\\'));
if(p!=NULL) *(++p)=0;
@@ -90,7 +90,7 @@ static void InstallFile(const TCHAR *pszFileName,const TCHAR *pszDestSubDir)
CreateDirectory(szFileTo,NULL);
lstrcat(szFileTo,pszFileName); /* buffer safe */
- if(!MoveFile(szFileFrom,szFileTo) && GetLastError()==ERROR_ALREADY_EXISTS) {
+ if (!MoveFile(szFileFrom,szFileTo) && GetLastError()==ERROR_ALREADY_EXISTS) {
DeleteFile(szFileTo);
MoveFile(szFileFrom,szFileTo);
}
@@ -147,7 +147,7 @@ __declspec(dllexport) int Load(PLUGINLINK *link)
return 1;
}
- if(!ServiceExists(MS_DB_CONTACT_GETSETTING_STR)) return 1; /* dbx3x v0.5.1.0 */
+ if (!ServiceExists(MS_DB_CONTACT_GETSETTING_STR)) return 1; /* dbx3x v0.5.1.0 */
if(mir_getMMI(&mmi)) return 1;
if(mir_getUTFI(&utfi)) return 1;
InitAssocList();
diff --git a/plugins/AssocMgr/reg.c b/plugins/AssocMgr/reg.c
index a4fadd2ef4..09b58a1462 100644
--- a/plugins/AssocMgr/reg.c
+++ b/plugins/AssocMgr/reg.c
@@ -128,10 +128,10 @@ TCHAR *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile)
TCHAR szExe[MAX_PATH],*pszFmt,*pszRunCmd=NULL;
char szDbFile[MAX_PATH];
int cch;
- if(!fFixedDbProfile || !CallService(MS_DB_GETPROFILENAME,SIZEOF(szDbFile),(LPARAM)szDbFile))
+ if (!fFixedDbProfile || !CallService(MS_DB_GETPROFILENAME,SIZEOF(szDbFile),(LPARAM)szDbFile))
if(GetModuleFileNameWorkaround(fMirExe?NULL:hInst,szExe,SIZEOF(szExe))) {
/* db file */
- if(!fFixedDbProfile)
+ if (!fFixedDbProfile)
lstrcpyA(szDbFile,"%1"); /* buffer safe */
/* size */
cch=lstrlen(szExe)+lstrlenA(szDbFile);
@@ -171,7 +171,7 @@ static BOOL IsValidRunCommand(const TCHAR *pszRunCmd)
pargs=_tcschr(&buf[1],_T('\"'));
if(pargs!=NULL) *(pargs++)=0;
pexe=&buf[1];
- if(*pargs==_T(' ')) ++pargs;
+ if (*pargs==_T(' ')) ++pargs;
} else {
pargs=_tcschr(buf,_T(' '));
if(pargs!=NULL) *pargs=0;
@@ -179,7 +179,7 @@ static BOOL IsValidRunCommand(const TCHAR *pszRunCmd)
}
if(SearchPath(NULL,pexe,_T(".exe"),SIZEOF(szFullExe),szFullExe,&pszFilePart)) {
if(pszFilePart!=NULL)
- if(!lstrcmpi(pszFilePart,_T("rundll32.exe")) || !lstrcmpi(pszFilePart,_T("rundll.exe"))) {
+ if (!lstrcmpi(pszFilePart,_T("rundll32.exe")) || !lstrcmpi(pszFilePart,_T("rundll.exe"))) {
/* split into dll path and arguments */
if(pargs[0]==_T('\"')) {
++pargs;
@@ -201,7 +201,7 @@ TCHAR *MakeIconLocation(HMODULE hModule,WORD nIconResID)
{
TCHAR szModule[MAX_PATH],*pszIconLoc=NULL;
int cch;
- if((cch=GetModuleFileNameWorkaround(hModule,szModule,SIZEOF(szModule)))!=0) {
+ if ((cch=GetModuleFileNameWorkaround(hModule,szModule,SIZEOF(szModule)))!=0) {
pszIconLoc=(TCHAR*)mir_alloc((cch+=8)*sizeof(TCHAR));
if(pszIconLoc!=NULL)
wsprintf(pszIconLoc,_T("%s,%i"),szModule,-(int)nIconResID); /* id may be 0, buffer safe */
@@ -231,13 +231,13 @@ static LONG DeleteRegSubTree(HKEY hKey,const TCHAR *pszSubKey)
DWORD nMaxSubKeyLen,cchSubKey;
TCHAR *pszSubKeyBuf;
HKEY hSubKey;
- if((res=RegOpenKeyEx(hKey,pszSubKey,0,KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS|DELETE,&hSubKey))==ERROR_SUCCESS) {
- if((res=RegQueryInfoKey(hSubKey,NULL,NULL,NULL,NULL,&nMaxSubKeyLen,NULL,NULL,NULL,NULL,NULL,NULL))==ERROR_SUCCESS) {
+ if ((res=RegOpenKeyEx(hKey,pszSubKey,0,KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS|DELETE,&hSubKey))==ERROR_SUCCESS) {
+ if ((res=RegQueryInfoKey(hSubKey,NULL,NULL,NULL,NULL,&nMaxSubKeyLen,NULL,NULL,NULL,NULL,NULL,NULL))==ERROR_SUCCESS) {
pszSubKeyBuf=(TCHAR*)mir_alloc((nMaxSubKeyLen+1)*sizeof(TCHAR));
if(pszSubKeyBuf==NULL) res=ERROR_NOT_ENOUGH_MEMORY;
while(!res) {
cchSubKey=nMaxSubKeyLen+1;
- if((res=RegEnumKeyEx(hSubKey,0,pszSubKeyBuf,&cchSubKey,NULL,NULL,NULL,NULL))==ERROR_SUCCESS)
+ if ((res=RegEnumKeyEx(hSubKey,0,pszSubKeyBuf,&cchSubKey,NULL,NULL,NULL,NULL))==ERROR_SUCCESS)
res=DeleteRegSubTree(hSubKey,pszSubKeyBuf); /* recursion */
}
mir_free(pszSubKeyBuf); /* does NULL check */
@@ -245,7 +245,7 @@ static LONG DeleteRegSubTree(HKEY hKey,const TCHAR *pszSubKey)
}
RegCloseKey(hSubKey);
}
- if(!res) res=RegDeleteKey(hKey,pszSubKey);
+ if (!res) res=RegDeleteKey(hKey,pszSubKey);
return res;
}
@@ -255,7 +255,7 @@ static LONG SetRegSubKeyStrDefValue(HKEY hMainKey,const TCHAR *pszSubKey,const T
HKEY hSubKey;
LONG res;
res=RegCreateKeyEx(hMainKey,pszSubKey,0,NULL,0,KEY_SET_VALUE|KEY_QUERY_VALUE,NULL,&hSubKey,NULL);
- if(!res) {
+ if (!res) {
res=RegSetValueEx(hSubKey,NULL,0,REG_SZ,(BYTE*)pszVal,(lstrlen(pszVal)+1)*sizeof(TCHAR));
RegCloseKey(hSubKey);
}
@@ -282,11 +282,11 @@ static TCHAR *GetRegStrValue(HKEY hKey,const TCHAR *pszValName)
TCHAR *pszVal,*pszVal2;
DWORD dwSize,dwType;
/* get size */
- if(!RegQueryValueEx(hKey,pszValName,NULL,NULL,NULL,&dwSize) && dwSize>sizeof(TCHAR)) {
+ if (!RegQueryValueEx(hKey,pszValName,NULL,NULL,NULL,&dwSize) && dwSize>sizeof(TCHAR)) {
pszVal=(TCHAR*)mir_alloc(dwSize+sizeof(TCHAR));
if(pszVal!=NULL) {
/* get value */
- if(!RegQueryValueEx(hKey,pszValName,NULL,&dwType,(BYTE*)pszVal,&dwSize)) {
+ if (!RegQueryValueEx(hKey,pszValName,NULL,&dwType,(BYTE*)pszVal,&dwSize)) {
pszVal[dwSize/sizeof(TCHAR)]=0;
if(dwType==REG_EXPAND_SZ) {
dwSize=MAX_PATH;
@@ -363,7 +363,7 @@ static BOOL ReadDbBackupData(const char *pszSetting,DWORD *pdwType,BYTE **ppData
dbcgs.szModule="AssocMgr";
dbcgs.szSetting=pszSetting;
dbcgs.pValue=&dbv;
- if(!CallService(MS_DB_CONTACT_GETSETTING,0,(LPARAM)&dbcgs)) {
+ if (!CallService(MS_DB_CONTACT_GETSETTING,0,(LPARAM)&dbcgs)) {
if(dbv.type==DBVT_BLOB && dbv.cpbVal>=sizeof(DWORD)) {
*pdwType=*(DWORD*)dbv.pbVal;
*ppData=dbv.pbVal;
@@ -391,8 +391,8 @@ static void BackupRegTree_Worker(HKEY hKey,const char *pszSubKey,struct BackupRe
char *pszName;
register TCHAR *ptszName;
DWORD nDbPrefixLen;
- if((res=RegOpenKeyExA(hKey,pszSubKey,0,KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS,&hKey))==ERROR_SUCCESS) {
- if((res=RegQueryInfoKey(hKey,NULL,NULL,NULL,NULL,&nMaxSubKeyLen,NULL,NULL,&nMaxValNameLen,&nMaxValSize,NULL,NULL))==ERROR_SUCCESS) {
+ if ((res=RegOpenKeyExA(hKey,pszSubKey,0,KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS,&hKey))==ERROR_SUCCESS) {
+ if ((res=RegQueryInfoKey(hKey,NULL,NULL,NULL,NULL,&nMaxSubKeyLen,NULL,NULL,&nMaxValNameLen,&nMaxValSize,NULL,NULL))==ERROR_SUCCESS) {
if(nMaxSubKeyLen>nMaxValNameLen) nMaxValNameLen=nMaxSubKeyLen;
/* prepare buffer */
nDbPrefixLen=(DWORD)lstrlenA(*param->ppszDbPrefix)+lstrlenA(pszSubKey)+1;
@@ -413,16 +413,16 @@ static void BackupRegTree_Worker(HKEY hKey,const char *pszSubKey,struct BackupRe
while(!res) {
cchName=nMaxValNameLen+1;
cbData=nMaxValSize;
- if((res=RegEnumValueA(hKey,index++,pszName,&cchName,NULL,NULL,NULL,NULL))==ERROR_SUCCESS) {
+ if ((res=RegEnumValueA(hKey,index++,pszName,&cchName,NULL,NULL,NULL,NULL))==ERROR_SUCCESS) {
(*param->ppszDbPrefix)[nDbPrefixLen]=0;
lstrcatA(*param->ppszDbPrefix,pszName); /* buffer safe */
ptszName=a2t(pszName);
if(ptszName!=NULL) {
- if(!RegQueryValueEx(hKey,ptszName,NULL,&dwType,pData,&cbData)) {
+ if (!RegQueryValueEx(hKey,ptszName,NULL,&dwType,pData,&cbData)) {
#ifdef _UNICODE
WriteDbBackupData(*param->ppszDbPrefix,dwType,pData,cbData);
#else
- if(!(dwType&REGF_ANSI)) /* sanity check, never happens */
+ if (!(dwType&REGF_ANSI)) /* sanity check, never happens */
WriteDbBackupData(*param->ppszDbPrefix,dwType&REGF_ANSI,pData,cbData);
#endif
}
@@ -439,7 +439,7 @@ static void BackupRegTree_Worker(HKEY hKey,const char *pszSubKey,struct BackupRe
index=0;
while(!res) {
cchName=nMaxSubKeyLen+1;
- if((res=RegEnumKeyExA(hKey,index++,pszName,&cchName,NULL,NULL,NULL,NULL))==ERROR_SUCCESS) {
+ if ((res=RegEnumKeyExA(hKey,index++,pszName,&cchName,NULL,NULL,NULL,NULL))==ERROR_SUCCESS) {
(*param->ppszDbPrefix)[nDbPrefixLen]=0;
BackupRegTree_Worker(hKey,pszName,param); /* recursion */
}
@@ -498,13 +498,13 @@ static LONG RestoreRegTree(HKEY hKey,const char *pszSubKey,const char *pszDbPref
*(pslash++)=0;
hSubKey=hKey;
if(pslash!=pkeys+1)
- if((res=RegCreateKeyExA(hKey,pkeys,0,NULL,0,KEY_SET_VALUE,NULL,&hSubKey,NULL))!=ERROR_SUCCESS)
+ if ((res=RegCreateKeyExA(hKey,pkeys,0,NULL,0,KEY_SET_VALUE,NULL,&hSubKey,NULL))!=ERROR_SUCCESS)
break;
pszValName=pslash;
/* read data */
if(ReadDbBackupData(ppszSettings[i],&dwType,&pData,&cbData)) {
/* set value */
- if(!(dwType&REGF_ANSI)) {
+ if (!(dwType&REGF_ANSI)) {
pwszValName=a2u(pszValName,FALSE);
if(pwszValName!=NULL) res=RegSetValueExW(hSubKey,pwszValName,0,dwType,pData,cbData);
else res=ERROR_NOT_ENOUGH_MEMORY;
@@ -568,7 +568,7 @@ void CleanupRegTreeBackupSettings(void)
--j; /* reiterate current index */
}
/* no longer registered? */
- if(!IsRegisteredAssocItem(pszClassName)) {
+ if (!IsRegisteredAssocItem(pszClassName)) {
if(IsFileClassName(pszClassName,&pszFileExt))
RemoveRegFileExt(pszFileExt,pszClassName);
else RemoveRegClass(pszClassName);
@@ -596,7 +596,7 @@ static BOOL Opera6_GetIniFilePath(TCHAR *szIniFile)
/* Info: http://opera-info.de/forum/thread.php?threadid=2905 */
/* app path */
- if(!RegOpenKeyExA(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Netscape.exe",0,KEY_QUERY_VALUE,&hExeKey)) {
+ if (!RegOpenKeyExA(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Netscape.exe",0,KEY_QUERY_VALUE,&hExeKey)) {
/* exe name */
p=GetRegStrValue(hExeKey,NULL);
if(p!=NULL && _tcsstr(p,_T("Opera.exe"))!=NULL) {
@@ -690,11 +690,11 @@ BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const
return FALSE;
}
/* try to open interactive user's classes key */
- if(!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_CREATE_SUB_KEY,&hRootKey))
+ if (!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_CREATE_SUB_KEY,&hRootKey))
hRootKey=HKEY_CLASSES_ROOT; /* might be write protected by security settings */
/* class */
- if((res=RegCreateKeyExA(hRootKey,pszClassName,0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE|KEY_QUERY_VALUE,NULL,&hClassKey,NULL))==ERROR_SUCCESS) {
+ if ((res=RegCreateKeyExA(hRootKey,pszClassName,0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE|KEY_QUERY_VALUE,NULL,&hClassKey,NULL))==ERROR_SUCCESS) {
/* backup class if shared */
if(fUrlProto) BackupRegTree(hRootKey,pszClassName,"bak_");
/* type description */
@@ -703,7 +703,7 @@ BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const
/* default icon */
if(pszIconLoc!=NULL) SetRegSubKeyStrDefValue(hClassKey,_T("DefaultIcon"),pszIconLoc);
/* url protocol */
- if(!fUrlProto) RegDeleteValue(hClassKey,_T("URL Protocol"));
+ if (!fUrlProto) RegDeleteValue(hClassKey,_T("URL Protocol"));
else RegSetValueEx(hClassKey,_T("URL Protocol"),0,REG_SZ,NULL,0);
/* moniker clsid */
RegDeleteKey(hClassKey,_T("CLSID"));
@@ -711,7 +711,7 @@ BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const
{ DWORD dwFlags=0,dwSize=sizeof(dwFlags);
RegQueryValueEx(hClassKey,_T("EditFlags"),NULL,NULL,(BYTE*)&dwFlags,&dwSize);
if(fBrowserAutoOpen) dwFlags=(dwFlags&~FTA_AlwaysUnsafe)|FTA_OpenIsSafe;
- if(!fUrlProto) dwFlags|=FTA_HasExtension;
+ if (!fUrlProto) dwFlags|=FTA_HasExtension;
else dwFlags=(dwFlags&~FTA_HasExtension)|FTA_Show; /* show classes without extension */
RegSetValueEx(hClassKey,_T("EditFlags"),0,REG_DWORD,(BYTE*)&dwFlags,sizeof(dwFlags));
}
@@ -720,11 +720,11 @@ BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const
RegSetValueExA(hClassKey,"NeverShowExt",0,REG_SZ,NULL,0);
}
/* shell */
- if((res=RegCreateKeyEx(hClassKey,_T("shell"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hShellKey,NULL))==ERROR_SUCCESS) {
+ if ((res=RegCreateKeyEx(hClassKey,_T("shell"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hShellKey,NULL))==ERROR_SUCCESS) {
/* default verb (when empty "open" is used) */
RegSetValueEx(hShellKey,NULL,0,REG_SZ,(BYTE*)_T("open"),5*sizeof(TCHAR));
/* verb */
- if((res=RegCreateKeyEx(hShellKey,_T("open"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hVerbKey,NULL))==ERROR_SUCCESS) {
+ if ((res=RegCreateKeyEx(hShellKey,_T("open"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hVerbKey,NULL))==ERROR_SUCCESS) {
/* verb description */
if(pszVerbDesc==NULL) RegDeleteValue(hVerbKey,NULL);
else RegSetValueEx(hVerbKey,NULL,0,REG_SZ,(BYTE*)pszVerbDesc,(lstrlen(pszVerbDesc)+1)*sizeof(TCHAR));
@@ -734,7 +734,7 @@ BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const
SetRegSubKeyStrDefValue(hVerbKey,_T("command"),pszRunCmd);
/* ddeexec */
if(pszDdeCmd!=NULL) {
- if(!RegCreateKeyEx(hVerbKey,_T("ddeexec"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hDdeKey,NULL)) {
+ if (!RegCreateKeyEx(hVerbKey,_T("ddeexec"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hDdeKey,NULL)) {
/* command */
RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(lstrlen(pszDdeCmd)+1)*sizeof(TCHAR));
/* application */
@@ -746,7 +746,7 @@ BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const
RegCloseKey(hDdeKey);
}
} else {
- if(!RegOpenKeyEx(hVerbKey,_T("ddeexec"),0,DELETE,&hDdeKey)) {
+ if (!RegOpenKeyEx(hVerbKey,_T("ddeexec"),0,DELETE,&hDdeKey)) {
/* application */
RegDeleteKey(hDdeKey,_T("application"));
/* topic */
@@ -782,7 +782,7 @@ BOOL RemoveRegClass(const char *pszClassName)
TCHAR *ptszClassName,*ptszPrevRunCmd;
/* try to open interactive user's classes key */
- if(!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,DELETE,&hRootKey))
+ if (!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,DELETE,&hRootKey))
hRootKey=HKEY_CLASSES_ROOT;
/* class name */
@@ -793,14 +793,14 @@ BOOL RemoveRegClass(const char *pszClassName)
mir_free(ptszClassName); /* does NULL check */
/* backup only saved/restored for fUrlProto */
- if(!res) {
- if((res=RestoreRegTree(hRootKey,pszClassName,"bak_"))==ERROR_SUCCESS)
+ if (!res) {
+ if ((res=RestoreRegTree(hRootKey,pszClassName,"bak_"))==ERROR_SUCCESS)
/* class */
- if(!RegOpenKeyExA(hRootKey,pszClassName,0,KEY_QUERY_VALUE,&hClassKey)) {
+ if (!RegOpenKeyExA(hRootKey,pszClassName,0,KEY_QUERY_VALUE,&hClassKey)) {
/* shell */
- if(!RegOpenKeyEx(hClassKey,_T("shell"),0,KEY_QUERY_VALUE,&hShellKey)) {
+ if (!RegOpenKeyEx(hClassKey,_T("shell"),0,KEY_QUERY_VALUE,&hShellKey)) {
/* verb */
- if(!RegOpenKeyEx(hShellKey,_T("open"),0,KEY_QUERY_VALUE,&hVerbKey)) {
+ if (!RegOpenKeyEx(hShellKey,_T("open"),0,KEY_QUERY_VALUE,&hVerbKey)) {
/* command */
ptszPrevRunCmd=GetRegStrValue(hVerbKey,_T("command"));
if(ptszPrevRunCmd!=NULL && !IsValidRunCommand(ptszPrevRunCmd))
@@ -836,13 +836,13 @@ BOOL IsRegClass(const char *pszClassName,const TCHAR *pszRunCmd)
/* using the merged view classes key for reading */
/* class */
- if(!RegOpenKeyExA(HKEY_CLASSES_ROOT,pszClassName,0,KEY_QUERY_VALUE,&hClassKey)) {
+ if (!RegOpenKeyExA(HKEY_CLASSES_ROOT,pszClassName,0,KEY_QUERY_VALUE,&hClassKey)) {
/* shell */
- if(!RegOpenKeyEx(hClassKey,_T("shell"),0,KEY_QUERY_VALUE,&hShellKey)) {
+ if (!RegOpenKeyEx(hClassKey,_T("shell"),0,KEY_QUERY_VALUE,&hShellKey)) {
/* verb */
- if(!RegOpenKeyEx(hShellKey,_T("open"),0,KEY_QUERY_VALUE,&hVerbKey)) {
+ if (!RegOpenKeyEx(hShellKey,_T("open"),0,KEY_QUERY_VALUE,&hVerbKey)) {
/* command */
- if(!RegOpenKeyEx(hVerbKey,_T("command"),0,KEY_QUERY_VALUE,&hCmdKey)) {
+ if (!RegOpenKeyEx(hVerbKey,_T("command"),0,KEY_QUERY_VALUE,&hCmdKey)) {
/* it is enough to check if the command is right */
fSuccess=IsRegStrValue(hCmdKey,NULL,pszRunCmd);
RegCloseKey(hCmdKey);
@@ -870,9 +870,9 @@ HICON LoadRegClassSmallIcon(const char *pszClassName)
/* using the merged view classes key for reading */
/* class */
- if(!RegOpenKeyExA(HKEY_CLASSES_ROOT,pszClassName,0,KEY_QUERY_VALUE,&hClassKey)) {
+ if (!RegOpenKeyExA(HKEY_CLASSES_ROOT,pszClassName,0,KEY_QUERY_VALUE,&hClassKey)) {
/* default icon */
- if(!RegOpenKeyEx(hClassKey,_T("DefaultIcon"),0,KEY_QUERY_VALUE,&hIconKey)) {
+ if (!RegOpenKeyEx(hClassKey,_T("DefaultIcon"),0,KEY_QUERY_VALUE,&hIconKey)) {
/* extract icon */
pszIconLoc=GetRegStrValue(hIconKey,NULL);
if(pszIconLoc!=NULL) {
@@ -912,11 +912,11 @@ BOOL AddRegFileExt(const char *pszFileExt,const char *pszClassName,const char *p
return FALSE;
/* try to open interactive user's classes key */
- if(!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_CREATE_SUB_KEY,&hRootKey))
+ if (!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_CREATE_SUB_KEY,&hRootKey))
hRootKey=HKEY_CLASSES_ROOT;
/* file ext */
- if(!RegCreateKeyExA(hRootKey,pszFileExt,0,NULL,0,KEY_SET_VALUE|KEY_QUERY_VALUE|KEY_CREATE_SUB_KEY,NULL,&hExtKey,NULL)) {
+ if (!RegCreateKeyExA(hRootKey,pszFileExt,0,NULL,0,KEY_SET_VALUE|KEY_QUERY_VALUE|KEY_CREATE_SUB_KEY,NULL,&hExtKey,NULL)) {
TCHAR *pszPrevClass;
/* backup previous app */
BackupRegTree(hRootKey,pszFileExt,"bak_");
@@ -925,7 +925,7 @@ BOOL AddRegFileExt(const char *pszFileExt,const char *pszClassName,const char *p
/* open with progids */
pszPrevClass=GetRegStrValue(hExtKey,NULL);
if(pszPrevClass!=NULL && !IsRegStrValueA(hExtKey,NULL,pszClassName))
- if(!RegCreateKeyEx(hExtKey,_T("OpenWithProgids"),0,NULL,0,KEY_SET_VALUE,NULL,&hOpenWithKey,NULL)) {
+ if (!RegCreateKeyEx(hExtKey,_T("OpenWithProgids"),0,NULL,0,KEY_SET_VALUE,NULL,&hOpenWithKey,NULL)) {
/* previous class (backup) */
RegSetValueEx(hOpenWithKey,pszPrevClass,0,REG_NONE,NULL,0);
RegCloseKey(hOpenWithKey);
@@ -953,18 +953,18 @@ void RemoveRegFileExt(const char *pszFileExt,const char *pszClassName)
BOOL fRestored=FALSE;
/* try to open interactive user's classes key */
- if(!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,DELETE,&hRootKey))
+ if (!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,DELETE,&hRootKey))
hRootKey=HKEY_CLASSES_ROOT;
/* file ext */
- if(!RegOpenKeyExA(hRootKey,pszFileExt,0,KEY_QUERY_VALUE|KEY_SET_VALUE|DELETE,&hExtKey)) {
+ if (!RegOpenKeyExA(hRootKey,pszFileExt,0,KEY_QUERY_VALUE|KEY_SET_VALUE|DELETE,&hExtKey)) {
/* class name (the important part) */
- if(!RestoreRegTree(hRootKey,pszFileExt,"bak_")) {
+ if (!RestoreRegTree(hRootKey,pszFileExt,"bak_")) {
pszPrevClassName=GetRegStrValue(hExtKey,NULL);
if(pszPrevClassName!=NULL) {
/* previous class name still exists? */
/* using the merged view classes key for reading */
- if(!RegOpenKeyEx(HKEY_CLASSES_ROOT,pszPrevClassName,0,KEY_QUERY_VALUE,&hSubKey)) {
+ if (!RegOpenKeyEx(HKEY_CLASSES_ROOT,pszPrevClassName,0,KEY_QUERY_VALUE,&hSubKey)) {
fRestored=TRUE;
RegCloseKey(hSubKey);
} else RegDeleteValue(hExtKey,NULL);
@@ -974,16 +974,16 @@ void RemoveRegFileExt(const char *pszFileExt,const char *pszClassName)
if(pszPrevClassName==NULL) RegDeleteValue(hExtKey,NULL);
/* open with progids (remove if empty) */
nOpenWithCount=0;
- if(!RegOpenKeyEx(hExtKey,_T("OpenWithProgids"),0,KEY_SET_VALUE|KEY_QUERY_VALUE,&hSubKey)) {
+ if (!RegOpenKeyEx(hExtKey,_T("OpenWithProgids"),0,KEY_SET_VALUE|KEY_QUERY_VALUE,&hSubKey)) {
/* remove current class (if set by another app) */
RegDeleteValueA(hSubKey,pszClassName);
RegQueryInfoKey(hSubKey,NULL,NULL,NULL,NULL,NULL,NULL,NULL,&nOpenWithCount,NULL,NULL,NULL);
RegCloseKey(hSubKey);
}
- if(!nOpenWithCount) RegDeleteKey(hExtKey,_T("OpenWithProgids")); /* delete if no values */
+ if (!nOpenWithCount) RegDeleteKey(hExtKey,_T("OpenWithProgids")); /* delete if no values */
RegCloseKey(hExtKey);
} else DeleteRegTreeBackup(pszFileExt,"bak_");
- if(!fRestored) RegDeleteKeyA(hRootKey,pszFileExt); /* try to remove it all */
+ if (!fRestored) RegDeleteKeyA(hRootKey,pszFileExt); /* try to remove it all */
if(hRootKey!=HKEY_CLASSES_ROOT)
RegCloseKey(hRootKey);
@@ -1002,7 +1002,7 @@ BOOL IsRegFileExt(const char *pszFileExt,const char *pszClassName)
/* using the merged view classes key for reading */
/* file ext */
- if(!RegOpenKeyExA(HKEY_CLASSES_ROOT,pszFileExt,0,KEY_QUERY_VALUE,&hExtKey)) {
+ if (!RegOpenKeyExA(HKEY_CLASSES_ROOT,pszFileExt,0,KEY_QUERY_VALUE,&hExtKey)) {
/* class name */
/* it is enough to check if the class is right */
fSuccess=IsRegStrValueA(hExtKey,NULL,pszClassName);
@@ -1029,13 +1029,13 @@ BOOL AddRegMimeType(const char *pszMimeType,const char *pszFileExt,const TCHAR *
return FALSE;
/* try to open interactive user's classes key */
- if(!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_QUERY_VALUE,&hRootKey))
+ if (!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_QUERY_VALUE,&hRootKey))
hRootKey=HKEY_CLASSES_ROOT;
/* database */
- if(!RegOpenKeyEx(hRootKey,_T("MIME\\Database\\Content Type"),0,KEY_CREATE_SUB_KEY,&hDbKey)) {
+ if (!RegOpenKeyEx(hRootKey,_T("MIME\\Database\\Content Type"),0,KEY_CREATE_SUB_KEY,&hDbKey)) {
/* mime type */
- if(!RegCreateKeyExA(hDbKey,pszMimeType,0,NULL,0,KEY_QUERY_VALUE|KEY_SET_VALUE,NULL,&hTypeKey,NULL)) {
+ if (!RegCreateKeyExA(hDbKey,pszMimeType,0,NULL,0,KEY_QUERY_VALUE|KEY_SET_VALUE,NULL,&hTypeKey,NULL)) {
/* file ext */
if(RegQueryValueExA(hTypeKey,"Extension",NULL,NULL,NULL,NULL)) /* only set if not present */
fSuccess=!RegSetValueExA(hTypeKey,"Extension",0,REG_SZ,(BYTE*)pszFileExt,lstrlenA(pszFileExt)+1);
@@ -1057,13 +1057,13 @@ void RemoveRegMimeType(const char *pszMimeType,const char *pszFileExt)
BOOL fDelete=TRUE;
/* try to open interactive user's classes key */
- if(!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_QUERY_VALUE,&hRootKey))
+ if (!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_QUERY_VALUE,&hRootKey))
hRootKey=HKEY_CLASSES_ROOT;
/* database */
- if(!RegOpenKeyEx(hRootKey,_T("MIME\\Database\\Content Type"),0,DELETE,&hDbKey)) {
+ if (!RegOpenKeyEx(hRootKey,_T("MIME\\Database\\Content Type"),0,DELETE,&hDbKey)) {
/* mime type */
- if(!RegOpenKeyExA(hDbKey,pszMimeType,0,KEY_QUERY_VALUE,&hTypeKey)) {
+ if (!RegOpenKeyExA(hDbKey,pszMimeType,0,KEY_QUERY_VALUE,&hTypeKey)) {
/* file ext */
fDelete=IsRegStrValueA(hTypeKey,_T("Extension"),pszFileExt);
RegCloseKey(hTypeKey);
@@ -1088,13 +1088,13 @@ void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR
HKEY hRootKey,hAppsKey,hExeKey,hShellKey,hVerbKey,hDdeKey;
/* try to open interactive user's classes key */
- if(!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_QUERY_VALUE,&hRootKey))
+ if (!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_QUERY_VALUE,&hRootKey))
hRootKey=HKEY_CLASSES_ROOT;
/* database */
- if(!RegCreateKeyEx(hRootKey,_T("Applications"),0,NULL,0,KEY_CREATE_SUB_KEY,NULL,&hAppsKey,NULL)) {
+ if (!RegCreateKeyEx(hRootKey,_T("Applications"),0,NULL,0,KEY_CREATE_SUB_KEY,NULL,&hAppsKey,NULL)) {
/* filename */
- if(!RegCreateKeyEx(hAppsKey,pszAppFileName,0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hExeKey,NULL)) {
+ if (!RegCreateKeyEx(hAppsKey,pszAppFileName,0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hExeKey,NULL)) {
/* appname */
RegSetValueEx(hExeKey,NULL,0,REG_SZ,(BYTE*)pszAppName,(lstrlen(pszAppName)+1)*sizeof(TCHAR));
/* no open-with flag */
@@ -1103,18 +1103,18 @@ void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR
/* default icon */
if(pszIconLoc!=NULL) SetRegSubKeyStrDefValue(hExeKey,_T("DefaultIcon"),pszIconLoc);
/* shell */
- if(!RegCreateKeyEx(hExeKey,_T("shell"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hShellKey,NULL)) {
+ if (!RegCreateKeyEx(hExeKey,_T("shell"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hShellKey,NULL)) {
/* default verb (when empty "open" is used) */
RegSetValueEx(hShellKey,NULL,0,REG_SZ,(BYTE*)_T("open"),5*sizeof(TCHAR));
/* verb */
- if(!RegCreateKeyEx(hShellKey,_T("open"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hVerbKey,NULL)) {
+ if (!RegCreateKeyEx(hShellKey,_T("open"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hVerbKey,NULL)) {
/* friendly appname (mui string) */
RegSetValueEx(hVerbKey,_T("FriendlyAppName"),0,REG_SZ,(BYTE*)pszAppName,(lstrlen(pszAppName)+1)*sizeof(TCHAR));
/* command */
SetRegSubKeyStrDefValue(hVerbKey,_T("command"),pszRunCmd);
/* ddeexec */
if(pszDdeCmd!=NULL)
- if(!RegCreateKeyEx(hVerbKey,_T("ddeexec"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hDdeKey,NULL)) {
+ if (!RegCreateKeyEx(hVerbKey,_T("ddeexec"),0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hDdeKey,NULL)) {
/* command */
RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(lstrlen(pszDdeCmd)+1)*sizeof(TCHAR));
/* application */
@@ -1141,23 +1141,23 @@ void RemoveRegOpenWith(const TCHAR *pszAppFileName)
HKEY hRootKey,hAppsKey,hExeKey,hShellKey,hVerbKey,hDdeKey;
/* try to open interactive user's classes key */
- if(!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_QUERY_VALUE,&hRootKey))
+ if (!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_QUERY_VALUE,&hRootKey))
hRootKey=HKEY_CLASSES_ROOT;
/* applications */
- if(!RegOpenKeyEx(hRootKey,_T("Applications"),0,DELETE,&hAppsKey)) {
+ if (!RegOpenKeyEx(hRootKey,_T("Applications"),0,DELETE,&hAppsKey)) {
/* filename */
- if(!RegOpenKeyEx(hAppsKey,pszAppFileName,0,DELETE,&hExeKey)) {
+ if (!RegOpenKeyEx(hAppsKey,pszAppFileName,0,DELETE,&hExeKey)) {
/* default icon */
RegDeleteKey(hExeKey,_T("DefaultIcon"));
/* shell */
- if(!RegOpenKeyEx(hExeKey,_T("shell"),0,DELETE,&hShellKey)) {
+ if (!RegOpenKeyEx(hExeKey,_T("shell"),0,DELETE,&hShellKey)) {
/* verb */
- if(!RegOpenKeyEx(hShellKey,_T("open"),0,DELETE,&hVerbKey)) {
+ if (!RegOpenKeyEx(hShellKey,_T("open"),0,DELETE,&hVerbKey)) {
/* command */
RegDeleteKey(hVerbKey,_T("command"));
/* ddeexec */
- if(!RegOpenKeyEx(hVerbKey,_T("ddeexec"),0,DELETE,&hDdeKey)) {
+ if (!RegOpenKeyEx(hVerbKey,_T("ddeexec"),0,DELETE,&hDdeKey)) {
/* application */
RegDeleteKey(hDdeKey,_T("application"));
/* topic */
@@ -1192,15 +1192,15 @@ void AddRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt,c
HKEY hRootKey,hAppsKey,hExeKey,hTypesKey;
/* try to open interactive user's classes key */
- if(!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_QUERY_VALUE,&hRootKey))
+ if (!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_QUERY_VALUE,&hRootKey))
hRootKey=HKEY_CLASSES_ROOT;
/* applications */
- if(!RegOpenKeyEx(hRootKey,_T("Applications"),0,KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS,&hAppsKey)) {
+ if (!RegOpenKeyEx(hRootKey,_T("Applications"),0,KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS,&hAppsKey)) {
/* filename */
- if(!RegOpenKeyEx(hAppsKey,pszAppFileName,0,KEY_CREATE_SUB_KEY,&hExeKey)) {
+ if (!RegOpenKeyEx(hAppsKey,pszAppFileName,0,KEY_CREATE_SUB_KEY,&hExeKey)) {
/* supported types */
- if(!RegCreateKeyEx(hExeKey,_T("SupportedTypes"),0,NULL,0,KEY_SET_VALUE,NULL,&hTypesKey,NULL)) {
+ if (!RegCreateKeyEx(hExeKey,_T("SupportedTypes"),0,NULL,0,KEY_SET_VALUE,NULL,&hTypesKey,NULL)) {
TCHAR *ptszFileExt;
ptszFileExt=a2t(pszFileExt);
if(ptszFileExt!=NULL)
@@ -1222,15 +1222,15 @@ void RemoveRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileEx
HKEY hRootKey,hAppsKey,hExeKey,hTypesKey;
/* try to open interactive user's classes key */
- if(!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_QUERY_VALUE,&hRootKey))
+ if (!IsWinVer2000Plus() || RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Classes"),0,KEY_QUERY_VALUE,&hRootKey))
hRootKey=HKEY_CLASSES_ROOT;
/* applications */
- if(!RegOpenKeyEx(hRootKey,_T("Applications"),0,KEY_QUERY_VALUE,&hAppsKey)) {
+ if (!RegOpenKeyEx(hRootKey,_T("Applications"),0,KEY_QUERY_VALUE,&hAppsKey)) {
/* filename */
- if(!RegOpenKeyEx(hAppsKey,pszAppFileName,0,KEY_QUERY_VALUE,&hExeKey)) {
+ if (!RegOpenKeyEx(hAppsKey,pszAppFileName,0,KEY_QUERY_VALUE,&hExeKey)) {
/* supported types */
- if(!RegOpenKeyEx(hExeKey,_T("SupportedTypes"),0,KEY_SET_VALUE,&hTypesKey)) {
+ if (!RegOpenKeyEx(hExeKey,_T("SupportedTypes"),0,KEY_SET_VALUE,&hTypesKey)) {
RegDeleteValueA(hTypesKey,pszFileExt);
RegCloseKey(hTypesKey);
}
@@ -1255,7 +1255,7 @@ BOOL AddRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd)
HKEY hRunKey;
/* run */
- if(!RegCreateKeyEx(HKEY_CURRENT_USER,_T("Software\\Microsoft\\Windows\\CurrentVersion\\Run"),0,NULL,0,KEY_SET_VALUE,NULL,&hRunKey,NULL)) {
+ if (!RegCreateKeyEx(HKEY_CURRENT_USER,_T("Software\\Microsoft\\Windows\\CurrentVersion\\Run"),0,NULL,0,KEY_SET_VALUE,NULL,&hRunKey,NULL)) {
/* appname */
fSuccess=!RegSetValueEx(hRunKey,pszAppName,0,REG_SZ,(BYTE*)pszRunCmd,(lstrlen(pszRunCmd)+1)*sizeof(TCHAR));
RegCloseKey(hRunKey);
@@ -1270,7 +1270,7 @@ BOOL RemoveRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd)
/* run */
res=RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Microsoft\\Windows\\CurrentVersion\\Run"),0,KEY_QUERY_VALUE|KEY_SET_VALUE,&hRunKey);
- if(!res) {
+ if (!res) {
/* appname */
if(IsRegStrValue(hRunKey,pszAppName,pszRunCmd))
res=RegDeleteValue(hRunKey,pszAppName); /* only remove if current */
@@ -1289,7 +1289,7 @@ BOOL IsRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd)
HKEY hRunKey;
/* Run */
- if(!RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Microsoft\\Windows\\CurrentVersion\\Run"),0,KEY_QUERY_VALUE,&hRunKey)) {
+ if (!RegOpenKeyEx(HKEY_CURRENT_USER,_T("Software\\Microsoft\\Windows\\CurrentVersion\\Run"),0,KEY_QUERY_VALUE,&hRunKey)) {
/* appname */
fState=IsRegStrValue(hRunKey,pszAppName,pszRunCmd);
RegCloseKey(hRunKey);
diff --git a/plugins/AssocMgr/test.c b/plugins/AssocMgr/test.c
index 0da578d4ec..73112af5a5 100644
--- a/plugins/AssocMgr/test.c
+++ b/plugins/AssocMgr/test.c
@@ -92,23 +92,23 @@ static int ServiceParseAimLink(WPARAM wParam,LPARAM lParam)
/* skip leading prefix */
arg=strchr(arg,':');
if(arg==NULL) return 1; /* parse failed */
- for(++arg;*arg=='/';++arg);
+ for (++arg;*arg=='/';++arg);
/*
add user: aim:addbuddy?screenname=NICK&groupname=GROUP
send message: aim:goim?screenname=NICK&message=MSG
open chatroom: aim:gochat?roomname=ROOM&exchange=NUM
*/
/* add a contact to the list */
- if(!_strnicmp(arg,"addbuddy?",9)) {
+ if (!_strnicmp(arg,"addbuddy?",9)) {
char *tok,*sn=NULL,*group=NULL;
ADDCONTACTSTRUCT acs;
PROTOSEARCHRESULT psr;
- if(*(arg+=9)==0) return 1; /* parse failed */
+ if (*(arg+=9)==0) return 1; /* parse failed */
tok=strtok(arg,"&"); /* first token */
while(tok!=NULL) {
- if(!_strnicmp(tok,"screenname=",11) && *(tok+11)!=0)
+ if (!_strnicmp(tok,"screenname=",11) && *(tok+11)!=0)
sn=Netlib_UrlDecode(tok+11);
- if(!_strnicmp(tok,"groupname=",10) && *(tok+10)!=0)
+ if (!_strnicmp(tok,"groupname=",10) && *(tok+10)!=0)
group=Netlib_UrlDecode(tok+10); /* group is currently ignored */
tok=strtok(NULL,"&"); /* next token */
}
@@ -125,15 +125,15 @@ static int ServiceParseAimLink(WPARAM wParam,LPARAM lParam)
return 0;
}
/* send a message to a contact */
- else if(!_strnicmp(arg,"goim?",5)) {
+ else if (!_strnicmp(arg,"goim?",5)) {
char *tok,*sn=NULL,*msg=NULL;
HANDLE hContact;
- if(*(arg+=5)==0) return 1; /* parse failed */
+ if (*(arg+=5)==0) return 1; /* parse failed */
tok=strtok(arg,"&"); /* first token */
while(tok!=NULL) {
- if(!_strnicmp(tok,"screenname=",11) && *(tok+11)!=0)
+ if (!_strnicmp(tok,"screenname=",11) && *(tok+11)!=0)
sn=Netlib_UrlDecode(tok+11);
- if(!_strnicmp(tok,"message=",8) && *(tok+8)!=0)
+ if (!_strnicmp(tok,"message=",8) && *(tok+8)!=0)
msg=Netlib_UrlDecode(tok+8);
tok=strtok(NULL,"&"); /* next token */
}
@@ -151,15 +151,15 @@ static int ServiceParseAimLink(WPARAM wParam,LPARAM lParam)
return 0;
}
/* open a chatroom */
- else if(!_strnicmp(arg,"gochat?",7)) {
+ else if (!_strnicmp(arg,"gochat?",7)) {
char *tok,*rm=NULL;
int exchange=0;
- if(*(arg+=7)==0) return 1; /* parse failed */
+ if (*(arg+=7)==0) return 1; /* parse failed */
tok=strtok(arg,"&"); /* first token */
while(tok!=NULL) {
- if(!_strnicmp(tok,"roomname=",9) && *(tok+9)!=0)
+ if (!_strnicmp(tok,"roomname=",9) && *(tok+9)!=0)
rm=Netlib_UrlDecode(tok+9);
- if(!_strnicmp(tok,"exchange=",9))
+ if (!_strnicmp(tok,"exchange=",9))
exchange=atoi(Netlib_UrlDecode(tok+9));
tok=strtok(NULL,"&"); /* next token */
}
@@ -341,9 +341,9 @@ static int IcqOpenFile(WPARAM wParam,LPARAM lParam)
if(IsEmpty(line)) continue;
if(line[0]=='[') {
ZeroMemory(&info,sizeof(info));
- if(!lstrcmpiA(line,"[ICQ Message User]"))
+ if (!lstrcmpiA(line,"[ICQ Message User]"))
info.type=ICQFILE_MESSAGEUSER;
- else if(!lstrcmpiA(line,"[ICQ User]"))
+ else if (!lstrcmpiA(line,"[ICQ User]"))
info.type=ICQFILE_ADDUSER;
continue;
}
@@ -351,11 +351,11 @@ static int IcqOpenFile(WPARAM wParam,LPARAM lParam)
sep=strchr(line,'=');
if(sep==NULL) { info.type=0; break; } /* format error */
*(sep++)='\0';
- if(!lstrcmpA("UIN",line)) lstrcpynA(info.uin,sep,sizeof(info.uin)); /* buffer safe */
- else if(!lstrcmpA("Email",line)) lstrcpynA(info.email,sep,sizeof(info.email)); /* buffer safe */
- else if(!lstrcmpA("NickName",line)) lstrcpynA(info.nick,sep,sizeof(info.nick)); /* buffer safe */
- else if(!lstrcmpA("FirstName",line)) lstrcpynA(info.firstName,sep,sizeof(info.firstName)); /* buffer safe */
- else if(!lstrcmpA("LastName",line)) lstrcpynA(info.lastName,sep,sizeof(info.lastName)); /* buffer safe */
+ if (!lstrcmpA("UIN",line)) lstrcpynA(info.uin,sep,sizeof(info.uin)); /* buffer safe */
+ else if (!lstrcmpA("Email",line)) lstrcpynA(info.email,sep,sizeof(info.email)); /* buffer safe */
+ else if (!lstrcmpA("NickName",line)) lstrcpynA(info.nick,sep,sizeof(info.nick)); /* buffer safe */
+ else if (!lstrcmpA("FirstName",line)) lstrcpynA(info.firstName,sep,sizeof(info.firstName)); /* buffer safe */
+ else if (!lstrcmpA("LastName",line)) lstrcpynA(info.lastName,sep,sizeof(info.lastName)); /* buffer safe */
}
fclose(fp);
switch(info.type) {
@@ -424,13 +424,13 @@ static int ServiceParseYmsgrLink(WPARAM wParam,LPARAM lParam)
/* skip leading prefix */
arg=strchr(arg,':');
if(arg==NULL) return 1; /* parse failed */
- for(++arg;*arg=='/';++arg);
+ for (++arg;*arg=='/';++arg);
/* add a contact to the list */
- if(!_strnicmp(arg,"addfriend?",10)) {
+ if (!_strnicmp(arg,"addfriend?",10)) {
char *tok,*id=NULL;
ADDCONTACTSTRUCT acs;
PROTOSEARCHRESULT psr;
- if(*(arg+=10)==0) return 1; /* parse failed */
+ if (*(arg+=10)==0) return 1; /* parse failed */
tok=strtok(arg,"&"); /* first token */
if(tok!=NULL) id=Netlib_UrlDecode(tok);
if(id==NULL || *id==0) return 1; /* parse failed */
@@ -446,14 +446,14 @@ static int ServiceParseYmsgrLink(WPARAM wParam,LPARAM lParam)
return 0;
}
/* send a message to a contact */
- else if(!_strnicmp(arg,"sendim?",7)) {
+ else if (!_strnicmp(arg,"sendim?",7)) {
char *tok,*id=NULL,*msg=NULL;
HANDLE hContact;
- if(*(arg+=7)==0) return 1; /* parse failed */
+ if (*(arg+=7)==0) return 1; /* parse failed */
tok=strtok(arg,"&"); /* first token */
if(tok!=NULL) id=tok;
while(tok!=NULL) {
- if(!_strnicmp(tok,"m=",2) && *(tok+2)!=0)
+ if (!_strnicmp(tok,"m=",2) && *(tok+2)!=0)
msg=Netlib_UrlDecode(tok+2);
tok=strtok(NULL,"&"); /* next token */
}
@@ -466,9 +466,9 @@ static int ServiceParseYmsgrLink(WPARAM wParam,LPARAM lParam)
return 0;
}
/* open a chatroom */
- else if(!_strnicmp(arg,"chat?",5)) {
+ else if (!_strnicmp(arg,"chat?",5)) {
char *tok,*rm=NULL;
- if(*(arg+=5)==0) return 1; /* parse failed */
+ if (*(arg+=5)==0) return 1; /* parse failed */
tok=strtok(arg,"&"); /* first token */
if(tok!=NULL) rm=Netlib_UrlDecode(tok);
if(rm==NULL) return 1; /* parse failed */
@@ -536,16 +536,16 @@ static int ServiceParseMsnimLink(WPARAM wParam,LPARAM lParam)
/* skip leading prefix */
arg=strchr(arg,':');
if(arg==NULL) return 1; /* parse failed */
- for(++arg;*arg=='/';++arg);
+ for (++arg;*arg=='/';++arg);
/* add a contact to the list */
- if(!_strnicmp(arg,"add?",4)) {
+ if (!_strnicmp(arg,"add?",4)) {
char *tok,*email=NULL;
ADDCONTACTSTRUCT acs;
PROTOSEARCHRESULT psr;
- if(*(arg+=4)==0) return 1; /* parse failed */
+ if (*(arg+=4)==0) return 1; /* parse failed */
tok=strtok(arg,"&"); /* first token */
while(tok!=NULL) {
- if(!_strnicmp(tok,"contact=",8) && *(tok+11)!=0)
+ if (!_strnicmp(tok,"contact=",8) && *(tok+11)!=0)
email=Netlib_UrlDecode(tok+11);
tok=strtok(NULL,"&"); /* next token */
}
@@ -564,14 +564,14 @@ static int ServiceParseMsnimLink(WPARAM wParam,LPARAM lParam)
}
/* send a message to a contact */
/* "voice" and "video" not yet implemented, perform same action as "chat" */
- else if(!_strnicmp(arg,"chat?",5) || !_strnicmp(arg,"voice?",6) || !_strnicmp(arg,"video?",6)) {
+ else if (!_strnicmp(arg,"chat?",5) || !_strnicmp(arg,"voice?",6) || !_strnicmp(arg,"video?",6)) {
char *tok,*email=NULL;
HANDLE hContact;
- if(*(arg+=5)==0) return 1; /* parse failed */
- if(*arg=='?' && *(++arg)==0) return 1; /* for "voice?" and "video?" */
+ if (*(arg+=5)==0) return 1; /* parse failed */
+ if (*arg=='?' && *(++arg)==0) return 1; /* for "voice?" and "video?" */
tok=strtok(arg,"&"); /* first token */
while(tok!=NULL) {
- if(!_strnicmp(tok,"contact=",8) && *(tok+11)!=0)
+ if (!_strnicmp(tok,"contact=",8) && *(tok+11)!=0)
email=Netlib_UrlDecode(tok+11);
tok=strtok(NULL,"&"); /* next token */
}
@@ -640,7 +640,7 @@ static int ServiceParseLink(WPARAM wParam,LPARAM lParam)
/* skip leading prefix */
arg=strchr(arg,':');
if(arg==NULL) return 1; /* parse failed */
- for(++arg;*arg=='/';++arg);
+ for (++arg;*arg=='/';++arg);
/* send a message to a contact */
{ HANDLE hContact;
if(ServiceExists(MS_MSG_SENDMESSAGE)) {
@@ -705,7 +705,7 @@ static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam)
/* skip leading prefix */
arg=strchr(arg,':');
if(arg==NULL) return 1; /* parse failed */
- for(++arg;*arg=='/';++arg);
+ for (++arg;*arg=='/';++arg);
/*
complete specification: http://www.xmpp.org/extensions/xep-0147.html
send message: xmpp:JID?message;subject=TEXT&body=TEXT
@@ -716,9 +716,9 @@ static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam)
arg=strchr(jid=arg,'?');
if(arg==NULL) arg+=lstrlenA(arg); /* points to terminating nul */
else *(arg++)=0;
- if(*jid==0) return 1; /* parse failed */
+ if (*jid==0) return 1; /* parse failed */
/* send a message to a contact */
- else if(*arg==0 || (!_strnicmp(arg,"message",7) && (*(arg+7)==';' || *(arg+7)==0))) {
+ else if (*arg==0 || (!_strnicmp(arg,"message",7) && (*(arg+7)==';' || *(arg+7)==0))) {
char *tok,*subj=NULL,*body=NULL;
HANDLE hContact;
char msg[1024];
@@ -726,9 +726,9 @@ static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam)
while(*arg==';') ++arg;
tok=strtok(arg,"&"); /* first token */
while(tok!=NULL) {
- if(!_strnicmp(tok,"subject=",8) && *(tok+8)!=0)
+ if (!_strnicmp(tok,"subject=",8) && *(tok+8)!=0)
subj=Netlib_UrlDecode(tok+8);
- if(!_strnicmp(tok,"body=",5) && *(tok+5)!=0)
+ if (!_strnicmp(tok,"body=",5) && *(tok+5)!=0)
body=Netlib_UrlDecode(tok+5);
tok=strtok(NULL,"&"); /* next token */
}
@@ -744,7 +744,7 @@ static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam)
return 0;
}
/* add user to contact list */
- else if(!_strnicmp(arg,"roster",6) && (*(arg+6)==';' || *(arg+6)==0)) {
+ else if (!_strnicmp(arg,"roster",6) && (*(arg+6)==';' || *(arg+6)==0)) {
ADDCONTACTSTRUCT acs;
PROTOSEARCHRESULT psr;
if(JabberHContactFromJID(jid)==NULL) { /* does not yet check if jid belongs to current user */
@@ -759,7 +759,7 @@ static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam)
return 0;
}
/* remove user from contact list */
- else if(!_strnicmp(arg,"remove",6) && (*(arg+6)==';' || *(arg+6)==0)) {
+ else if (!_strnicmp(arg,"remove",6) && (*(arg+6)==';' || *(arg+6)==0)) {
HANDLE hContact;
hContact=JabberHContactFromJID(jid);
if(hContact==NULL) /* not yet implemented: show standard miranda dialog here */
@@ -767,12 +767,12 @@ static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam)
return 0;
}
/* add user subscription */
- else if(!_strnicmp(arg,"subscribe",9) && (*(arg+9)==';' || *(arg+9)==0)) {
+ else if (!_strnicmp(arg,"subscribe",9) && (*(arg+9)==';' || *(arg+9)==0)) {
/* not yet implemented */
return 0;
}
/* remove user subscription */
- else if(!_strnicmp(arg,"unsubscribe",11) && (*(arg+11)==';' || *(arg+11)==0)) {
+ else if (!_strnicmp(arg,"unsubscribe",11) && (*(arg+11)==';' || *(arg+11)==0)) {
/* not yet implemented */
return 0;
}
diff --git a/plugins/AssocMgr/utils.c b/plugins/AssocMgr/utils.c
index d5ae8b7327..89e0867a59 100644
--- a/plugins/AssocMgr/utils.c
+++ b/plugins/AssocMgr/utils.c
@@ -41,7 +41,7 @@ WCHAR* a2u(const char *pszAnsi,BOOL fMirCp)
if(pszAnsi==NULL) return NULL;
codepage=fMirCp?CallService(MS_LANGPACK_GETCODEPAGE,0,0):CP_ACP;
cch=MultiByteToWideChar(codepage,0,pszAnsi,-1,NULL,0);
- if(!cch) return NULL;
+ if (!cch) return NULL;
psz=(WCHAR*)mir_alloc(cch*sizeof(WCHAR));
if(psz!=NULL && !MultiByteToWideChar(codepage,0,pszAnsi,-1,psz,cch)) {
@@ -62,11 +62,11 @@ char* u2a(const WCHAR *pszUnicode,BOOL fMirCp)
codepage=fMirCp?CallService(MS_LANGPACK_GETCODEPAGE,0,0):CP_ACP;
/* without WC_COMPOSITECHECK some characters might get out strange (see MS blog) */
cch=WideCharToMultiByte(codepage,flags=WC_COMPOSITECHECK,pszUnicode,-1,NULL,0,NULL,NULL);
- if(!cch) cch=WideCharToMultiByte(codepage,flags=0,pszUnicode,-1,NULL,0,NULL,NULL);
- if(!cch) return NULL;
+ if (!cch) cch=WideCharToMultiByte(codepage,flags=0,pszUnicode,-1,NULL,0,NULL,NULL);
+ if (!cch) return NULL;
psz=(char*)mir_alloc(cch);
- if(psz!=NULL && !WideCharToMultiByte(codepage,flags,pszUnicode,-1,psz,cch,NULL,NULL)){
+ if(psz!=NULL && !WideCharToMultiByte(codepage,flags,pszUnicode,-1,psz,cch,NULL,NULL)) {
mir_free(psz);
return NULL;
}
@@ -89,7 +89,7 @@ TCHAR* s2t(const void *pszStr,DWORD fUnicode,BOOL fMirCp)
void* t2s(const TCHAR *pszStr,DWORD fUnicode,BOOL fMirCp)
{
#if defined(_UNICODE)
- if(!fUnicode) return (void*)u2a(pszStr,fMirCp);
+ if (!fUnicode) return (void*)u2a(pszStr,fMirCp);
return (void*)mir_wstrdup(pszStr);
#else
if(fUnicode) return (void*)a2u(pszStr,fMirCp);
@@ -109,7 +109,7 @@ struct EnumPrefixSettingsParams {
static int EnumPrefixSettingsProc(const char *pszSetting,LPARAM lParam)
{
struct EnumPrefixSettingsParams *param=(struct EnumPrefixSettingsParams*)lParam;
- if(!strncmp(pszSetting,param->pszPrefix,param->nPrefixLen)) {
+ if (!strncmp(pszSetting,param->pszPrefix,param->nPrefixLen)) {
char **buf;
/* resize storage array */
buf=mir_realloc(param->settings,(param->nSettingsCount+1)*sizeof(char*));
@@ -168,7 +168,7 @@ void ShowInfoMessage(BYTE flags,const char *pszTitle,const char *pszTextFmt,...)
msn.szInfo=(char*)szText;
msn.uTimeout=30000; /* max timeout */
msn.dwInfoFlags=flags;
- if(!CallServiceSync(MS_CLIST_SYSTRAY_NOTIFY,0,(LPARAM)&msn))
+ if (!CallServiceSync(MS_CLIST_SYSTRAY_NOTIFY,0,(LPARAM)&msn))
return; /* success */
}
@@ -192,7 +192,7 @@ char* GetWinErrorDescription(DWORD dwLastError)
{
char *buf=NULL;
DWORD flags=FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM;
- if(!FormatMessageA(flags,NULL,dwLastError,LANGIDFROMLCID((LCID)CallService(MS_LANGPACK_GETLOCALE,0,0)),(char*)&buf,0,NULL))
+ if (!FormatMessageA(flags,NULL,dwLastError,LANGIDFROMLCID((LCID)CallService(MS_LANGPACK_GETLOCALE,0,0)),(char*)&buf,0,NULL))
if(GetLastError()==ERROR_RESOURCE_LANG_NOT_FOUND)
FormatMessageA(flags,NULL,dwLastError,0,(char*)&buf,0,NULL);
return buf;
diff --git a/plugins/Boltun/boltun.cpp b/plugins/Boltun/boltun.cpp
index b63b082329..27169761eb 100644
--- a/plugins/Boltun/boltun.cpp
+++ b/plugins/Boltun/boltun.cpp
@@ -360,10 +360,10 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
Config.PauseDepends = IsDlgButtonChecked(hwndDlg, IDC_PAUSEDEPENDS) == BST_CHECKED ? TRUE : FALSE;
Config.PauseRandom = IsDlgButtonChecked(hwndDlg, IDC_PAUSERANDOM) == BST_CHECKED ? TRUE : FALSE;
Config.AnswerPauseTime = GetDlgItemInt(hwndDlg, IDC_WAITTIME, &bTranslated, FALSE);
- if(!bTranslated)
+ if (!bTranslated)
Config.AnswerPauseTime = 2;
Config.AnswerThinkTime = GetDlgItemInt(hwndDlg, IDC_THINKTIME, &bTranslated, FALSE);
- if(!bTranslated)
+ if (!bTranslated)
Config.AnswerThinkTime = 4;
TCHAR c[MAX_WARN_TEXT];
bTranslated = GetDlgItemText(hwndDlg, IDC_WARNTXT, c, MAX_WARN_TEXT);
@@ -443,7 +443,7 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
ofn.nMaxFile = fileNameSize;
ofn.Flags = OFN_FILEMUSTEXIST;
ofn.lpstrInitialDir = path;
- if(!GetOpenFileName(&ofn))
+ if (!GetOpenFileName(&ofn))
{
delete filename;
delete[] filt;
@@ -471,7 +471,7 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
const TCHAR *c = Config.MindFileName;
int line;
bTranslated = blInit = LoadMind(c, line);
- if(!bTranslated)
+ if (!bTranslated)
{
TCHAR* message = new TCHAR[5000];
wsprintf(message, TranslateTS(FAILED_TO_LOAD_BASE), line, c);
@@ -684,7 +684,7 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
}
int line;
blInit = LoadMind(Config.MindFileName, line);
- if(!blInit)
+ if (!blInit)
{
TCHAR path[2000];
wsprintf(path, TranslateTS(FAILED_TO_LOAD_BASE), line, (const TCHAR*)Config.MindFileName);
diff --git a/plugins/Boltun/config.cpp b/plugins/Boltun/config.cpp
index a59fc89d56..4a88bf2df3 100644
--- a/plugins/Boltun/config.cpp
+++ b/plugins/Boltun/config.cpp
@@ -49,7 +49,7 @@ inline TCHAR* GetString(char* key, const TCHAR* def)
{
DBVARIANT dbv;
TCHAR* val;
- if(!DBGetContactSettingTString(NULL, BOLTUN_KEY, key, &dbv))
+ if (!DBGetContactSettingTString(NULL, BOLTUN_KEY, key, &dbv))
{
size_t len = wcslen(dbv.ptszVal) + 1;
val = new TCHAR[len];
diff --git a/plugins/BossKeyPlus/BossKey.cpp b/plugins/BossKeyPlus/BossKey.cpp
index a0c3e18cae..e7f6226b91 100644
--- a/plugins/BossKeyPlus/BossKey.cpp
+++ b/plugins/BossKeyPlus/BossKey.cpp
@@ -472,7 +472,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
if (g_wMask & OPT_REQPASS){ //password request
DBVARIANT dbVar = {0};
- if(!DBGetContactSettingString(NULL,MOD_NAME,"password",&dbVar))
+ if (!DBGetContactSettingString(NULL,MOD_NAME,"password",&dbVar))
{
g_fPassRequested = true;
@@ -715,7 +715,7 @@ static int TabsrmmButtonPressed(WPARAM wParam, LPARAM lParam)
{
CustomButtonClickData *cbcd=(CustomButtonClickData *)lParam;
- if(!strcmp(cbcd->pszModule, MOD_NAME))
+ if (!strcmp(cbcd->pszModule, MOD_NAME))
BossKeyHideMiranda(0, 0);
return 0;
diff --git a/plugins/BuddyExpectator/options.cpp b/plugins/BuddyExpectator/options.cpp
index d190cd5c29..84b9eef9e2 100644
--- a/plugins/BuddyExpectator/options.cpp
+++ b/plugins/BuddyExpectator/options.cpp
@@ -393,7 +393,7 @@ static INT_PTR CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP
}
else
{
- if ((HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == CBN_SELCHANGE) || ((HIWORD(wParam) == EN_CHANGE) && !ChangeLock)){
+ if ((HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == CBN_SELCHANGE) || ((HIWORD(wParam) == EN_CHANGE) && !ChangeLock)) {
SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0);
}
if (LOWORD(wParam) == IDC_COLORS_POPUP)
diff --git a/plugins/CSList/strpos.h b/plugins/CSList/strpos.h
index 14ea88a8f6..aaffa3988b 100644
--- a/plugins/CSList/strpos.h
+++ b/plugins/CSList/strpos.h
@@ -58,7 +58,7 @@ int strpos( STRING haystack, STRING needle )
pDest = (STRING) wcsstr( haystack, needle );
#endif /* UNICODE */
- if( pDest )
+ if ( pDest )
position = pDest - haystack;
else
{
diff --git a/plugins/Chat/richutil.c b/plugins/Chat/richutil.c
index cba69fefe6..edb6bff003 100644
--- a/plugins/Chat/richutil.c
+++ b/plugins/Chat/richutil.c
@@ -219,7 +219,7 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
ExcludeClipRect(hdc, rcClient.left, rcClient.top, rcClient.right, rcClient.bottom);
if(MyIsThemeBackgroundPartiallyTransparent(hTheme, EP_EDITTEXT, ETS_NORMAL))
MyDrawThemeParentBackground(hwnd, hdc, &rcBorder);
- if(!IsWindowEnabled(hwnd))
+ if (!IsWindowEnabled(hwnd))
nState = ETS_DISABLED;
else if(SendMessage(hwnd, EM_GETOPTIONS, 0, 0) & ECO_READONLY)
nState = ETS_READONLY;
@@ -269,7 +269,7 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
LRESULT ret = CallWindowProc(ru->origProc, hwnd, msg, wParam, lParam);
if(IsWindow(hwnd)) {
- if((WNDPROC)GetWindowLongPtr(hwnd, GWLP_WNDPROC) == &RichUtil_Proc)
+ if ((WNDPROC)GetWindowLongPtr(hwnd, GWLP_WNDPROC) == &RichUtil_Proc)
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)ru->origProc);
}
EnterCriticalSection(&csRich);
diff --git a/plugins/Clist_nicer/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/CLUIFrames/cluiframes.cpp
index 8fc2427c06..79fa14dc85 100644
--- a/plugins/Clist_nicer/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_nicer/CLUIFrames/cluiframes.cpp
@@ -1167,7 +1167,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam)
int oldHeight = Frames[pos].height;
retval = Frames[pos].height;
Frames[pos].height = lParam;
- if(!CLUIFramesFitInSize())
+ if (!CLUIFramesFitInSize())
Frames[pos].height = retval;
retval = Frames[pos].height;
@@ -1180,7 +1180,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam)
else {
retval = Frames[pos].HeightWhenCollapsed;
Frames[pos].HeightWhenCollapsed = lParam;
- if(!CLUIFramesFitInSize())
+ if (!CLUIFramesFitInSize())
Frames[pos].HeightWhenCollapsed = retval;
retval = Frames[pos].HeightWhenCollapsed;
}
diff --git a/plugins/Clist_nicer/CLUIFrames/framesmenu.cpp b/plugins/Clist_nicer/CLUIFrames/framesmenu.cpp
index b2a30a2bf2..818f32ffd5 100644
--- a/plugins/Clist_nicer/CLUIFrames/framesmenu.cpp
+++ b/plugins/Clist_nicer/CLUIFrames/framesmenu.cpp
@@ -58,7 +58,7 @@ static INT_PTR AddContextFrameMenuItem(WPARAM wParam,LPARAM lParam)
tmi.position=mi->position;
tmi.pszName=mi->pszName;
- if( mi->flags & CMIF_ROOTHANDLE )
+ if ( mi->flags & CMIF_ROOTHANDLE )
tmi.root = mi->hParentMenu;
{
lpFrameMenuExecParam fmep;
diff --git a/plugins/Clist_nicer/INCLUDE/rowheight_funcs.h b/plugins/Clist_nicer/INCLUDE/rowheight_funcs.h
index 35fedd36fb..d3fb618d19 100644
--- a/plugins/Clist_nicer/INCLUDE/rowheight_funcs.h
+++ b/plugins/Clist_nicer/INCLUDE/rowheight_funcs.h
@@ -30,7 +30,7 @@ public:
height = dat->fontInfo[GetBasicFontID(contact)].fontHeight;
- if(!dat->bisEmbedded) {
+ if (!dat->bisEmbedded) {
if(contact->bSecondLine != MULTIROW_NEVER && contact->bSecondLine != MULTIROW_IFSPACE && contact->type == CLCIT_CONTACT) {
if ((contact->bSecondLine == MULTIROW_ALWAYS || ((cfg::dat.dwFlags & CLUI_FRAME_SHOWSTATUSMSG && contact->bSecondLine == MULTIROW_IFNEEDED) && (contact->xStatus > 0 || cfg::eCache[contact->extraCacheEntry].bStatusMsgValid > STATUSMSG_XSTATUSID))))
height += (dat->fontInfo[FONTID_STATUS].fontHeight + cfg::dat.avatarPadding);
@@ -42,7 +42,7 @@ public:
}
// Checkbox size
- if((style&CLS_CHECKBOXES && contact->type==CLCIT_CONTACT) ||
+ if ((style&CLS_CHECKBOXES && contact->type==CLCIT_CONTACT) ||
(style&CLS_GROUPCHECKBOXES && contact->type==CLCIT_GROUP) ||
(contact->type==CLCIT_INFO && contact->flags&CLCIIF_CHECKBOX))
{
diff --git a/plugins/Clist_nicer/SRC/CLCButton.cpp b/plugins/Clist_nicer/SRC/CLCButton.cpp
index 440178208a..3eedad8d28 100644
--- a/plugins/Clist_nicer/SRC/CLCButton.cpp
+++ b/plugins/Clist_nicer/SRC/CLCButton.cpp
@@ -240,7 +240,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint)
DeleteObject(hbr);
}
}
- if(!ctl->bSkinned && ctl->buttonItem == 0) {
+ if (!ctl->bSkinned && ctl->buttonItem == 0) {
if (ctl->stateId == PBS_HOT || ctl->focus) {
if (ctl->pbState)
DrawEdge(hdcMem, &rc, EDGE_ETCHED, BF_RECT | BF_SOFT);
@@ -328,7 +328,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint)
CopyRect(&rcText, &rcClient);
SetBkMode(hdcMem, TRANSPARENT);
// XP w/themes doesn't used the glossy disabled text. Is it always using COLOR_GRAYTEXT? Seems so.
- if(!ctl->bSkinned)
+ if (!ctl->bSkinned)
SetTextColor(hdcMem, IsWindowEnabled(ctl->hwnd) || !ctl->hThemeButton ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_GRAYTEXT));
if (ctl->arrow)
DrawState(hdcMem, NULL, NULL, (LPARAM) ctl->arrow, 0, rcClient.right - rcClient.left - 5 - g_cxsmIcon + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), (rcClient.bottom - rcClient.top) / 2 - g_cysmIcon / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON : DST_ICON | DSS_DISABLED);
@@ -433,7 +433,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
bct->pbState = 1;
InvalidateRect(bct->hwnd, NULL, TRUE);
}
- if(!bct->bSendOnDown)
+ if (!bct->bSendOnDown)
SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM) hwndDlg);
return 0;
}
@@ -469,7 +469,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
return (LRESULT)(bct->hIconPrivate ? bct->hIconPrivate : bct->hIcon);
break;
case BM_SETIMAGE:
- if(!lParam)
+ if (!lParam)
break;
bct->hIml = 0;
bct->iIcon = 0;
@@ -668,7 +668,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
bct->stateId = PBS_NORMAL;
InvalidateRect(bct->hwnd, NULL, TRUE);
}
- if(!bct->bSendOnDown)
+ if (!bct->bSendOnDown)
SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM) hwndDlg);
break;
}
diff --git a/plugins/Clist_nicer/SRC/Docking.cpp b/plugins/Clist_nicer/SRC/Docking.cpp
index bb736880d2..b51d5237a1 100644
--- a/plugins/Clist_nicer/SRC/Docking.cpp
+++ b/plugins/Clist_nicer/SRC/Docking.cpp
@@ -152,7 +152,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
Docking_GetMonitorRectFromPoint(ptCursor, &rcMonitor);
if ((ptCursor.x < rcMonitor.left + EDGESENSITIVITY) || (ptCursor.x >= rcMonitor.right - EDGESENSITIVITY)) {
- if(!(GetWindowLong(msg->hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW)) {
+ if (!(GetWindowLong(msg->hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW)) {
SendMessage(msg->hwnd, CLUIINTM_REDRAW, 0, 0);
MessageBox(0, TranslateT("The clist cannot be docked when using the default title bar and border. Use a toolwindow or borderless style instead."),
TranslateT("Clist docking"), MB_OK);
diff --git a/plugins/Clist_nicer/SRC/alphablend.cpp b/plugins/Clist_nicer/SRC/alphablend.cpp
index b9fd07e904..f81c029bad 100644
--- a/plugins/Clist_nicer/SRC/alphablend.cpp
+++ b/plugins/Clist_nicer/SRC/alphablend.cpp
@@ -141,7 +141,7 @@ void DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor
TRIVERTEX tvtx[2];
int orig = 1, dest = 0;
- if(!(FLG_GRADIENT & GRADIENT_ACTIVE)) {
+ if (!(FLG_GRADIENT & GRADIENT_ACTIVE)) {
tvtx[0].Red = tvtx[1].Red = (COLOR16)GetRValue(basecolor) << 8;
tvtx[0].Blue = tvtx[1].Blue = (COLOR16)GetBValue(basecolor) << 8;
tvtx[0].Green = tvtx[1].Green = (COLOR16)GetGValue(basecolor) << 8;
diff --git a/plugins/Clist_nicer/SRC/clcitems.cpp b/plugins/Clist_nicer/SRC/clcitems.cpp
index d62dd52db9..0f918be17e 100644
--- a/plugins/Clist_nicer/SRC/clcitems.cpp
+++ b/plugins/Clist_nicer/SRC/clcitems.cpp
@@ -252,7 +252,7 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat)
}
}
pcli->pfnSortCLC(hwnd, dat, 0);
- if(!dat->bisEmbedded)
+ if (!dat->bisEmbedded)
FLT_SyncWithClist();
}
@@ -280,16 +280,16 @@ BYTE GetCachedStatusMsg(int iExtraCacheEntry, char *szProto)
if ( !result && lstrlen(dbv.ptszVal) > 1)
cEntry->bStatusMsgValid = STATUSMSG_CLIST;
else {
- if(!szProto)
+ if (!szProto)
szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if(szProto) {
if ( !result )
DBFreeVariant( &dbv );
- if( !( result = cfg::getTString(hContact, szProto, "YMsg", &dbv)) && lstrlen(dbv.ptszVal) > 1)
+ if ( !( result = cfg::getTString(hContact, szProto, "YMsg", &dbv)) && lstrlen(dbv.ptszVal) > 1)
cEntry->bStatusMsgValid = STATUSMSG_YIM;
else if ( !(result = cfg::getTString(hContact, szProto, "StatusDescr", &dbv)) && lstrlen(dbv.ptszVal) > 1)
cEntry->bStatusMsgValid = STATUSMSG_GG;
- else if( !(result = cfg::getTString(hContact, szProto, "XStatusMsg", &dbv)) && lstrlen(dbv.ptszVal) > 1)
+ else if ( !(result = cfg::getTString(hContact, szProto, "XStatusMsg", &dbv)) && lstrlen(dbv.ptszVal) > 1)
cEntry->bStatusMsgValid = STATUSMSG_XSTATUS;
} }
@@ -319,7 +319,7 @@ BYTE GetCachedStatusMsg(int iExtraCacheEntry, char *szProto)
cst.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR;
cst.wParam = &xStatus2;
cst.ptszName = xStatusName;
- if(!CallService(szServiceName, (WPARAM)hContact, (LPARAM)&cst)) {
+ if (!CallService(szServiceName, (WPARAM)hContact, (LPARAM)&cst)) {
TCHAR *szwXstatusName = TranslateTS(xStatusName);
cEntry->statusMsg = (TCHAR *)realloc(cEntry->statusMsg, (lstrlen(szwXstatusName) + 2) * sizeof(TCHAR));
_tcsncpy(cEntry->statusMsg, szwXstatusName, lstrlen(szwXstatusName) + 1);
@@ -615,7 +615,7 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc
szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
// check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
if(cfg::dat.bFilterEffective & CLVM_STICKY_CONTACTS) {
- if((dwLocalMask = cfg::getDword(hContact, "CLVM", cfg::dat.current_viewmode, 0)) != 0) {
+ if ((dwLocalMask = cfg::getDword(hContact, "CLVM", cfg::dat.current_viewmode, 0)) != 0) {
if(cfg::dat.bFilterEffective & CLVM_FILTER_STICKYSTATUS) {
WORD wStatus = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
return !((1 << (wStatus - ID_STATUS_OFFLINE)) & HIWORD(dwLocalMask));
@@ -629,7 +629,7 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc
filterResult = strstr(cfg::dat.protoFilter, szTemp) ? 1 : 0;
}
if(cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
- if(!cfg::getTString(hContact, "CList", "Group", &dbv)) {
+ if (!cfg::getTString(hContact, "CList", "Group", &dbv)) {
_sntprintf(szGroupMask, safe_sizeof(szGroupMask), _T("%s|"), &dbv.ptszVal[1]);
filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0));
mir_free(dbv.ptszVal);
diff --git a/plugins/Clist_nicer/SRC/clcopts.cpp b/plugins/Clist_nicer/SRC/clcopts.cpp
index f942f833e4..aeb999bfa5 100644
--- a/plugins/Clist_nicer/SRC/clcopts.cpp
+++ b/plugins/Clist_nicer/SRC/clcopts.cpp
@@ -254,7 +254,7 @@ static int DSP_Read(DISPLAYPROFILESET *p)
*/
mir_snprintf(szKey, 256, "{dw_%u_%u}", p->uID, j);
- if(!cfg::getString(NULL, DSP_PROFILES_MODULE, szKey, &dbv)) {
+ if (!cfg::getString(NULL, DSP_PROFILES_MODULE, szKey, &dbv)) {
sscanf(dbv.pszVal, "%u,%u,%u,%u,%u", dp->dwFlags, dp->dwExtraImageMask, dp->avatarBorder, dp->clcExStyle, dp->clcOfflineModes);
DBFreeVariant(&dbv);
}
@@ -266,7 +266,7 @@ static int DSP_Read(DISPLAYPROFILESET *p)
*/
_snprintf(szKey, 256, "{b_%u_%u}", p->uID, j);
- if(!cfg::getString(NULL, DSP_PROFILES_MODULE, szKey, &dbv)) {
+ if (!cfg::getString(NULL, DSP_PROFILES_MODULE, szKey, &dbv)) {
if(lstrlenA(dbv.pszVal) >= 16) {
dp->exIconScale = (int)szBuf[i++];
dp->dualRowMode = szBuf[i++];
@@ -740,7 +740,7 @@ static INT_PTR CALLBACK DlgProcDspAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDC_CLISTAVATARS:
- if((HWND)lParam != GetFocus())
+ if ((HWND)lParam != GetFocus())
return 0;
break;
case IDC_SHOWLOCALTIME:
@@ -992,7 +992,7 @@ static INT_PTR CALLBACK DlgProcXIcons(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
return 0;
}
case WM_NOTIFY:
- if(((LPNMHDR) lParam)->idFrom == IDC_EXTRAORDER) {
+ if (((LPNMHDR) lParam)->idFrom == IDC_EXTRAORDER) {
switch (((LPNMHDR)lParam)->code) {
case TVN_BEGINDRAGA:
case TVN_BEGINDRAGW:
@@ -1034,7 +1034,7 @@ static INT_PTR CALLBACK DlgProcXIcons(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
case WM_MOUSEMOVE:
{
- if(!dragging)
+ if (!dragging)
break;
{
TVHITTESTINFO hti;
@@ -1063,7 +1063,7 @@ static INT_PTR CALLBACK DlgProcXIcons(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
break;
case WM_LBUTTONUP:
{
- if(!dragging) break;
+ if (!dragging) break;
TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),NULL,0);
dragging=0;
ReleaseCapture();
@@ -1254,7 +1254,7 @@ static INT_PTR CALLBACK DlgProcDspProfiles(HWND hwnd, UINT msg, WPARAM wParam, L
}
case PSM_CHANGED: // used so tabs dont have to call SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
- if(!iInit)
+ if (!iInit)
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
case WM_NOTIFY:
@@ -1363,7 +1363,7 @@ static INT_PTR CALLBACK TabOptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LP
}
case PSM_CHANGED: // used so tabs dont have to call SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
- if(!iInit)
+ if (!iInit)
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
case WM_NOTIFY:
@@ -1528,7 +1528,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam
int i;
DWORD exStyle = cfg::getDword("CLC", "ExStyle", CLCDEFAULT_EXSTYLE);
- if(!opt_clc_main_changed)
+ if (!opt_clc_main_changed)
return TRUE;
for (i = 0; i < sizeof(checkBoxToStyleEx) / sizeof(checkBoxToStyleEx[0]); i++)
@@ -1665,7 +1665,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case 0:
switch (((LPNMHDR) lParam)->code) {
case PSN_APPLY:
- if(!opt_clc_bkg_changed)
+ if (!opt_clc_bkg_changed)
return TRUE;
cfg::writeByte("CLC", "UseBitmap", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); {
diff --git a/plugins/Clist_nicer/SRC/clcpaint.cpp b/plugins/Clist_nicer/SRC/clcpaint.cpp
index 866279ae59..0943c3d846 100644
--- a/plugins/Clist_nicer/SRC/clcpaint.cpp
+++ b/plugins/Clist_nicer/SRC/clcpaint.cpp
@@ -291,7 +291,7 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, struct ClcContact *contac
BOOL fOverlay = (cfg::dat.dwFlags & CLUI_FRAME_OVERLAYICONS);
contact->avatarLeft = -1;
- if(!cfg::dat.bAvatarServiceAvail || dat->bisEmbedded)
+ if (!cfg::dat.bAvatarServiceAvail || dat->bisEmbedded)
return 0;
if(contact->ace != NULL && contact->ace->cbSize == sizeof(struct avatarCacheEntry)) {
@@ -338,7 +338,7 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, struct ClcContact *contac
newHeight = (float)(bmHeight * dScale) - skinMarginY;
}
topoffset = rowHeight > (int)newHeight ? (rowHeight - (int)newHeight) / 2 : 0;
- if(!item->IGNORED) {
+ if (!item->IGNORED) {
//topoffset += item->MARGIN_TOP;
leftoffset = item->MARGIN_LEFT;
}
@@ -395,7 +395,7 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, struct ClcContact *contac
SelectClipRgn(hdcMem, NULL);
DeleteObject(rgn);
- if(!item->IGNORED) {
+ if (!item->IGNORED) {
RECT rcFrame;
BOOL inClCPaint_save = g_inCLCpaint;
HDC hdcTemp = 0, hdcSaved = 0;
@@ -514,7 +514,7 @@ void __inline PaintItem(HDC hdcMem, struct ClcGroup *group, struct ClcContact *c
bg_indent_l = cfg::dat.bApplyIndentToBg ? indent * dat->groupIndent : 0;
}
else if(type == CLCIT_GROUP && API::pfnSetLayout != NULL) {
- if((contact->isRtl && cfg::dat.bGroupAlign == CLC_GROUPALIGN_AUTO) || cfg::dat.bGroupAlign == CLC_GROUPALIGN_RIGHT) {
+ if ((contact->isRtl && cfg::dat.bGroupAlign == CLC_GROUPALIGN_AUTO) || cfg::dat.bGroupAlign == CLC_GROUPALIGN_RIGHT) {
g_RTL = TRUE;
bg_indent_r = cfg::dat.bApplyIndentToBg ? indent * dat->groupIndent : 0;
}
@@ -614,12 +614,12 @@ set_bg_l:
if (cstatus >= ID_STATUS_OFFLINE && cstatus <= ID_STATUS_OUTTOLUNCH) {
BYTE perstatus_ignored;
- if((flags & CONTACTF_IDLE) && !StatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE].IGNORED)
+ if ((flags & CONTACTF_IDLE) && !StatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE].IGNORED)
sitem = &StatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE];
else
sitem = &StatusItems[cstatus - ID_STATUS_OFFLINE];
- if(!dat->bisEmbedded) {
+ if (!dat->bisEmbedded) {
pp_item = cEntry->status_item ? cEntry->status_item : cEntry->proto_status_item;
if (!(perstatus_ignored = sitem->IGNORED) && !(flags & CONTACTF_NOTONLIST))
@@ -627,11 +627,11 @@ set_bg_l:
if(cfg::dat.bUsePerProto && pp_item && !pp_item->IGNORED) {
sitem = pp_item;
- if((perstatus_ignored || cfg::dat.bOverridePerStatusColors) && sitem->TEXTCOLOR != -1)
+ if ((perstatus_ignored || cfg::dat.bOverridePerStatusColors) && sitem->TEXTCOLOR != -1)
SetTextColor(hdcMem, sitem->TEXTCOLOR);
}
}
- else if(!sitem->IGNORED)
+ else if (!sitem->IGNORED)
SetTextColor(hdcMem, sitem->TEXTCOLOR);
sevencontact_pos = &StatusItems[ID_EXTBKEVEN_CNTCTPOS - ID_STATUS_OFFLINE];
@@ -885,7 +885,7 @@ set_bg_l:
SetHotTrackColour(hdcMem,dat);
if(ht->IGNORED == 0)
SetTextColor(hdcMem, ht->TEXTCOLOR);
- if(!g_hottrack_done) {
+ if (!g_hottrack_done) {
if (ht->IGNORED == 0) {
DrawAlpha(hdcMem, &rc, ht->COLOR, ht->ALPHA, ht->COLOR2, ht->COLOR2_TRANSPARENT, ht->GRADIENT,
ht->CORNER, ht->BORDERSTYLE, ht->imageItem);
@@ -974,9 +974,9 @@ bgskipped:
int mode = ILD_NORMAL;
pi_selectiveIcon = g_selectiveIcon && (type == CLCIT_CONTACT);
- if((dwFlags & CLUI_FRAME_STATUSICONS && !pi_selectiveIcon) || type != CLCIT_CONTACT || (pi_selectiveIcon && !avatar_done)) {
+ if ((dwFlags & CLUI_FRAME_STATUSICONS && !pi_selectiveIcon) || type != CLCIT_CONTACT || (pi_selectiveIcon && !avatar_done)) {
HIMAGELIST hImgList = 0;
- if(!dat->bisEmbedded && type == CLCIT_CONTACT && cEntry && (dwFlags & CLUI_FRAME_USEXSTATUSASSTATUS) && cEntry->iExtraImage[EXTRA_ICON_ADV1] != 0xff) {
+ if (!dat->bisEmbedded && type == CLCIT_CONTACT && cEntry && (dwFlags & CLUI_FRAME_USEXSTATUSASSTATUS) && cEntry->iExtraImage[EXTRA_ICON_ADV1] != 0xff) {
if(pcli->pfnIconFromStatusMode(contact->proto, contact->wStatus, contact->hContact) == iImage) {
hImgList = dat->himlExtraColumns;
iImage = cEntry->iExtraImage[EXTRA_ICON_ADV1];
@@ -1137,7 +1137,7 @@ text:
}
if (dat->exStyle & CLS_EX_LINEWITHGROUPS) {
- if(!g_center) {
+ if (!g_center) {
rc.top = y + ((rowHeight) >> 1); rc.bottom = rc.top + 2;
rc.left = rightLineStart;
rc.right = clRect->right - 1 - dat->extraColumnSpacing * dat->extraColumnsCount - dat->rightMargin;
@@ -1163,7 +1163,7 @@ text:
// avatar
- if(!dat->bisEmbedded) {
+ if (!dat->bisEmbedded) {
if(av_local_wanted && !avatar_done && pi_avatar) {
if(av_rightwithnick) {
RECT rcAvatar = rcContent;
@@ -1180,7 +1180,7 @@ text:
}
// nickname
- if(!twoRows) {
+ if (!twoRows) {
if(dt_nickflags)
DrawText(hdcMem, szText, -1, &rcContent, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE | dt_nickflags);
else
@@ -1273,7 +1273,7 @@ nodisplay:
TCHAR *szText = NULL;
BYTE smsgValid = cEntry->bStatusMsgValid;
- if((dwFlags & CLUI_FRAME_SHOWSTATUSMSG && smsgValid > STATUSMSG_XSTATUSID) || smsgValid == STATUSMSG_XSTATUSNAME)
+ if ((dwFlags & CLUI_FRAME_SHOWSTATUSMSG && smsgValid > STATUSMSG_XSTATUSID) || smsgValid == STATUSMSG_XSTATUSNAME)
szText = cEntry->statusMsg;
else
#if defined(_UNICODE)
@@ -1285,7 +1285,7 @@ nodisplay:
dt_2ndrowflags |= (DT_RTLREADING | DT_RIGHT);
if(rightIcons == 0) {
- if((rcContent.bottom - rcContent.top) >= (2 * statusFontHeight)) {
+ if ((rcContent.bottom - rcContent.top) >= (2 * statusFontHeight)) {
dtFlags &= ~(DT_SINGLELINE | DT_BOTTOM | DT_NOCLIP);
dtFlags |= DT_WORDBREAK;
rcContent.bottom -= ((rcContent.bottom - rcContent.top) % statusFontHeight);
@@ -1293,7 +1293,7 @@ nodisplay:
DrawText(hdcMem, szText, -1, &rcContent, dtFlags | dt_2ndrowflags);
}
else {
- if((rcContent.bottom - rcContent.top) < (2 * statusFontHeight) - 2)
+ if ((rcContent.bottom - rcContent.top) < (2 * statusFontHeight) - 2)
DrawText(hdcMem, szText, -1, &rcContent, dtFlags | dt_2ndrowflags);
else {
DRAWTEXTPARAMS dtp = {0};
diff --git a/plugins/Clist_nicer/SRC/clcutils.cpp b/plugins/Clist_nicer/SRC/clcutils.cpp
index bec62044e9..b158a4394b 100644
--- a/plugins/Clist_nicer/SRC/clcutils.cpp
+++ b/plugins/Clist_nicer/SRC/clcutils.cpp
@@ -142,7 +142,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct Clc
for (i = 5; i >= 0; i--) {
if (cfg::eCache[hitcontact->extraCacheEntry].iExtraImage[i] == 0xFF)
continue;
- if(!((1 << i) & cfg::eCache[hitcontact->extraCacheEntry].dwXMask))
+ if (!((1 << i) & cfg::eCache[hitcontact->extraCacheEntry].dwXMask))
continue;
images_present++;
if (testx < right - (rightOffset - (cfg::dat.exIconScale + 2) * images_present) && testx > right - (rightOffset - (cfg::dat.exIconScale + 2) * images_present + (cfg::dat.exIconScale))) {
@@ -240,7 +240,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct ClcCont
;
}
- if(!dat->bisEmbedded) {
+ if (!dat->bisEmbedded) {
if(hitcontact->type == CLCIT_CONTACT) {
if(mirror_mode == 1 || (mirror_mode == 2 && cfg::eCache[hitcontact->extraCacheEntry].dwCFlags & ECF_RTLNICK))
return RTL_HitTest(hwnd, dat, testx, testy, hitcontact, flags, indent, hit);
@@ -298,7 +298,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct ClcCont
for (i = 5; i >= 0; i--) {
if (cfg::eCache[hitcontact->extraCacheEntry].iExtraImage[i] == 0xFF)
continue;
- if(!((1 << i) & cfg::eCache[hitcontact->extraCacheEntry].dwXMask))
+ if (!((1 << i) & cfg::eCache[hitcontact->extraCacheEntry].dwXMask))
continue;
images_present++;
if (testx > (rightOffset - (cfg::dat.exIconScale + 2) * images_present) && testx < (rightOffset - (cfg::dat.exIconScale + 2) * images_present + (cfg::dat.exIconScale))) {
@@ -389,7 +389,7 @@ void ScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth)
}
dat->yScroll = desty;
if (dat->backgroundBmpUse & CLBF_SCROLL || dat->hBmpBackground == NULL) {
- if(!noSmooth)
+ if (!noSmooth)
ScrollWindowEx(hwnd, 0, previousy - dat->yScroll, NULL, NULL, NULL, NULL, SW_INVALIDATE);
else
InvalidateRect(hwnd, NULL, FALSE);
@@ -545,7 +545,7 @@ void BeginRenameSelection(HWND hwnd, struct ClcData *dat)
#if defined(_UNICODE)
dat->hwndRenameEdit = CreateWindowEx(0, _T("RichEdit20W"),contact->szText,WS_CHILD|WS_BORDER|ES_MULTILINE|ES_AUTOHSCROLL,x,y,clRect.right-x,h,hwnd,NULL,g_hInst,NULL);
{
- if((contact->type == CLCIT_CONTACT && cfg::eCache[contact->extraCacheEntry].dwCFlags & ECF_RTLNICK) || (contact->type == CLCIT_GROUP && contact->isRtl)) {
+ if ((contact->type == CLCIT_CONTACT && cfg::eCache[contact->extraCacheEntry].dwCFlags & ECF_RTLNICK) || (contact->type == CLCIT_GROUP && contact->isRtl)) {
PARAFORMAT2 pf2;
ZeroMemory((void *)&pf2, sizeof(pf2));
pf2.cbSize = sizeof(pf2);
diff --git a/plugins/Clist_nicer/SRC/clistevents.cpp b/plugins/Clist_nicer/SRC/clistevents.cpp
index 85b145f32a..953877c27d 100644
--- a/plugins/Clist_nicer/SRC/clistevents.cpp
+++ b/plugins/Clist_nicer/SRC/clistevents.cpp
@@ -75,7 +75,7 @@ void HideShowNotifyFrame()
desired = dwVisible;
if(desired) {
- if(!dwVisible)
+ if (!dwVisible)
CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)hNotifyFrame, 0);
}
else {
diff --git a/plugins/Clist_nicer/SRC/clistmenus.cpp b/plugins/Clist_nicer/SRC/clistmenus.cpp
index 22b5b87df1..074bbcf355 100644
--- a/plugins/Clist_nicer/SRC/clistmenus.cpp
+++ b/plugins/Clist_nicer/SRC/clistmenus.cpp
@@ -306,7 +306,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
cfg::writeDword(hContact, "CList", "CLN_Flags", dwFlags);
- if((iSel = SendDlgItemMessage(hWnd, IDC_SECONDLINEMODE, CB_GETCURSEL, 0, 0)) != CB_ERR) {
+ if ((iSel = SendDlgItemMessage(hWnd, IDC_SECONDLINEMODE, CB_GETCURSEL, 0, 0)) != CB_ERR) {
if(iSel == 0) {
DBDeleteContactSetting(hContact, "CList", "CLN_2ndline");
if(contact)
diff --git a/plugins/Clist_nicer/SRC/clistmod.cpp b/plugins/Clist_nicer/SRC/clistmod.cpp
index a691dc44d4..5e551d4b87 100644
--- a/plugins/Clist_nicer/SRC/clistmod.cpp
+++ b/plugins/Clist_nicer/SRC/clistmod.cpp
@@ -177,7 +177,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY)
/*if(rgn) {
ptTest.x = j;
ptTest.y = i;
- if(!PtInRegion(rgn, ptTest.x, ptTest.y)) {
+ if (!PtInRegion(rgn, ptTest.x, ptTest.y)) {
continue;
}
}*/
diff --git a/plugins/Clist_nicer/SRC/clistopts.cpp b/plugins/Clist_nicer/SRC/clistopts.cpp
index 520c9ceb49..338886fce9 100644
--- a/plugins/Clist_nicer/SRC/clistopts.cpp
+++ b/plugins/Clist_nicer/SRC/clistopts.cpp
@@ -154,7 +154,7 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case 0:
switch (((LPNMHDR) lParam)->code) {
case PSN_APPLY:
- if(!opt_gen_opts_changed)
+ if (!opt_gen_opts_changed)
return TRUE;
cfg::writeByte("CList", "HideOffline", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE));
diff --git a/plugins/Clist_nicer/SRC/clistsettings.cpp b/plugins/Clist_nicer/SRC/clistsettings.cpp
index ce58e22b45..708abb0853 100644
--- a/plugins/Clist_nicer/SRC/clistsettings.cpp
+++ b/plugins/Clist_nicer/SRC/clistsettings.cpp
@@ -27,7 +27,7 @@ UNICODE done
INT_PTR GetContactStatusMessage(WPARAM wParam, LPARAM lParam)
{
- if(!cfg::shutDown)
+ if (!cfg::shutDown)
return SendMessage(pcli->hwndContactTree, CLM_GETSTATUSMSG, wParam, lParam);
return 0;
}
diff --git a/plugins/Clist_nicer/SRC/clui.cpp b/plugins/Clist_nicer/SRC/clui.cpp
index 0a3d3133ed..fe76f3d8b7 100644
--- a/plugins/Clist_nicer/SRC/clui.cpp
+++ b/plugins/Clist_nicer/SRC/clui.cpp
@@ -1311,7 +1311,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
rcFrame.left += (cfg::dat.bCLeft - 1);
rcFrame.right -= (cfg::dat.bCRight - 1);
- //if(!g_CluiData.bSkinnedButtonMode)
+ //if (!g_CluiData.bSkinnedButtonMode)
// rcFrame.bottom -= (g_CluiData.bottomOffset);
rcFrame.bottom++;
rcFrame.bottom -= cfg::dat.statusBarHeight;
@@ -1408,7 +1408,7 @@ skipbg:
}
case WM_WINDOWPOSCHANGED:
- if(!Docking_IsDocked(0, 0))
+ if (!Docking_IsDocked(0, 0))
return(0);
else
break;
diff --git a/plugins/Clist_nicer/SRC/cluiopts.cpp b/plugins/Clist_nicer/SRC/cluiopts.cpp
index d77caadea4..79ad2efcb3 100644
--- a/plugins/Clist_nicer/SRC/cluiopts.cpp
+++ b/plugins/Clist_nicer/SRC/cluiopts.cpp
@@ -177,7 +177,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
BYTE windowStyle = (BYTE)SendDlgItemMessage(hwndDlg, IDC_BORDERSTYLE, CB_GETCURSEL, 0, 0);
COLORREF clr_cluiframes;
- if(!opt_clui_changed)
+ if (!opt_clui_changed)
return TRUE;
cfg::writeByte("CLUI", "FadeInOut", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT));
@@ -265,7 +265,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
cfg::dat.dwFlags = IsDlgButtonChecked(hwndDlg, IDC_ROUNDEDBORDER) ? cfg::dat.dwFlags | CLUI_FRAME_ROUNDEDFRAME : cfg::dat.dwFlags & ~CLUI_FRAME_ROUNDEDFRAME;
cfg::writeByte("CLUI", "AutoSize", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
- if((cfg::dat.autosize = IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE) ? 1 : 0)) {
+ if ((cfg::dat.autosize = IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE) ? 1 : 0)) {
SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0);
}
@@ -310,7 +310,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
}
} else {
API::SetLayeredWindowAttributes(pcli->hwndContactList, RGB(0, 0, 0), (BYTE)255, LWA_ALPHA);
- if(!cfg::dat.bLayeredHack)
+ if (!cfg::dat.bLayeredHack)
SetWindowLong(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLong(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
}
@@ -383,7 +383,7 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case WM_NOTIFY:
switch (((LPNMHDR) lParam)->code) {
case PSN_APPLY:
- if(!opt_sbar_changed)
+ if (!opt_sbar_changed)
return TRUE;
cfg::writeByte("CLUI", "ShowSBar", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
diff --git a/plugins/Clist_nicer/SRC/cluiservices.cpp b/plugins/Clist_nicer/SRC/cluiservices.cpp
index d2c5c4d9fa..bacbdd3716 100644
--- a/plugins/Clist_nicer/SRC/cluiservices.cpp
+++ b/plugins/Clist_nicer/SRC/cluiservices.cpp
@@ -36,7 +36,7 @@ static INT_PTR GetClistVersion(WPARAM wParam, LPARAM lParam)
static char g_szVersionString[256];
mir_snprintf(g_szVersionString, 256, "%s, %d.%d.%d.%d", pluginInfo.shortName, HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOBYTE(pluginInfo.version)));
- if(!IsBadWritePtr((LPVOID)lParam, 4))
+ if (!IsBadWritePtr((LPVOID)lParam, 4))
*((DWORD *)lParam) = pluginInfo.version;
return (INT_PTR)g_szVersionString;
@@ -199,7 +199,7 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto )
}
caps2 = CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0);
caps1 = CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
- if((caps1 & PF1_IM) && (caps2 & (PF2_LONGAWAY | PF2_SHORTAWAY))) {
+ if ((caps1 & PF1_IM) && (caps2 & (PF2_LONGAWAY | PF2_SHORTAWAY))) {
onlineness = GetStatusOnlineness(status);
if(onlineness > maxOnline) {
maxStatus = status;
@@ -243,7 +243,7 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto )
if (szStatus) {
if(pcli->hwndContactList && IsWindow(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS)) && IsWindow(GetDlgItem(pcli->hwndContactList, IDC_TBTOPSTATUS))) {
SendMessage(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS), WM_SETTEXT, 0, (LPARAM) szStatus);
- if(!hIcon) {
+ if (!hIcon) {
SendMessage(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS), BM_SETIMLICON, (WPARAM) hCListImages, (LPARAM) iIcon);
if(g_ButtonItems == NULL)
SendMessage(GetDlgItem(pcli->hwndContactList, IDC_TBTOPSTATUS), BM_SETIMLICON, (WPARAM) hCListImages, (LPARAM) iIcon);
diff --git a/plugins/Clist_nicer/SRC/contact.cpp b/plugins/Clist_nicer/SRC/contact.cpp
index 34f15b3fb9..f553dd2e40 100644
--- a/plugins/Clist_nicer/SRC/contact.cpp
+++ b/plugins/Clist_nicer/SRC/contact.cpp
@@ -164,15 +164,15 @@ void LoadContactTree(void)
pcli->pfnChangeContactIcon(hContact, IconFromStatusMode((char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0), status, hContact, NULL), 1);
if(mc_disablehgh && !mc_hgh_removed) {
- if(!DBGetContactSetting(hContact, "CList", "Group", &dbv)) {
- if(!strcmp(dbv.pszVal, "MetaContacts Hidden Group"))
+ if (!DBGetContactSetting(hContact, "CList", "Group", &dbv)) {
+ if (!strcmp(dbv.pszVal, "MetaContacts Hidden Group"))
DBDeleteContactSetting(hContact, "CList", "Group");
mir_free(dbv.pszVal);
}
}
// build initial data for message frequency
- if(!bMsgFrequency)
+ if (!bMsgFrequency)
MF_CalcFrequency(hContact, 100, 0);
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
@@ -231,7 +231,7 @@ int __forceinline INTSORT_CompareContacts(const struct ClcContact* c1, const str
return 2 * (c2->flags & CONTACTF_STICKY) - 1;
if(bywhat == SORTBY_PRIOCONTACTS) {
- if((cfg::clcdat->exStyle & CLS_EX_DIVIDERONOFF) && ((c1->flags & CONTACTF_ONLINE) != (c2->flags & CONTACTF_ONLINE)))
+ if ((cfg::clcdat->exStyle & CLS_EX_DIVIDERONOFF) && ((c1->flags & CONTACTF_ONLINE) != (c2->flags & CONTACTF_ONLINE)))
return 0;
if ((c1->flags & CONTACTF_PRIORITY) != (c2->flags & CONTACTF_PRIORITY))
return 2 * (c2->flags & CONTACTF_PRIORITY) - 1;
diff --git a/plugins/Clist_nicer/SRC/extBackg.cpp b/plugins/Clist_nicer/SRC/extBackg.cpp
index 3b7d692c33..4851622bbe 100644
--- a/plugins/Clist_nicer/SRC/extBackg.cpp
+++ b/plugins/Clist_nicer/SRC/extBackg.cpp
@@ -261,7 +261,7 @@ StatusItems_t *GetProtocolStatusItem(const char *szProto)
return NULL;
for(i = ID_EXTBK_LAST_D - ID_STATUS_OFFLINE + 1; i <= ID_EXTBK_LAST - ID_STATUS_OFFLINE; i++) {
- if(!strcmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, szProto))
+ if (!strcmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, szProto))
return &StatusItems[i];
}
return NULL;
@@ -553,7 +553,7 @@ void extbk_export(char *file)
mir_snprintf(szSection, 255, "Font%d", n);
mir_snprintf(szKey, 255, "Font%dName", n);
- if(!cfg::getString(NULL, "CLC", szKey, &dbv)) {
+ if (!cfg::getString(NULL, "CLC", szKey, &dbv)) {
WritePrivateProfileStringA(szSection, "Name", dbv.pszVal, file);
mir_free(dbv.pszVal);
}
@@ -598,7 +598,7 @@ void extbk_export(char *file)
WritePrivateProfileStructA("Global", _tagSettings[i].szSetting, &data, _tagSettings[i].size, file);
i++;
}
- if(!cfg::getString(NULL, "CLC", "BkBitmap", &dbv)) {
+ if (!cfg::getString(NULL, "CLC", "BkBitmap", &dbv)) {
WritePrivateProfileStringA("Global", "BkBitmap", dbv.pszVal, file);
DBFreeVariant(&dbv);
}
@@ -751,7 +751,7 @@ static void IMG_CreateItem(ImageItem *item, const char *fileName, HDC hdc)
static void IMG_DeleteItem(ImageItem *item)
{
- if(!(item->dwFlags & IMAGE_GLYPH)) {
+ if (!(item->dwFlags & IMAGE_GLYPH)) {
SelectObject(item->hdc, item->hbmOld);
DeleteObject(item->hbm);
DeleteDC(item->hdc);
@@ -773,7 +773,7 @@ static void ReadItem(StatusItems_t *this_item, char *szItem, char *file)
int i;
for(i = 0; i <= ID_EXTBK_LAST - ID_STATUS_OFFLINE; i++) {
- if(!_stricmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, buffer)) {
+ if (!_stricmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, buffer)) {
defaults = &StatusItems[i];
break;
}
@@ -905,7 +905,7 @@ done_with_glyph:
tmpItem.bStretch = IMAGE_STRETCH_H;
tmpItem.hbm = 0;
- if(!_stricmp(itemname, "$glyphs")) {
+ if (!_stricmp(itemname, "$glyphs")) {
IMG_CreateItem(&tmpItem, szFinalName, hdc);
if(tmpItem.hbm) {
newItem = reinterpret_cast<ImageItem *>(malloc(sizeof(ImageItem)));
@@ -916,7 +916,7 @@ done_with_glyph:
goto imgread_done;
}
if(itemname[0] == '@') {
- if(!(tmpItem.dwFlags & IMAGE_GLYPH))
+ if (!(tmpItem.dwFlags & IMAGE_GLYPH))
IMG_CreateItem(&tmpItem, szFinalName, hdc);
if(tmpItem.hbm || tmpItem.dwFlags & IMAGE_GLYPH) {
ImageItem *pItem = g_ImageItems;
@@ -940,10 +940,10 @@ done_with_glyph:
for(n = 0;;n++) {
mir_snprintf(szItemNr, 30, "Item%d", n);
GetPrivateProfileStringA(itemname, szItemNr, "None", buffer, 500, szFileName);
- if(!strcmp(buffer, "None"))
+ if (!strcmp(buffer, "None"))
break;
- if(!strcmp(buffer, "CLUI")) {
- if(!(tmpItem.dwFlags & IMAGE_GLYPH))
+ if (!strcmp(buffer, "CLUI")) {
+ if (!(tmpItem.dwFlags & IMAGE_GLYPH))
IMG_CreateItem(&tmpItem, szFinalName, hdc);
if(tmpItem.hbm || tmpItem.dwFlags & IMAGE_GLYPH) {
COLORREF clr;
@@ -964,9 +964,9 @@ done_with_glyph:
continue;
}
for(i = 0; i <= ID_EXTBK_LAST - ID_STATUS_OFFLINE; i++) {
- if(!_stricmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, buffer)) {
- if(!alloced) {
- if(!(tmpItem.dwFlags & IMAGE_GLYPH))
+ if (!_stricmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, buffer)) {
+ if (!alloced) {
+ if (!(tmpItem.dwFlags & IMAGE_GLYPH))
IMG_CreateItem(&tmpItem, szFinalName, hdc);
if(tmpItem.hbm || tmpItem.dwFlags & IMAGE_GLYPH) {
newItem = reinterpret_cast<ImageItem *>(malloc(sizeof(ImageItem)));
@@ -1051,11 +1051,11 @@ static void BTN_ReadItem(char *itemName, char *file)
tmpItem.dwFlags |= GetPrivateProfileIntA(itemName, "toggle", 0, file) ? BUTTON_ISTOGGLE : 0;
GetPrivateProfileStringA(itemName, "Pressed", "None", szBuffer, 1000, file);
- if(!_stricmp(szBuffer, "default"))
+ if (!_stricmp(szBuffer, "default"))
tmpItem.imgPressed = StatusItems[ID_EXTBKTBBUTTONSPRESSED - ID_STATUS_OFFLINE].imageItem;
else {
while(imgItem) {
- if(!_stricmp(imgItem->szName, szBuffer)) {
+ if (!_stricmp(imgItem->szName, szBuffer)) {
tmpItem.imgPressed = imgItem;
break;
}
@@ -1065,11 +1065,11 @@ static void BTN_ReadItem(char *itemName, char *file)
imgItem = g_ImageItems;
GetPrivateProfileStringA(itemName, "Normal", "None", szBuffer, 1000, file);
- if(!_stricmp(szBuffer, "default"))
+ if (!_stricmp(szBuffer, "default"))
tmpItem.imgNormal = StatusItems[ID_EXTBKTBBUTTONSNPRESSED - ID_STATUS_OFFLINE].imageItem;
else {
while(imgItem) {
- if(!_stricmp(imgItem->szName, szBuffer)) {
+ if (!_stricmp(imgItem->szName, szBuffer)) {
tmpItem.imgNormal = imgItem;
break;
}
@@ -1079,11 +1079,11 @@ static void BTN_ReadItem(char *itemName, char *file)
imgItem = g_ImageItems;
GetPrivateProfileStringA(itemName, "Hover", "None", szBuffer, 1000, file);
- if(!_stricmp(szBuffer, "default"))
+ if (!_stricmp(szBuffer, "default"))
tmpItem.imgHover = StatusItems[ID_EXTBKTBBUTTONMOUSEOVER - ID_STATUS_OFFLINE].imageItem;
else {
while(imgItem) {
- if(!_stricmp(imgItem->szName, szBuffer)) {
+ if (!_stricmp(imgItem->szName, szBuffer)) {
tmpItem.imgHover = imgItem;
break;
}
@@ -1113,7 +1113,7 @@ static void BTN_ReadItem(char *itemName, char *file)
tmpItem.uId = IDC_TBFIRSTUID - 1;
GetPrivateProfileStringA(itemName, "Action", "Custom", szBuffer, 1000, file);
- if(!_stricmp(szBuffer, "service")) {
+ if (!_stricmp(szBuffer, "service")) {
tmpItem.szService[0] = 0;
GetPrivateProfileStringA(itemName, "Service", "None", szBuffer, 1000, file);
if(_stricmp(szBuffer, "None")) {
@@ -1122,7 +1122,7 @@ static void BTN_ReadItem(char *itemName, char *file)
tmpItem.uId = nextButtonID++;
}
}
- else if(!_stricmp(szBuffer, "protoservice")) {
+ else if (!_stricmp(szBuffer, "protoservice")) {
tmpItem.szService[0] = 0;
GetPrivateProfileStringA(itemName, "Service", "None", szBuffer, 1000, file);
if(_stricmp(szBuffer, "None")) {
@@ -1131,7 +1131,7 @@ static void BTN_ReadItem(char *itemName, char *file)
tmpItem.uId = nextButtonID++;
}
}
- else if(!_stricmp(szBuffer, "database")) {
+ else if (!_stricmp(szBuffer, "database")) {
int n;
GetPrivateProfileStringA(itemName, "Module", "None", szBuffer, 1000, file);
@@ -1192,7 +1192,7 @@ static void BTN_ReadItem(char *itemName, char *file)
int i = 0;
while(top_buttons[i].id) {
- if(!_stricmp(top_buttons[i].szIcoLibIcon, szBuffer)) {
+ if (!_stricmp(top_buttons[i].szIcoLibIcon, szBuffer)) {
tmpItem.uId = top_buttons[i].id;
tmpItem.dwFlags |= BUTTON_ISINTERNAL;
break;
@@ -1273,7 +1273,7 @@ void IMG_LoadItems()
DBFreeVariant(&dbv);
- if(!PathFileExists(tszFileName))
+ if (!PathFileExists(tszFileName))
return;
IMG_DeleteItems();
@@ -1396,7 +1396,7 @@ void LoadPerContactSkins(TCHAR *tszFileName)
break;
}
for(j = 0; j < i - 1; j++) {
- if(!strcmp(szProto, items[j].szName) && !strcmp(UIN, items[j].szDBname)
+ if (!strcmp(szProto, items[j].szName) && !strcmp(UIN, items[j].szDBname)
&& lstrlenA(szProto) == lstrlenA(items[j].szName) && lstrlenA(UIN) == lstrlenA(items[j].szDBname)) {
//_DebugPopup(hContact, "Found: %s, %s", szProto, UIN);
@@ -1571,7 +1571,7 @@ static void ApplyCLUISkin()
DBVARIANT dbv = {0};
TCHAR tszFinalName[MAX_PATH];
char szFinalName[MAX_PATH];
- if(!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
+ if (!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
MY_pathToAbsolute(dbv.ptszVal, tszFinalName);
#if defined(_UNICODE)
WideCharToMultiByte(CP_ACP, 0, tszFinalName, MAX_PATH, szFinalName, MAX_PATH, 0, 0);
@@ -1620,7 +1620,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
CheckDlgButton(hwndDlg, IDC_IGNORESELFORGROUPS, cfg::getByte("CLC", "IgnoreSelforGroups", 0) ? BST_CHECKED : BST_UNCHECKED);
- if(!cfg::getString(NULL, "CLC", "ContactSkins", &dbv)) {
+ if (!cfg::getString(NULL, "CLC", "ContactSkins", &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_SKINFILE, dbv.pszVal);
DBFreeVariant(&dbv);
Utils::enableDlgControl(hwndDlg, IDC_RELOAD, TRUE);
@@ -1628,7 +1628,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
else
Utils::enableDlgControl(hwndDlg, IDC_RELOAD, FALSE);
CheckDlgButton(hwndDlg, IDC_USESKIN, cfg::getByte("CLUI", "useskin", 0) ? BST_CHECKED : BST_UNCHECKED);
- if(!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
+ if (!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
SetDlgItemText(hwndDlg, IDC_SKINFILENAME, dbv.ptszVal);
DBFreeVariant(&dbv);
}
@@ -1676,7 +1676,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
int skinChanged = 0;
DBVARIANT dbv = {0};
- if(!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
+ if (!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
if(_tcscmp(dbv.ptszVal, final_path))
skinChanged = TRUE;
DBFreeVariant(&dbv);
@@ -1785,7 +1785,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
}
case PSM_CHANGED: // used so tabs dont have to call SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
- if(!iInit)
+ if (!iInit)
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
case WM_COMMAND:
@@ -1901,7 +1901,7 @@ int CoolSB_SetupScrollBar()
!StatusItems[ID_EXTBKSCROLLBUTTONPRESSED - ID_STATUS_OFFLINE].IGNORED;
- if(!StatusItems[ID_EXTBKSCROLLBACK - ID_STATUS_OFFLINE].imageItem ||
+ if (!StatusItems[ID_EXTBKSCROLLBACK - ID_STATUS_OFFLINE].imageItem ||
!StatusItems[ID_EXTBKSCROLLBACKLOWER - ID_STATUS_OFFLINE].imageItem ||
!StatusItems[ID_EXTBKSCROLLTHUMB - ID_STATUS_OFFLINE].imageItem ||
!StatusItems[ID_EXTBKSCROLLTHUMBHOVER - ID_STATUS_OFFLINE].imageItem ||
diff --git a/plugins/Clist_nicer/SRC/init.cpp b/plugins/Clist_nicer/SRC/init.cpp
index 59ada8931b..77d5ed123e 100644
--- a/plugins/Clist_nicer/SRC/init.cpp
+++ b/plugins/Clist_nicer/SRC/init.cpp
@@ -249,7 +249,7 @@ extern "C" int __declspec(dllexport) CListInitialise(PLUGINLINK * link)
int iCount = CallService(MS_DB_CONTACT_GETCOUNT, 0, 0);
iCount += 20;
- if( iCount < 300 )
+ if ( iCount < 300 )
iCount = 300;
cfg::eCache = reinterpret_cast<TExtraCache *>(malloc(sizeof(TExtraCache) * iCount));
@@ -301,7 +301,7 @@ extern "C" int __declspec(dllexport) CListInitialise(PLUGINLINK * link)
if(cfg::dat.bFirstRun)
cfg::writeByte("CLUI", "firstrun", 0);
- if(!cfg::getString(NULL, "CLUI", "exIconOrder", &dbv)) {
+ if (!cfg::getString(NULL, "CLUI", "exIconOrder", &dbv)) {
if(lstrlenA(dbv.pszVal) < EXICON_COUNT) {
for(i = 1; i <= EXICON_COUNT; i++)
cfg::dat.exIconOrder[i - 1] = i;
@@ -349,7 +349,7 @@ LBL_Error:
MessageBoxA( NULL, "This plugin requires Miranda IM 0.8.0.9 or later", "Fatal error", MB_OK );
return 1;
}
- if ( pcli->version < 6 ) // don't join it with the previous if()
+ if ( pcli->version < 6 ) // don't join it with the previous if ()
goto LBL_Error;
pcli->pfnBuildGroupPopupMenu = BuildGroupPopupMenu;
diff --git a/plugins/Clist_nicer/SRC/rowheight_funcs.cpp b/plugins/Clist_nicer/SRC/rowheight_funcs.cpp
index bb06013fe0..3fe3c311a2 100644
--- a/plugins/Clist_nicer/SRC/rowheight_funcs.cpp
+++ b/plugins/Clist_nicer/SRC/rowheight_funcs.cpp
@@ -269,8 +269,8 @@ int RowHeight::getFloatingRowHeight(const ClcData *dat, HWND hwnd, ClcContact *c
height = dat->fontInfo[GetBasicFontID(contact)].fontHeight;
- if(!dat->bisEmbedded) {
- if(!(dwFlags & FLT_SIMPLE)){
+ if (!dat->bisEmbedded) {
+ if (!(dwFlags & FLT_SIMPLE)) {
if(dwFlags & FLT_DUALROW) {
height += (dat->fontInfo[FONTID_STATUS].fontHeight + cfg::dat.avatarPadding);
}
diff --git a/plugins/Clist_nicer/SRC/statusbar.cpp b/plugins/Clist_nicer/SRC/statusbar.cpp
index 11308dac52..aba30d92a1 100644
--- a/plugins/Clist_nicer/SRC/statusbar.cpp
+++ b/plugins/Clist_nicer/SRC/statusbar.cpp
@@ -53,7 +53,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
ptMouse = pt;
if (tooltip_active){
KillTimer(hwnd, TIMERID_HOVER);
- if(!NotifyEventHooks(hStatusBarHideToolTipEvent, 0, 0))
+ if (!NotifyEventHooks(hStatusBarHideToolTipEvent, 0, 0))
CallService("mToolTip/HideTip", 0, 0);
tooltip_active = FALSE;
}
@@ -77,7 +77,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case WM_LBUTTONDOWN:
case WM_RBUTTONDOWN:
KillTimer(hwnd, TIMERID_HOVER);
- if(!NotifyEventHooks(hStatusBarHideToolTipEvent, 0, 0))
+ if (!NotifyEventHooks(hStatusBarHideToolTipEvent, 0, 0))
CallService("mToolTip/HideTip", 0, 0);
tooltip_active = FALSE;
break;
@@ -113,7 +113,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
hOldFont = reinterpret_cast<HFONT>(SelectObject(hdcMem, GetStockObject(DEFAULT_GUI_FONT)));
BitBlt(hdcMem, 0, 0, rcClient.right, rcClient.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
item = &StatusItems[ID_EXTBKSTATUSBAR - ID_STATUS_OFFLINE];
- if(!item->IGNORED) {
+ if (!item->IGNORED) {
RECT rc = rcClient;
rc.left += item->MARGIN_LEFT;
rc.right -= item->MARGIN_RIGHT;
diff --git a/plugins/Clist_nicer/SRC/statusfloater.cpp b/plugins/Clist_nicer/SRC/statusfloater.cpp
index acc3ba8dc0..06c088da45 100644
--- a/plugins/Clist_nicer/SRC/statusfloater.cpp
+++ b/plugins/Clist_nicer/SRC/statusfloater.cpp
@@ -163,22 +163,22 @@ void FLT_SnapToFloater(HWND hwnd)
while(pCurrent) {
GetWindowRect(pCurrent->hwnd, &rcWindow);
//top
- if((rcWindow.top - rcBase.bottom > -SNAP_FLT_TOLERANCE) && (rcWindow.top - rcBase.bottom < minTop)){
+ if ((rcWindow.top - rcBase.bottom > -SNAP_FLT_TOLERANCE) && (rcWindow.top - rcBase.bottom < minTop)) {
posTop = rcWindow.top;
minTop = rcWindow.top - rcBase.bottom;
}
//bottom
- if((rcBase.top - rcWindow.bottom > -SNAP_FLT_TOLERANCE) && (rcBase.top - rcWindow.bottom < minBottom)){
+ if ((rcBase.top - rcWindow.bottom > -SNAP_FLT_TOLERANCE) && (rcBase.top - rcWindow.bottom < minBottom)) {
posBottom = rcWindow.bottom;
minBottom = rcBase.top - rcWindow.bottom;
}
//left
- if((rcWindow.left - rcBase.right > -SNAP_FLT_TOLERANCE) && (rcWindow.left - rcBase.right < minLeft)){
+ if ((rcWindow.left - rcBase.right > -SNAP_FLT_TOLERANCE) && (rcWindow.left - rcBase.right < minLeft)) {
posLeft= rcWindow.left;
minLeft = rcWindow.left - rcBase.right;
}
//right
- if((rcBase.left - rcWindow.right > -SNAP_FLT_TOLERANCE) && (rcBase.left - rcWindow.right < minRight)){
+ if ((rcBase.left - rcWindow.right > -SNAP_FLT_TOLERANCE) && (rcBase.left - rcWindow.right < minRight)) {
posRight= rcWindow.right;
minRight = rcBase.left - rcWindow.right;
}
@@ -315,7 +315,7 @@ INT_PTR CALLBACK DlgProcFloatingContacts(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case IDC_FLT_SIMPLELAYOUT:
{
- if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)){
+ if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)) {
int isSimple = IsDlgButtonChecked(hwndDlg, IDC_FLT_SIMPLELAYOUT);
Utils::enableDlgControl(hwndDlg, IDC_FLT_AVATARS, !isSimple);
Utils::enableDlgControl(hwndDlg, IDC_FLT_EXTRAICONS, !isSimple);
@@ -325,7 +325,7 @@ INT_PTR CALLBACK DlgProcFloatingContacts(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case IDC_FLT_BORDER:
{
- if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)){
+ if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)) {
int isBorder = IsDlgButtonChecked(hwndDlg, IDC_FLT_BORDER);
Utils::enableDlgControl(hwndDlg, IDC_FLT_BORDERCOLOUR, isBorder);
}
@@ -333,7 +333,7 @@ INT_PTR CALLBACK DlgProcFloatingContacts(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case IDC_FLT_ROUNDED:
{
- if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)){
+ if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)) {
int isRounded = IsDlgButtonChecked(hwndDlg, IDC_FLT_ROUNDED);
Utils::enableDlgControl(hwndDlg, IDC_FLT_RADIUS, isRounded);
Utils::enableDlgControl(hwndDlg, IDC_FLT_RADIUSSPIN, isRounded);
@@ -342,7 +342,7 @@ INT_PTR CALLBACK DlgProcFloatingContacts(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case IDC_FLT_SHOWTOOLTIPS:
{
- if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)){
+ if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED)) {
int isTooltip = IsDlgButtonChecked(hwndDlg, IDC_FLT_SHOWTOOLTIPS);
int isDefHoverTime = IsDlgButtonChecked(hwndDlg, IDC_FLT_DEFHOVERTIME);
Utils::enableDlgControl(hwndDlg, IDC_FLT_DEFHOVERTIME, isTooltip);
@@ -353,7 +353,7 @@ INT_PTR CALLBACK DlgProcFloatingContacts(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case IDC_FLT_DEFHOVERTIME:
{
- if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED) && IsDlgButtonChecked(hwndDlg, IDC_FLT_SHOWTOOLTIPS)){
+ if (IsDlgButtonChecked(hwndDlg, IDC_FLT_ENABLED) && IsDlgButtonChecked(hwndDlg, IDC_FLT_SHOWTOOLTIPS)) {
int isDefHoverTime = IsDlgButtonChecked(hwndDlg, IDC_FLT_DEFHOVERTIME);
Utils::enableDlgControl(hwndDlg, IDC_FLT_HOVERTIME, !isDefHoverTime);
Utils::enableDlgControl(hwndDlg, IDC_FLT_HOVERTIMESPIN, !isDefHoverTime);
@@ -517,7 +517,7 @@ LRESULT CALLBACK StatusFloaterClassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
GetCursorPos(&ptMouse);
GetWindowRect(hwnd, &rcWindow);
rcWindow.right = rcWindow.left + 25;
- if(!PtInRect(&rcWindow, ptMouse))
+ if (!PtInRect(&rcWindow, ptMouse))
return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(ptMouse.x, ptMouse.y));
break;
}
@@ -631,12 +631,12 @@ LRESULT CALLBACK ContactFloaterClassProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
GetCursorPos(&ptMouse);
GetWindowRect(hwnd, &rcWindow);
rcWindow.right = rcWindow.left + 25;
- if(!PtInRect(&rcWindow, ptMouse))
+ if (!PtInRect(&rcWindow, ptMouse))
return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(ptMouse.x, ptMouse.y));
break;
}
case WM_MOUSEMOVE:
- if( API::pfnTrackMouseEvent && !hover ) {
+ if ( API::pfnTrackMouseEvent && !hover ) {
TRACKMOUSEEVENT tme;
tme.cbSize = sizeof(TRACKMOUSEEVENT);
tme.dwFlags = TME_HOVER | TME_LEAVE;
@@ -664,7 +664,7 @@ LRESULT CALLBACK ContactFloaterClassProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
while(pCurrent->hwnd != hwnd)
pCurrent = pCurrent->pNextFloater;
- if(FindItem(pcli->hwndContactTree, cfg::clcdat, pCurrent->hContact, &contact, NULL, 0)){
+ if(FindItem(pcli->hwndContactTree, cfg::clcdat, pCurrent->hContact, &contact, NULL, 0)) {
g_floatoptions.trans = g_floatoptions.act_trans;
FLT_Update(cfg::clcdat, contact);
g_floatoptions.trans = oldTrans;
@@ -818,7 +818,7 @@ void SFL_Update(HICON hIcon, int iIcon, HIMAGELIST hIml, const TCHAR *szText, BO
sfl_statustext[99] = 0;
}
- if(!hIcon) {
+ if (!hIcon) {
HICON p_hIcon;
if(refresh)
@@ -941,7 +941,7 @@ void FLT_SetSize(struct TExtraCache *centry, LONG width, LONG height)
int flags = SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOACTIVATE;
int iVis = pcli->pfnGetWindowVisibleState(pcli->hwndContactList, 0, 0);
- if((g_floatoptions.dwFlags & FLT_AUTOHIDE) && (iVis == 2 || iVis == 4)) //2 = GWVS_VISIBLE, 4 = GWVS_PARTIALLY_COVERED
+ if ((g_floatoptions.dwFlags & FLT_AUTOHIDE) && (iVis == 2 || iVis == 4)) //2 = GWVS_VISIBLE, 4 = GWVS_PARTIALLY_COVERED
flags = SWP_NOMOVE | SWP_NOACTIVATE;
if(centry->floater) {
@@ -1093,19 +1093,19 @@ void FLT_Update(struct ClcData *dat, struct ClcContact *contact)
cfg::eCache[contact->extraCacheEntry].dwXMask = 0;
}
else{
- if(!(g_floatoptions.dwFlags & FLT_AVATARS)) {
+ if (!(g_floatoptions.dwFlags & FLT_AVATARS)) {
contact->ace = 0;
g_list_avatars = 0;
}
else
g_list_avatars = 1;
- if(!(g_floatoptions.dwFlags & FLT_DUALROW))
+ if (!(g_floatoptions.dwFlags & FLT_DUALROW))
contact->bSecondLine = MULTIROW_NEVER;
else
contact->bSecondLine = MULTIROW_ALWAYS;
- if(!(g_floatoptions.dwFlags & FLT_EXTRAICONS)) {
+ if (!(g_floatoptions.dwFlags & FLT_EXTRAICONS)) {
cfg::dat.dwFlags &= ~(CLUI_SHOWCLIENTICONS | CLUI_SHOWVISI);
cfg::eCache[contact->extraCacheEntry].dwXMask = 0;
}
@@ -1178,10 +1178,10 @@ void FLT_SyncWithClist()
if(g_floatoptions.dwFlags & FLT_SYNCWITHCLIST){
while(pCurrent) {
hwnd = pCurrent->hwnd;
- if(hwnd && IsWindow(hwnd)){
+ if(hwnd && IsWindow(hwnd)) {
if(FindItem(pcli->hwndContactTree, cfg::clcdat, pCurrent->hContact, &contact, NULL, 0)) {
FLT_Update(cfg::clcdat, contact);
- if(((g_floatoptions.dwFlags & FLT_AUTOHIDE) && (iVis == 2 || iVis == 4)) || !(g_floatoptions.dwFlags & FLT_AUTOHIDE))
+ if (((g_floatoptions.dwFlags & FLT_AUTOHIDE) && (iVis == 2 || iVis == 4)) || !(g_floatoptions.dwFlags & FLT_AUTOHIDE))
ShowWindow(hwnd, SW_SHOWNOACTIVATE);
else
ShowWindow(hwnd, SW_HIDE);
@@ -1208,7 +1208,7 @@ void FLT_ShowHideAll(int showCmd)
if(g_floatoptions.dwFlags & FLT_AUTOHIDE){
while(pCurrent) {
hwnd = pCurrent->hwnd;
- if(hwnd && IsWindow(hwnd)){
+ if(hwnd && IsWindow(hwnd)) {
if(showCmd == SW_SHOWNOACTIVATE && FindItem(pcli->hwndContactTree, cfg::clcdat, pCurrent->hContact, &contact, NULL, 0))
ShowWindow(hwnd, SW_SHOWNOACTIVATE);
else if(showCmd != SW_SHOWNOACTIVATE)
diff --git a/plugins/Clist_nicer/SRC/viewmodes.cpp b/plugins/Clist_nicer/SRC/viewmodes.cpp
index ab51b0e121..a8d48f754e 100644
--- a/plugins/Clist_nicer/SRC/viewmodes.cpp
+++ b/plugins/Clist_nicer/SRC/viewmodes.cpp
@@ -498,7 +498,7 @@ void UpdateFilters()
if(cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv_gf))
goto cleanup;
mir_snprintf(szSetting, 128, "%c%s_OPT", 246, szBuf);
- if((opt = cfg::getDword(NULL, CLVM_MODULE, szSetting, -1)) != -1) {
+ if ((opt = cfg::getDword(NULL, CLVM_MODULE, szSetting, -1)) != -1) {
SendDlgItemMessage(clvmHwnd, IDC_AUTOCLEARSPIN, UDM_SETPOS, 0, MAKELONG(LOWORD(opt), 0));
}
mir_snprintf(szSetting, 128, "%c%s_SM", 246, szBuf);
@@ -555,7 +555,7 @@ void UpdateFilters()
int i;
for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
- if((1 << (i - ID_STATUS_OFFLINE)) & statusMask)
+ if ((1 << (i - ID_STATUS_OFFLINE)) & statusMask)
ListView_SetCheckState(hwndList, i - ID_STATUS_OFFLINE, TRUE)
else
ListView_SetCheckState(hwndList, i - ID_STATUS_OFFLINE, FALSE);
@@ -703,7 +703,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
mir_snprintf(szSetting, 256, "%c%s_SSM", 246, szBuf);
DBDeleteContactSetting(NULL, CLVM_MODULE, szSetting);
DBDeleteContactSetting(NULL, CLVM_MODULE, szBuf);
- if(!strcmp(cfg::dat.current_viewmode, szBuf) && lstrlenA(szBuf) == lstrlenA(cfg::dat.current_viewmode)) {
+ if (!strcmp(cfg::dat.current_viewmode, szBuf) && lstrlenA(szBuf) == lstrlenA(cfg::dat.current_viewmode)) {
cfg::dat.bFilterEffective = 0;
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
SetWindowTextA(hwndSelector, Translate("No view mode"));
@@ -826,7 +826,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
hItem = (HANDLE)SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
if(hItem==NULL) break;
- if(!(hitFlags&CLCHT_ONITEMEXTRA))
+ if (!(hitFlags&CLCHT_ONITEMEXTRA))
break;
iImage = SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
if(iImage == nullImage)
@@ -1014,7 +1014,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
KillTimer(hwnd, wParam);
- if(!cfg::dat.old_viewmode[0])
+ if (!cfg::dat.old_viewmode[0])
SendMessage(hwnd, WM_COMMAND, IDC_RESETMODES, 0);
else
ApplyViewMode((const char *)cfg::dat.old_viewmode);
@@ -1069,7 +1069,7 @@ clvm_reset_command:
break;
case IDC_CONFIGUREMODES:
clvm_config_command:
- if(!g_ViewModeOptDlg)
+ if (!g_ViewModeOptDlg)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_OPT_VIEWMODES), 0, DlgProcViewModesSetup, 0);
break;
}
@@ -1126,7 +1126,7 @@ void ApplyViewMode(const char *name)
cfg::dat.bFilterEffective = 0;
mir_snprintf(szSetting, 256, "%c%s_PF", 246, name);
- if(!cfg::getString(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ if (!cfg::getString(NULL, CLVM_MODULE, szSetting, &dbv)) {
if(lstrlenA(dbv.pszVal) >= 2) {
strncpy(cfg::dat.protoFilter, dbv.pszVal, sizeof(cfg::dat.protoFilter));
cfg::dat.protoFilter[sizeof(cfg::dat.protoFilter) - 1] = 0;
@@ -1135,7 +1135,7 @@ void ApplyViewMode(const char *name)
mir_free(dbv.pszVal);
}
mir_snprintf(szSetting, 256, "%c%s_GF", 246, name);
- if(!cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ if (!cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv)) {
if(lstrlen(dbv.ptszVal) >= 2) {
_tcsncpy(cfg::dat.groupFilter, dbv.ptszVal, safe_sizeof(cfg::dat.groupFilter));
cfg::dat.groupFilter[safe_sizeof(cfg::dat.groupFilter) - 1] = 0;
@@ -1155,7 +1155,7 @@ void ApplyViewMode(const char *name)
/*
mir_snprintf(szSetting, 256, "%c%s_VA", 246, name);
- if(!DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ if (!DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv)) {
strncpy(g_CluiData.varFilter, dbv.pszVal, sizeof(g_CluiData.varFilter));
g_CluiData.varFilter[sizeof(g_CluiData.varFilter) - 1] = 0;
if(lstrlenA(g_CluiData.varFilter) > 10 && ServiceExists(MS_VARS_FORMATSTRING))
@@ -1174,7 +1174,7 @@ void ApplyViewMode(const char *name)
if(szProto) {
id = (char*) CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if(id) {
- if(!DBGetContactSetting(hContact, szProto, id, &dbv)) {
+ if (!DBGetContactSetting(hContact, szProto, id, &dbv)) {
if(dbv.type == DBVT_ASCIIZ) {
mir_snprintf(UIN, 256, "<%s:%s>", szProto, dbv.pszVal);
}
diff --git a/plugins/Clist_nicer/coolsb/coolsblib.cpp b/plugins/Clist_nicer/coolsb/coolsblib.cpp
index ac9ee2a360..b8c986b120 100644
--- a/plugins/Clist_nicer/coolsb/coolsblib.cpp
+++ b/plugins/Clist_nicer/coolsb/coolsblib.cpp
@@ -47,7 +47,7 @@ SCROLLBAR *GetScrollBarFromHwnd(HWND hwnd, UINT nBar)
{
SCROLLWND *sw = GetScrollWndFromHwnd(hwnd);
- if(!sw) return 0;
+ if (!sw) return 0;
if(nBar == SB_HORZ)
return &sw->sbarHorz;
@@ -285,10 +285,10 @@ BOOL WINAPI CoolSB_EnableScrollBar (HWND hwnd, int wSBflags, UINT wArrows)
UINT oldstate;
BOOL bFailed = FALSE;
- if(!CoolSB_IsCoolScrollEnabled(hwnd))
+ if (!CoolSB_IsCoolScrollEnabled(hwnd))
return EnableScrollBar(hwnd, wSBflags, wArrows);
- if((wSBflags == SB_HORZ || wSBflags == SB_BOTH) &&
+ if ((wSBflags == SB_HORZ || wSBflags == SB_BOTH) &&
(sbar = GetScrollBarFromHwnd(hwnd, SB_HORZ)))
{
oldstate = sbar->fScrollFlags;
@@ -301,7 +301,7 @@ BOOL WINAPI CoolSB_EnableScrollBar (HWND hwnd, int wSBflags, UINT wArrows)
}
- if((wSBflags == SB_VERT || wSBflags == SB_BOTH) &&
+ if ((wSBflags == SB_VERT || wSBflags == SB_BOTH) &&
(sbar = GetScrollBarFromHwnd(hwnd, SB_VERT)))
{
oldstate = sbar->fScrollFlags;
@@ -327,10 +327,10 @@ BOOL WINAPI CoolSB_GetScrollInfo (HWND hwnd, int fnBar, LPSCROLLINFO lpsi)
SCROLLINFO *mysi;
BOOL copied = FALSE;
- if(!lpsi)
+ if (!lpsi)
return FALSE;
- if(!(mysi = GetScrollInfoFromHwnd(hwnd, fnBar)))
+ if (!(mysi = GetScrollInfoFromHwnd(hwnd, fnBar)))
{
return GetScrollInfo(hwnd, fnBar, lpsi);
}
@@ -367,7 +367,7 @@ int WINAPI CoolSB_GetScrollPos (HWND hwnd, int nBar)
{
SCROLLINFO *mysi;
- if(!(mysi = GetScrollInfoFromHwnd(hwnd, nBar)))
+ if (!(mysi = GetScrollInfoFromHwnd(hwnd, nBar)))
return GetScrollPos(hwnd, nBar);
return mysi->nPos;
@@ -377,10 +377,10 @@ BOOL WINAPI CoolSB_GetScrollRange (HWND hwnd, int nBar, LPINT lpMinPos, LPINT lp
{
SCROLLINFO *mysi;
- if(!lpMinPos || !lpMaxPos)
+ if (!lpMinPos || !lpMaxPos)
return FALSE;
- if(!(mysi = GetScrollInfoFromHwnd(hwnd, nBar)))
+ if (!(mysi = GetScrollInfoFromHwnd(hwnd, nBar)))
return GetScrollRange(hwnd, nBar, lpMinPos, lpMaxPos);
*lpMinPos = mysi->nMin;
@@ -395,10 +395,10 @@ int WINAPI CoolSB_SetScrollInfo (HWND hwnd, int fnBar, LPSCROLLINFO lpsi, BOOL f
SCROLLBAR *sbar;
BOOL fRecalcFrame = FALSE;
- if(!lpsi)
+ if (!lpsi)
return FALSE;
- if(!(mysi = GetScrollInfoFromHwnd(hwnd, fnBar)))
+ if (!(mysi = GetScrollInfoFromHwnd(hwnd, fnBar)))
return SetScrollInfo(hwnd, fnBar, lpsi, fRedraw);
//if(CoolSB_IsThumbTracking(hwnd))
@@ -426,9 +426,9 @@ int WINAPI CoolSB_SetScrollInfo (HWND hwnd, int fnBar, LPSCROLLINFO lpsi, BOOL f
sbar = GetScrollBarFromHwnd(hwnd, fnBar);
- if((lpsi->fMask & SIF_DISABLENOSCROLL) || (sbar->fScrollFlags & CSBS_THUMBALWAYS))
+ if ((lpsi->fMask & SIF_DISABLENOSCROLL) || (sbar->fScrollFlags & CSBS_THUMBALWAYS))
{
- if(!sbar->fScrollVisible)
+ if (!sbar->fScrollVisible)
{
CoolSB_ShowScrollBar(hwnd, fnBar, TRUE);
fRecalcFrame = TRUE;
@@ -436,7 +436,7 @@ int WINAPI CoolSB_SetScrollInfo (HWND hwnd, int fnBar, LPSCROLLINFO lpsi, BOOL f
}
else
{
- if( mysi->nPage > (UINT)mysi->nMax
+ if ( mysi->nPage > (UINT)mysi->nMax
|| mysi->nPage == (UINT)mysi->nMax && mysi->nMax == 0
|| mysi->nMax <= mysi->nMin)
{
@@ -448,7 +448,7 @@ int WINAPI CoolSB_SetScrollInfo (HWND hwnd, int fnBar, LPSCROLLINFO lpsi, BOOL f
}
else
{
- if(!sbar->fScrollVisible)
+ if (!sbar->fScrollVisible)
{
CoolSB_ShowScrollBar(hwnd, fnBar, TRUE);
fRecalcFrame = TRUE;
@@ -470,7 +470,7 @@ int WINAPI CoolSB_SetScrollPos(HWND hwnd, int nBar, int nPos, BOOL fRedraw)
SCROLLINFO *mysi;
int oldpos;
- if(!(mysi = GetScrollInfoFromHwnd(hwnd, nBar)))
+ if (!(mysi = GetScrollInfoFromHwnd(hwnd, nBar)))
{
return SetScrollPos(hwnd, nBar, nPos, fRedraw);
}
@@ -494,7 +494,7 @@ int WINAPI CoolSB_SetScrollRange (HWND hwnd, int nBar, int nMinPos, int nMaxPos,
{
SCROLLINFO *mysi;
- if(!(mysi = GetScrollInfoFromHwnd(hwnd, nBar)))
+ if (!(mysi = GetScrollInfoFromHwnd(hwnd, nBar)))
return SetScrollRange(hwnd, nBar, nMinPos, nMaxPos, fRedraw);
if(CoolSB_IsThumbTracking(hwnd))
@@ -520,10 +520,10 @@ BOOL WINAPI CoolSB_ShowScrollBar (HWND hwnd, int wBar, BOOL fShow)
BOOL bFailed = FALSE;
DWORD dwStyle = GetWindowLong(hwnd, GWL_STYLE);
- if(!CoolSB_IsCoolScrollEnabled(hwnd))
+ if (!CoolSB_IsCoolScrollEnabled(hwnd))
return ShowScrollBar(hwnd, wBar, fShow);
- if((wBar == SB_HORZ || wBar == SB_BOTH) &&
+ if ((wBar == SB_HORZ || wBar == SB_BOTH) &&
(sbar = GetScrollBarFromHwnd(hwnd, SB_HORZ)))
{
sbar->fScrollFlags = sbar->fScrollFlags & ~CSBS_VISIBLE;
@@ -534,7 +534,7 @@ BOOL WINAPI CoolSB_ShowScrollBar (HWND hwnd, int wBar, BOOL fShow)
else SetWindowLong(hwnd, GWL_STYLE, dwStyle & ~WS_HSCROLL);
}
- if((wBar == SB_VERT || wBar == SB_BOTH) &&
+ if ((wBar == SB_VERT || wBar == SB_BOTH) &&
(sbar = GetScrollBarFromHwnd(hwnd, SB_VERT)))
{
sbar->fScrollFlags = sbar->fScrollFlags & ~CSBS_VISIBLE;
@@ -572,7 +572,7 @@ HRESULT WINAPI UninitializeCoolSB(HWND hwnd)
{
int i = 0;
SCROLLWND *sw = GetScrollWndFromHwnd(hwnd);
- if(!sw) return E_FAIL;
+ if (!sw) return E_FAIL;
//restore the window procedure with the original one
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)sw->oldproc);
@@ -610,9 +610,9 @@ BOOL WINAPI CoolSB_InsertButton(HWND hwnd, int wSBflags, UINT nPos, SCROLLBUT *p
SCROLLBUT *sbut;
UINT i;
- if(!psb) return FALSE;
+ if (!psb) return FALSE;
- if(!(sbar = GetScrollBarFromHwnd(hwnd, wSBflags)))
+ if (!(sbar = GetScrollBarFromHwnd(hwnd, wSBflags)))
return FALSE;
//check that we havn't reached the maximum allowed buttons yet
@@ -625,7 +625,7 @@ BOOL WINAPI CoolSB_InsertButton(HWND hwnd, int wSBflags, UINT nPos, SCROLLBUT *p
sbut = &sbar->sbButtons[sbar->nButtons];
}
//otherwise, need to make room
- else if((int)nPos < 0 || (int)nPos > (UINT)sbar->nButtons)
+ else if ((int)nPos < 0 || (int)nPos > (UINT)sbar->nButtons)
{
return FALSE;
}
@@ -688,7 +688,7 @@ BOOL WINAPI CoolSB_InsertButton(HWND hwnd, int wSBflags, UINT nPos, SCROLLBUT *p
We don't use the callback function anymore. The uButType
member must now specify SBBT_OWNERDRAW, and a WM_NOTIFY will
be sent when a button must be drawn
- if((psb->fMask & SBBF_OWNERDRAW) && ((psb->uButType & SBBT_MASK) == SBBT_OWNERDRAW))
+ if ((psb->fMask & SBBF_OWNERDRAW) && ((psb->uButType & SBBT_MASK) == SBBT_OWNERDRAW))
pDrawProc = psb->pDrawProc;
else
pDrawProc = 0;*/
@@ -698,7 +698,7 @@ BOOL WINAPI CoolSB_InsertButton(HWND hwnd, int wSBflags, UINT nPos, SCROLLBUT *p
//MAKE SURE that any resizable buttons are only to the left / above
//a scrollbar. We don't support resize operations to the right of a scrollbar
- if((sbut->uButType & SBBM_RESIZABLE) && sbut->uPlacement == SBBP_RIGHT)
+ if ((sbut->uButType & SBBM_RESIZABLE) && sbut->uPlacement == SBBP_RIGHT)
sbut->uButType &= ~SBBM_RESIZABLE;
if(psb->fMask & SBBF_BUTMINMAX)
@@ -739,10 +739,10 @@ BOOL WINAPI CoolSB_ModifyButton (HWND hwnd, int wSBflags, UINT uItem, BOOL fByCm
SCROLLBAR *sbar;
SCROLLBUT *sbut;
- if(!psb) return FALSE;
+ if (!psb) return FALSE;
//find if this window is CoolScroll enabled
- if(!(sbar = GetScrollBarFromHwnd(hwnd, wSBflags)))
+ if (!(sbar = GetScrollBarFromHwnd(hwnd, wSBflags)))
return FALSE;
//find the button to modify, depending on if we
@@ -750,7 +750,7 @@ BOOL WINAPI CoolSB_ModifyButton (HWND hwnd, int wSBflags, UINT uItem, BOOL fByCm
if(fByCmd == FALSE)
{
//button from position
- if((int)uItem < 0 || (int)uItem >= (UINT)sbar->nButtons)
+ if ((int)uItem < 0 || (int)uItem >= (UINT)sbar->nButtons)
return FALSE;
else
sbut = &sbar->sbButtons[uItem];
@@ -758,7 +758,7 @@ BOOL WINAPI CoolSB_ModifyButton (HWND hwnd, int wSBflags, UINT uItem, BOOL fByCm
else if(fByCmd == TRUE)
{
//button from command identifier
- if(!(sbut = GetButtonFromId(sbar, uItem)))
+ if (!(sbut = GetButtonFromId(sbar, uItem)))
return FALSE;
}
@@ -786,7 +786,7 @@ BOOL WINAPI CoolSB_RemoveButton(HWND hwnd, int wSBflags, UINT uItem, BOOL fByCmd
SCROLLBAR *sbar;
//find if this window is CoolScroll enabled
- if(!(sbar = GetScrollBarFromHwnd(hwnd, wSBflags)))
+ if (!(sbar = GetScrollBarFromHwnd(hwnd, wSBflags)))
return FALSE;
//find the button to modify, depending on if we
@@ -833,10 +833,10 @@ BOOL WINAPI CoolSB_GetButton(HWND hwnd, int wSBflags, UINT uItem, BOOL fByCmd, S
SCROLLBAR *sbar;
SCROLLBUT *sbut;
- if(!psb) return FALSE;
+ if (!psb) return FALSE;
//find if this window is CoolScroll enabled
- if(!(sbar = GetScrollBarFromHwnd(hwnd, wSBflags)))
+ if (!(sbar = GetScrollBarFromHwnd(hwnd, wSBflags)))
return FALSE;
//find the button to modify, depending on if we
@@ -844,7 +844,7 @@ BOOL WINAPI CoolSB_GetButton(HWND hwnd, int wSBflags, UINT uItem, BOOL fByCmd, S
if(fByCmd == FALSE)
{
//button from position
- if((int)uItem < 0 || (int)uItem >= (UINT)sbar->nButtons)
+ if ((int)uItem < 0 || (int)uItem >= (UINT)sbar->nButtons)
return FALSE;
else
sbut = &sbar->sbButtons[uItem];
@@ -852,7 +852,7 @@ BOOL WINAPI CoolSB_GetButton(HWND hwnd, int wSBflags, UINT uItem, BOOL fByCmd, S
else if(fByCmd == TRUE)
{
//button from command identifier
- if(!(sbut = GetButtonFromId(sbar, uItem)))
+ if (!(sbut = GetButtonFromId(sbar, uItem)))
return FALSE;
}
@@ -887,17 +887,17 @@ BOOL WINAPI CoolSB_SetSize (HWND hwnd, int wBar, int nLength, int nWidth)
if(nLength > 256 || nWidth > 256)
return FALSE;
- if(!GetScrollWndFromHwnd(hwnd))
+ if (!GetScrollWndFromHwnd(hwnd))
return FALSE;
- if((wBar == SB_HORZ || wBar == SB_BOTH) &&
+ if ((wBar == SB_HORZ || wBar == SB_BOTH) &&
(sbar = GetScrollBarFromHwnd(hwnd, SB_HORZ)))
{
sbar->nArrowLength = nLength;
sbar->nArrowWidth = nWidth;
}
- if((wBar == SB_VERT || wBar == SB_BOTH) &&
+ if ((wBar == SB_VERT || wBar == SB_BOTH) &&
(sbar = GetScrollBarFromHwnd(hwnd, SB_VERT)))
{
sbar->nArrowLength = nLength;
@@ -919,16 +919,16 @@ BOOL WINAPI CoolSB_SetStyle(HWND hwnd, int wBar, UINT nStyle)
{
SCROLLBAR *sbar;
- if(!GetScrollWndFromHwnd(hwnd))
+ if (!GetScrollWndFromHwnd(hwnd))
return FALSE;
- if((wBar == SB_HORZ || wBar == SB_BOTH) &&
+ if ((wBar == SB_HORZ || wBar == SB_BOTH) &&
(sbar = GetScrollBarFromHwnd(hwnd, SB_HORZ)))
{
sbar->fFlatScrollbar = nStyle;
}
- if((wBar == SB_VERT || wBar == SB_BOTH) &&
+ if ((wBar == SB_VERT || wBar == SB_BOTH) &&
(sbar = GetScrollBarFromHwnd(hwnd, SB_VERT)))
{
sbar->fFlatScrollbar = nStyle;
@@ -948,10 +948,10 @@ BOOL WINAPI CoolSB_SetThumbAlways(HWND hwnd, int wBar, BOOL fThumbAlways)
{
SCROLLBAR *sbar;
- if(!GetScrollWndFromHwnd(hwnd))
+ if (!GetScrollWndFromHwnd(hwnd))
return FALSE;
- if((wBar == SB_HORZ || wBar == SB_BOTH) &&
+ if ((wBar == SB_HORZ || wBar == SB_BOTH) &&
(sbar = GetScrollBarFromHwnd(hwnd, SB_HORZ)))
{
if(fThumbAlways)
@@ -960,7 +960,7 @@ BOOL WINAPI CoolSB_SetThumbAlways(HWND hwnd, int wBar, BOOL fThumbAlways)
sbar->fScrollFlags &= ~CSBS_THUMBALWAYS;
}
- if((wBar == SB_VERT || wBar == SB_BOTH) &&
+ if ((wBar == SB_VERT || wBar == SB_BOTH) &&
(sbar = GetScrollBarFromHwnd(hwnd, SB_VERT)))
{
if(fThumbAlways)
@@ -981,19 +981,19 @@ BOOL WINAPI CoolSB_SetMinThumbSize(HWND hwnd, UINT wBar, UINT size)
{
SCROLLBAR *sbar;
- if(!GetScrollWndFromHwnd(hwnd))
+ if (!GetScrollWndFromHwnd(hwnd))
return FALSE;
if(size == -1)
size = CoolSB_GetDefaultMinThumbSize();
- if((wBar == SB_HORZ || wBar == SB_BOTH) &&
+ if ((wBar == SB_HORZ || wBar == SB_BOTH) &&
(sbar = GetScrollBarFromHwnd(hwnd, SB_HORZ)))
{
sbar->nMinThumbSize = size;
}
- if((wBar == SB_VERT || wBar == SB_BOTH) &&
+ if ((wBar == SB_VERT || wBar == SB_BOTH) &&
(sbar = GetScrollBarFromHwnd(hwnd, SB_VERT)))
{
sbar->nMinThumbSize = size;
diff --git a/plugins/Clist_nicer/coolsb/coolscroll.cpp b/plugins/Clist_nicer/coolsb/coolscroll.cpp
index 68fd144edb..ae31ec3e47 100644
--- a/plugins/Clist_nicer/coolsb/coolscroll.cpp
+++ b/plugins/Clist_nicer/coolsb/coolscroll.cpp
@@ -106,7 +106,7 @@ BOOL WINAPI CoolSB_IsThumbTracking(HWND hwnd)
{
SCROLLWND *sw;
- if((sw = GetScrollWndFromHwnd(hwnd)) == NULL)
+ if ((sw = GetScrollWndFromHwnd(hwnd)) == NULL)
return FALSE;
else
return sw->fThumbTracking;
@@ -142,7 +142,7 @@ static void __stdcall RotateRect0(SCROLLBAR *sb, RECT *rect)
//
static BOOL IsScrollInfoActive(SCROLLINFO *si)
{
- if((si->nPage > (UINT)si->nMax
+ if ((si->nPage > (UINT)si->nMax
|| si->nMax <= si->nMin || si->nMax == 0))
return FALSE;
else
@@ -155,7 +155,7 @@ static BOOL IsScrollInfoActive(SCROLLINFO *si)
static BOOL IsScrollbarActive(SCROLLBAR *sb)
{
SCROLLINFO *si = &sb->scrollInfo;
- if(((sb->fScrollFlags & ESB_DISABLE_BOTH) == ESB_DISABLE_BOTH) ||
+ if (((sb->fScrollFlags & ESB_DISABLE_BOTH) == ESB_DISABLE_BOTH) ||
!(sb->fScrollFlags & CSBS_THUMBALWAYS) && !IsScrollInfoActive(si))
return FALSE;
else
@@ -832,7 +832,7 @@ static LRESULT NCDrawHScrollbar(SCROLLBAR *sb, HWND hwnd, HDC hdc, const RECT *r
if(sb->fScrollFlags & ESB_DISABLE_RIGHT) uRightButFlags |= DFCS_INACTIVE;
//if we need to grey the arrows because there is no data to scroll
- if(!IsScrollInfoActive(si) && !(sb->fScrollFlags & CSBS_THUMBALWAYS))
+ if (!IsScrollInfoActive(si) && !(sb->fScrollFlags & CSBS_THUMBALWAYS))
{
uLeftButFlags |= DFCS_INACTIVE;
uRightButFlags |= DFCS_INACTIVE;
@@ -954,7 +954,7 @@ static LRESULT NCDrawHScrollbar(SCROLLBAR *sb, HWND hwnd, HDC hdc, const RECT *r
//if we always show the thumb covering the whole scrollbar,
//then draw it that way
- if(!IsScrollInfoActive(si) && (sb->fScrollFlags & CSBS_THUMBALWAYS)
+ if (!IsScrollInfoActive(si) && (sb->fScrollFlags & CSBS_THUMBALWAYS)
&& ctrl.right - ctrl.left > sb->nMinThumbSize)
{
//leave a 1-pixel gap between the thumb + right button
@@ -1342,7 +1342,7 @@ static LRESULT DrawHorzButtons(SCROLLBAR *sbar, HDC hdc, const RECT *rect, int l
for(i = 0; i < sbar->nButtons; i++)
{
- if((leftright & SBBP_LEFT) && sbut[i].uPlacement == SBBP_LEFT)
+ if ((leftright & SBBP_LEFT) && sbut[i].uPlacement == SBBP_LEFT)
{
int butwidth = GetSingleButSize(sbar, &sbut[i]);
SetRect(&ctrl, xposl, rect->top, xposl + butwidth, rect->bottom);
@@ -1352,7 +1352,7 @@ static LRESULT DrawHorzButtons(SCROLLBAR *sbar, HDC hdc, const RECT *rect, int l
xposl += butwidth;
}
- if((leftright & SBBP_RIGHT) && sbut[i].uPlacement == SBBP_RIGHT)
+ if ((leftright & SBBP_RIGHT) && sbut[i].uPlacement == SBBP_RIGHT)
{
int butwidth = GetSingleButSize(sbar, &sbut[i]);
SetRect(&ctrl, xposr, rect->top, xposr + butwidth, rect->bottom);
@@ -1603,7 +1603,7 @@ static LRESULT NCPaint(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam)
CopyRect(&rect2, &rect);
OffsetRect(&rect2, winrect.left, winrect.top);
- if(!sw->fLeftScrollbar && parent.right == rect2.right+sw->cxRightEdge && parent.bottom == rect2.bottom+sw->cyBottomEdge
+ if (!sw->fLeftScrollbar && parent.right == rect2.right+sw->cxRightEdge && parent.bottom == rect2.bottom+sw->cyBottomEdge
|| sw->fLeftScrollbar && parent.left == rect2.left -sw->cxLeftEdge && parent.bottom == rect2.bottom+sw->cyBottomEdge)
DrawFrameControl(hdc, &rect, DFC_SCROLL, sw->fLeftScrollbar ? DFCS_SCROLLSIZEGRIPRIGHT : DFCS_SCROLLSIZEGRIP );
else
@@ -1770,7 +1770,7 @@ static UINT GetHorzButtonFromPt(SCROLLBAR *sb, RECT *rect, POINT pt, BOOL fRetur
int butwidth;
SCROLLBUT *sbut = sb->sbButtons;
- if(!PtInRect(rect, pt))
+ if (!PtInRect(rect, pt))
return -1;
if(sb->fButVisibleAfter)
@@ -2007,7 +2007,7 @@ static LRESULT NCLButtonDown(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lPa
case HTSCROLL_THUMB:
//if the scrollbar is disabled, then do no further processing
- if(!IsScrollbarActive(sb))
+ if (!IsScrollbarActive(sb))
return 0;
GetRealScrollRect(sb, &rect);
@@ -2056,7 +2056,7 @@ static LRESULT NCLButtonDown(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lPa
target1:
//if the scrollbar is disabled, then do no further processing
- if(!IsScrollbarActive(sb))
+ if (!IsScrollbarActive(sb))
break;
//ajust the horizontal rectangle to NOT include
@@ -2162,7 +2162,7 @@ static LRESULT LButtonUp(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam)
SCROLLBUT *sbut = &sb->sbButtons[buttonIdx];
UINT cmdid = sbut->uCmdId;
- if((sbut->uButType & SBBT_MASK) == SBBT_TOGGLEBUTTON)
+ if ((sbut->uButType & SBBT_MASK) == SBBT_TOGGLEBUTTON)
sbut->uState ^= 1;
//send a notify??
@@ -2274,7 +2274,7 @@ static LRESULT ThumbTrackHorz(SCROLLBAR *sbar, HWND hwnd, int x, int y)
//if the mouse is not in a suitable distance of the scrollbar,
//then "snap" the thumb back to its initial position
#ifdef SNAP_THUMB_BACK
- if(!PtInRect(&rc2, pt))
+ if (!PtInRect(&rc2, pt))
{
thumbpos = nThumbPos0;
}
@@ -2494,7 +2494,7 @@ static LRESULT MouseMove(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam)
if(sbut->nSize < (int)sbut->nMinSize)
sbut->nSize = sbut->nMinSize;
- if((UINT)sbut->nSize > (UINT)sbut->nMaxSize)
+ if ((UINT)sbut->nSize > (UINT)sbut->nMaxSize)
sbut->nSize = sbut->nMaxSize;
GetScrollRect(sw, uCurrentScrollbar, hwnd, &rect2);
@@ -2645,7 +2645,7 @@ static void ResizeButtonsToFit(SCROLLWND *sw, SCROLLBAR *sbar, HWND hwnd)
if(sbut->nSize < (int)sbut->nMinSize)
sbut->nSize = sbut->nMinSize;
- if((UINT)sbut->nSize > (UINT)sbut->nMaxSize)
+ if ((UINT)sbut->nSize > (UINT)sbut->nMaxSize)
sbut->nSize = sbut->nMaxSize;
@@ -2713,7 +2713,7 @@ static LRESULT NCCalcSize(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam
//if there is room, allocate some space for the horizontal scrollbar
//NOTE: Change the ">" to a ">=" to make the horz bar totally fill the
//window before disappearing
- if((sb->fScrollFlags & CSBS_VISIBLE) &&
+ if ((sb->fScrollFlags & CSBS_VISIBLE) &&
#ifdef COOLSB_FILLWINDOW
rect->bottom - rect->top >= GetScrollMetric(sb, SM_CYHORZSB))
#else
@@ -2729,7 +2729,7 @@ static LRESULT NCCalcSize(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam
sb = &sw->sbarVert;
//if there is room, allocate some space for the vertical scrollbar
- if((sb->fScrollFlags & CSBS_VISIBLE) &&
+ if ((sb->fScrollFlags & CSBS_VISIBLE) &&
rect->right - rect->left >= GetScrollMetric(sb, SM_CXVERTSB))
{
if(sw->fLeftScrollbar)
@@ -2822,7 +2822,7 @@ static LRESULT CoolSB_Timer(SCROLLWND *swnd, HWND hwnd, WPARAM wTimerId, LPARAM
//then kill the timer..
GetCursorPos(&pt);
- if(!PtInRect(&MouseOverRect, pt))
+ if (!PtInRect(&MouseOverRect, pt))
{
KillTimer(hwnd, uMouseOverId);
uMouseOverId = 0;
@@ -3020,7 +3020,7 @@ static LRESULT CoolSB_SetCursor(SCROLLWND *swnd, HWND hwnd, WPARAM wParam, LPARA
}
//set the cursor if one has been specified
- if((id = GetButtonFromPt(sbar, &rect, pt, TRUE)) != -1)
+ if ((id = GetButtonFromPt(sbar, &rect, pt, TRUE)) != -1)
{
sbut = &sbar->sbButtons[id];
curTool = sbut->uCmdId;
diff --git a/plugins/ContactsPlus/contacts.vcxproj b/plugins/ContactsPlus/contacts.vcxproj
index 11c856d9e1..bd814a7095 100644
--- a/plugins/ContactsPlus/contacts.vcxproj
+++ b/plugins/ContactsPlus/contacts.vcxproj
@@ -156,6 +156,8 @@
<PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;CONTACTS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<ExceptionHandling>false</ExceptionHandling>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>contacts.h</PrecompiledHeaderFile>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
diff --git a/plugins/ContactsPlus/send.cpp b/plugins/ContactsPlus/send.cpp
index 1382b627b5..cebc2cb00d 100644
--- a/plugins/ContactsPlus/send.cpp
+++ b/plugins/ContactsPlus/send.cpp
@@ -375,7 +375,7 @@ INT_PTR CALLBACK SendDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
case WM_COMMAND:
{
- if(!lParam && CallService(MS_CLIST_MENUPROCESSCOMMAND,MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)wndData->hContact))
+ if (!lParam && CallService(MS_CLIST_MENUPROCESSCOMMAND,MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)wndData->hContact))
break;
switch(LOWORD(wParam))
diff --git a/plugins/ContactsPlus/utils.cpp b/plugins/ContactsPlus/utils.cpp
index a86cdff85f..314e018a39 100644
--- a/plugins/ContactsPlus/utils.cpp
+++ b/plugins/ContactsPlus/utils.cpp
@@ -697,11 +697,11 @@ WCHAR *make_unicode_string(const unsigned char *utf8)
c = utf8[index++];
while (c)
{
- if((c & 0x80) == 0)
+ if ((c & 0x80) == 0)
{
out[out_index++] = c;
}
- else if((c & 0xe0) == 0xe0)
+ else if ((c & 0xe0) == 0xe0)
{
out[out_index] = (c & 0x1F) << 12;
c = utf8[index++];
@@ -780,7 +780,7 @@ static int utf8_decode(const unsigned char *from, char **to)
}
*to = (char*)malloc((chars + 1)*sizeof(unsigned char));
- if(*to == NULL)
+ if (*to == NULL)
{
// fprintf(stderr, "Out of memory processing string to local charset\n");
SAFE_FREE((void**)&unicode);
diff --git a/plugins/CountryFlags/countrylistext.c b/plugins/CountryFlags/countrylistext.c
index 50978fdb97..6f234c7533 100644
--- a/plugins/CountryFlags/countrylistext.c
+++ b/plugins/CountryFlags/countrylistext.c
@@ -278,14 +278,14 @@ static int ServiceGetCountryByNumber(WPARAM wParam,LPARAM lParam)
int i;
UNREFERENCED_PARAMETER(lParam);
for(i=0; i<SIZEOF(countries); ++i)
- if((int)wParam==countries[i].id)
+ if ((int)wParam==countries[i].id)
return (int)countries[i].szName;
return (int)(char*)NULL;
}
static int ServiceGetCountryList(WPARAM wParam,LPARAM lParam)
{
- if((int*)wParam==NULL || (void*)lParam==NULL) return 1;
+ if ((int*)wParam==NULL || (void*)lParam==NULL) return 1;
*(int*)wParam=SIZEOF(countries);
*(struct CountryListEntry**)lParam=countries;
return 0;
diff --git a/plugins/CountryFlags/extraimg.c b/plugins/CountryFlags/extraimg.c
index cd50cc2ccb..1fec5f0b5f 100644
--- a/plugins/CountryFlags/extraimg.c
+++ b/plugins/CountryFlags/extraimg.c
@@ -253,7 +253,7 @@ static void CALLBACK UpdateStatusIcons(LPARAM lParam)
msgwi.hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
while(msgwi.hContact!=NULL) {
/* is a message window opened for this contact? */
- if(!CallService(MS_MSG_GETWINDOWDATA,(WPARAM)&msgwi,(LPARAM)&msgw) && msgw.uState&MSG_WINDOW_STATE_EXISTS) {
+ if (!CallService(MS_MSG_GETWINDOWDATA,(WPARAM)&msgwi,(LPARAM)&msgw) && msgw.uState&MSG_WINDOW_STATE_EXISTS) {
countryNumber=ServiceDetectContactOriginCountry((WPARAM)msgwi.hContact,0);
if(fShow) SetStatusIcon(msgwi.hContact,countryNumber);
else UnsetStatusIcon(msgwi.hContact,countryNumber);
@@ -340,7 +340,7 @@ static int CALLBACK ExtraImgOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA
{ BOOL checked=IsDlgButtonChecked(hwndDlg,IDC_CHECK_SHOWEXTRAIMGFLAG);
EnableWindow(GetDlgItem(hwndDlg,IDC_TEXT_EXTRAIMGFLAGCOLUMN),checked);
EnableWindow(GetDlgItem(hwndDlg,IDC_COMBO_EXTRAIMGFLAGCOLUMN),checked);
- if(!checked) checked=IsDlgButtonChecked(hwndDlg,IDC_CHECK_SHOWSTATUSICONFLAG);
+ if (!checked) checked=IsDlgButtonChecked(hwndDlg,IDC_CHECK_SHOWSTATUSICONFLAG);
EnableWindow(GetDlgItem(hwndDlg,IDC_CHECK_USEUNKNOWNFLAG),checked);
EnableWindow(GetDlgItem(hwndDlg,IDC_CHECK_USEIPTOCOUNTRY),checked);
return TRUE;
@@ -395,17 +395,17 @@ static int ExtraImgOptInit(WPARAM wParam,LPARAM lParam)
static int ExtraImgSettingChanged(WPARAM wParam,LPARAM lParam)
{
DBCONTACTWRITESETTING *dbcws=(DBCONTACTWRITESETTING*)lParam;
- if((HANDLE)wParam==NULL) {
- if(!lstrcmpA(dbcws->szModule,"Flags")) {
+ if ((HANDLE)wParam==NULL) {
+ if (!lstrcmpA(dbcws->szModule,"Flags")) {
/* Extra Image */
- if(!lstrcmpA(dbcws->szSetting,"ShowExtraImgFlag") ||
+ if (!lstrcmpA(dbcws->szSetting,"ShowExtraImgFlag") ||
!lstrcmpA(dbcws->szSetting,"ExtraImgFlagColumn") ||
!lstrcmpA(dbcws->szSetting,"UseUnknownFlag") ||
!lstrcmpA(dbcws->szSetting,"UseIpToCountry"))
if(ServiceExists(MS_CLIST_EXTRA_SET_ICON))
CallFunctionBuffered(UpdateExtraImages,0,FALSE,EXTRAIMAGE_REFRESHDELAY);
/* Status Icon */
- if(!lstrcmpA(dbcws->szSetting,"ShowStatusIconFlag") ||
+ if (!lstrcmpA(dbcws->szSetting,"ShowStatusIconFlag") ||
!lstrcmpA(dbcws->szSetting,"UseUnknownFlag") ||
!lstrcmpA(dbcws->szSetting,"UseIpToCountry"))
if(ServiceExists(MS_MSG_ADDICON))
@@ -413,7 +413,7 @@ static int ExtraImgSettingChanged(WPARAM wParam,LPARAM lParam)
}
}
/* user details update */
- else if(!lstrcmpA(dbcws->szSetting,"RealIP") ||
+ else if (!lstrcmpA(dbcws->szSetting,"RealIP") ||
!lstrcmpA(dbcws->szSetting,"Country") ||
!lstrcmpA(dbcws->szSetting,"CompanyCountry")) {
/* Extra Image */
diff --git a/plugins/CountryFlags/huffman.c b/plugins/CountryFlags/huffman.c
index f05e82113e..b253f2d48f 100644
--- a/plugins/CountryFlags/huffman.c
+++ b/plugins/CountryFlags/huffman.c
@@ -124,7 +124,7 @@ static unsigned int _Huffman_ReadBit( huff_bitstream_t *stream )
/* Extract bit */
x = (*buf & (1<<(7-bit))) ? 1 : 0;
bit = (bit+1) & 7;
- if( !bit )
+ if ( !bit )
{
++ buf;
}
@@ -179,13 +179,13 @@ static void _Huffman_WriteBits( huff_bitstream_t *stream, unsigned int x,
/* Append bits */
mask = 1 << (bits-1);
- for( count = 0; count < bits; ++ count )
+ for ( count = 0; count < bits; ++ count )
{
*buf = (unsigned char)((*buf & (0xff^(1<<(7-bit)))) +
((x & mask ? 1 : 0) << (7-bit)));
x <<= 1;
bit = (bit+1) & 7;
- if( !bit )
+ if ( !bit )
{
++ buf;
}
@@ -209,7 +209,7 @@ static void _Huffman_Hist( unsigned char *in, huff_sym_t *sym,
int k;
/* Clear/init histogram */
- for( k = 0; k < 256; ++ k )
+ for ( k = 0; k < 256; ++ k )
{
sym[k].Symbol = k;
sym[k].Count = 0;
@@ -218,7 +218,7 @@ static void _Huffman_Hist( unsigned char *in, huff_sym_t *sym,
}
/* Build histogram */
- for( k = size; k; -- k )
+ for ( k = size; k; -- k )
{
sym[*in ++].Count ++;
}
@@ -238,16 +238,16 @@ static void _Huffman_StoreTree( huff_encodenode_t *node, huff_sym_t *sym,
unsigned int sym_idx;
/* Is this a leaf node? */
- if( node->Symbol >= 0 )
+ if ( node->Symbol >= 0 )
{
/* Append symbol to tree description */
_Huffman_WriteBits( stream, 1, 1 );
_Huffman_WriteBits( stream, node->Symbol, 8 );
/* Find symbol index */
- for( sym_idx = 0; sym_idx < 256; ++ sym_idx )
+ for ( sym_idx = 0; sym_idx < 256; ++ sym_idx )
{
- if( sym[sym_idx].Symbol == node->Symbol ) break;
+ if ( sym[sym_idx].Symbol == node->Symbol ) break;
}
/* Store code info in symbol array */
@@ -282,9 +282,9 @@ static void _Huffman_MakeTree( huff_sym_t *sym, huff_bitstream_t *stream )
/* Initialize all leaf nodes */
num_symbols = 0;
- for( k = 0; k < 256; ++ k )
+ for ( k = 0; k < 256; ++ k )
{
- if( sym[k].Count > 0 )
+ if ( sym[k].Count > 0 )
{
nodes[num_symbols].Symbol = sym[k].Symbol;
nodes[num_symbols].Count = sym[k].Count;
@@ -304,16 +304,16 @@ static void _Huffman_MakeTree( huff_sym_t *sym, huff_bitstream_t *stream )
/* Find the two lightest nodes */
node_1 = (huff_encodenode_t *) 0;
node_2 = (huff_encodenode_t *) 0;
- for( k = 0; k < next_idx; ++ k )
+ for ( k = 0; k < next_idx; ++ k )
{
- if( nodes[k].Count > 0 )
+ if ( nodes[k].Count > 0 )
{
- if( !node_1 || (nodes[k].Count <= node_1->Count) )
+ if ( !node_1 || (nodes[k].Count <= node_1->Count) )
{
node_2 = node_1;
node_1 = &nodes[k];
}
- else if( !node_2 || (nodes[k].Count <= node_2->Count) )
+ else if ( !node_2 || (nodes[k].Count <= node_2->Count) )
{
node_2 = &nodes[k];
}
@@ -334,7 +334,7 @@ static void _Huffman_MakeTree( huff_sym_t *sym, huff_bitstream_t *stream )
/* Store the tree in the output stream, and in the sym[] array (the
latter is used as a look-up-table for faster encoding) */
- if( root )
+ if ( root )
{
_Huffman_StoreTree( root, sym, stream, 0, 0 );
}
@@ -367,7 +367,7 @@ static huff_decodenode_t * _Huffman_RecoverTree( huff_decodenode_t *nodes,
this_node->ChildB = (huff_decodenode_t *) 0;
/* Is this a leaf node? */
- if( _Huffman_ReadBit( stream ) )
+ if ( _Huffman_ReadBit( stream ) )
{
/* Get symbol from tree description and store in lead node */
this_node->Symbol = _Huffman_Read8Bits( stream );
@@ -409,7 +409,7 @@ int Huffman_Compress( unsigned char *in, unsigned char *out,
unsigned int k, total_bytes, swaps, symbol;
/* Do we have anything to compress? */
- if( insize < 1 ) return 0;
+ if ( insize < 1 ) return 0;
/* Initialize bitstream */
_Huffman_InitBitstream( &stream, out );
@@ -424,9 +424,9 @@ int Huffman_Compress( unsigned char *in, unsigned char *out,
do
{
swaps = 0;
- for( k = 0; k < 255; ++ k )
+ for ( k = 0; k < 255; ++ k )
{
- if( sym[k].Symbol > sym[k+1].Symbol )
+ if ( sym[k].Symbol > sym[k+1].Symbol )
{
tmp = sym[k];
sym[k] = sym[k+1];
@@ -438,7 +438,7 @@ int Huffman_Compress( unsigned char *in, unsigned char *out,
while( swaps );
/* Encode input stream */
- for( k = 0; k < insize; ++ k )
+ for ( k = 0; k < insize; ++ k )
{
symbol = in[k];
_Huffman_WriteBits( &stream, sym[symbol].Code,
@@ -447,7 +447,7 @@ int Huffman_Compress( unsigned char *in, unsigned char *out,
/* Calculate size of output data */
total_bytes = (int)(stream.BytePtr - out);
- if( stream.BitPos > 0 )
+ if ( stream.BitPos > 0 )
{
++ total_bytes;
}
@@ -476,7 +476,7 @@ void Huffman_Uncompress( unsigned char *in, unsigned char *out,
unsigned char *buf;
/* Do we have anything to decompress? */
- if( insize < 1 ) return;
+ if ( insize < 1 ) return;
/* Initialize bitstream */
_Huffman_InitBitstream( &stream, in );
@@ -487,14 +487,14 @@ void Huffman_Uncompress( unsigned char *in, unsigned char *out,
/* Decode input stream */
buf = out;
- for( k = 0; k < outsize; ++ k )
+ for ( k = 0; k < outsize; ++ k )
{
/* Traverse tree until we find a matching leaf node */
node = root;
while( node->Symbol < 0 )
{
/* Get next node */
- if( _Huffman_ReadBit( &stream ) )
+ if ( _Huffman_ReadBit( &stream ) )
node = node->ChildB;
else
node = node->ChildA;
diff --git a/plugins/CountryFlags/icons.c b/plugins/CountryFlags/icons.c
index 9611eb0b78..607308b57a 100644
--- a/plugins/CountryFlags/icons.c
+++ b/plugins/CountryFlags/icons.c
@@ -168,7 +168,7 @@ int FASTCALL CountryNumberToIndex(int countryNumber)
static int ServiceLoadFlagIcon(WPARAM wParam,LPARAM lParam)
{
/* return handle */
- if((BOOL)lParam) {
+ if ((BOOL)lParam) {
if(phIconHandles==NULL) return (int)(HANDLE)NULL;
return (int)phIconHandles[CountryNumberToIndex((int)wParam)];
}
diff --git a/plugins/CountryFlags/ip2country.c b/plugins/CountryFlags/ip2country.c
index eae267aaa0..b892fabb83 100644
--- a/plugins/CountryFlags/ip2country.c
+++ b/plugins/CountryFlags/ip2country.c
@@ -211,34 +211,34 @@ static int EnumIpDataLines(const char *pszFileCSV,const char *pszFileOut)
buf=strchr(pszCountry,'"');
*buf=pszTwo[2]='\0';
/* corrections */
- if(!lstrcmpi(pszCountry,"ANTARCTICA")) continue;
- if(!lstrcmpi(pszCountry,"TIMOR-LESTE")) continue;
- if(!lstrcmpi(pszCountry,"PALESTINIAN TERRITORY, OCCUPIED"))
+ if (!lstrcmpi(pszCountry,"ANTARCTICA")) continue;
+ if (!lstrcmpi(pszCountry,"TIMOR-LESTE")) continue;
+ if (!lstrcmpi(pszCountry,"PALESTINIAN TERRITORY, OCCUPIED"))
lstrcpy(pszCountry,"ISRAEL");
- else if(!lstrcmpi(pszCountry,"UNITED STATES MINOR OUTLYING ISLANDS"))
+ else if (!lstrcmpi(pszCountry,"UNITED STATES MINOR OUTLYING ISLANDS"))
lstrcpy(pszCountry,"UNITED STATES");
- else if(!lstrcmpi(pszCountry,"SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS"))
+ else if (!lstrcmpi(pszCountry,"SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS"))
lstrcpy(pszCountry,"UNITED KINGDOM");
- else if(!lstrcmpi(pszTwo,"JE")) /* map error */
+ else if (!lstrcmpi(pszTwo,"JE")) /* map error */
lstrcpy(pszCountry,"UNITED KINGDOM");
- else if(!lstrcmpi(pszTwo,"AX")) /* Åland Island belongs to Finland */
+ else if (!lstrcmpi(pszTwo,"AX")) /* Åland Island belongs to Finland */
lstrcpy(pszCountry,"FINLAND");
- else if(!lstrcmpi(pszTwo,"ME"))
+ else if (!lstrcmpi(pszTwo,"ME"))
lstrcpy(pszCountry,"MONTENEGRO");
- else if(!lstrcmpi(pszTwo,"RS") || !lstrcmpi(pszTwo,"CS"))
+ else if (!lstrcmpi(pszTwo,"RS") || !lstrcmpi(pszTwo,"CS"))
lstrcpy(pszCountry,"SERBIA");
/* convert */
for(i=0;i<nCountriesCount;i++) {
/* map different writings */
for(j=0;j<SIZEOF(differentCountryNames);j++)
- if(!lstrcmpi(countries[i].szName,differentCountryNames[j].szMir)) {
+ if (!lstrcmpi(countries[i].szName,differentCountryNames[j].szMir)) {
buf=(char*)differentCountryNames[j].szCSV;
break;
}
if(j==SIZEOF(differentCountryNames))
buf=(char*)countries[i].szName;
/* check country */
- if(!lstrcmpiA(pszCountry,buf)) {
+ if (!lstrcmpiA(pszCountry,buf)) {
dwOut=(DWORD)atoi(pszFrom);
AppendToByteBuffer(&buffer,(void*)&dwOut,sizeof(DWORD));
dwOut=(DWORD)atoi(pszTo);
diff --git a/plugins/CountryFlags/main.c b/plugins/CountryFlags/main.c
index 9db6655e33..ce4666a1b4 100644
--- a/plugins/CountryFlags/main.c
+++ b/plugins/CountryFlags/main.c
@@ -67,7 +67,7 @@ static void InstallFile(const TCHAR *pszFileName,const TCHAR *pszDestSubDir)
TCHAR szFileFrom[MAX_PATH+1],szFileTo[MAX_PATH+1],*p;
HANDLE hFile;
- if(!GetModuleFileName(hInst,szFileFrom,SIZEOF(szFileFrom)-lstrlen(pszFileName)))
+ if (!GetModuleFileName(hInst,szFileFrom,SIZEOF(szFileFrom)-lstrlen(pszFileName)))
return;
p=_tcsrchr(szFileFrom,_T('\\'));
if(p!=NULL) *(++p)=0;
@@ -77,7 +77,7 @@ static void InstallFile(const TCHAR *pszFileName,const TCHAR *pszDestSubDir)
if(hFile==INVALID_HANDLE_VALUE) return;
CloseHandle(hFile);
- if(!GetModuleFileName(NULL,szFileTo,SIZEOF(szFileTo)-lstrlen(pszDestSubDir)-lstrlen(pszFileName)))
+ if (!GetModuleFileName(NULL,szFileTo,SIZEOF(szFileTo)-lstrlen(pszDestSubDir)-lstrlen(pszFileName)))
return;
p=_tcsrchr(szFileTo,_T('\\'));
if(p!=NULL) *(++p)=0;
@@ -85,7 +85,7 @@ static void InstallFile(const TCHAR *pszFileName,const TCHAR *pszDestSubDir)
CreateDirectory(szFileTo,NULL);
lstrcat(szFileTo,pszFileName); /* buffer safe */
- if(!MoveFile(szFileFrom,szFileTo) && GetLastError()==ERROR_ALREADY_EXISTS) {
+ if (!MoveFile(szFileFrom,szFileTo) && GetLastError()==ERROR_ALREADY_EXISTS) {
DeleteFile(szFileTo);
MoveFile(szFileFrom,szFileTo);
}
diff --git a/plugins/CountryFlags/utils.c b/plugins/CountryFlags/utils.c
index d71b0acde3..0614927a1a 100644
--- a/plugins/CountryFlags/utils.c
+++ b/plugins/CountryFlags/utils.c
@@ -52,7 +52,7 @@ static void CALLBACK BufferedProcTimer(HWND hwnd,UINT msg,UINT idTimer,DWORD cur
for(i=0;i<nCallListCount;++i) {
/* find elapsed procs */
uElapsed=currentTick-callList[i].startTick; /* wraparound works */
- if((uElapsed+USER_TIMER_MINIMUM)>=callList[i].uElapse) {
+ if ((uElapsed+USER_TIMER_MINIMUM)>=callList[i].uElapse) {
/* call elapsed proc */
pfnBuffProc=callList[i].pfnBuffProc;
lParam=callList[i].lParam;
@@ -60,7 +60,7 @@ static void CALLBACK BufferedProcTimer(HWND hwnd,UINT msg,UINT idTimer,DWORD cur
pszProcName=callList[i].pszProcName;
#endif
/* resize storage array */
- if((i+1)<nCallListCount)
+ if ((i+1)<nCallListCount)
MoveMemory(&callList[i],&callList[i+1],((nCallListCount-i-1)*sizeof(struct BufferedCallData)));
--nCallListCount;
--i; /* reiterate current */
@@ -78,7 +78,7 @@ static void CALLBACK BufferedProcTimer(HWND hwnd,UINT msg,UINT idTimer,DWORD cur
CallFunctionAsync((void (CALLBACK *)(void*))pfnBuffProc,(void*)lParam); /* compatible */
}
/* find next timer delay */
- else if((callList[i].uElapse-uElapsed)<uElapseNext)
+ else if ((callList[i].uElapse-uElapsed)<uElapseNext)
uElapseNext=callList[i].uElapse-uElapsed;
}
@@ -111,7 +111,7 @@ void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc,LPARAM lParam,BOOL fAccumula
/* find existing */
for(i=0;i<nCallListCount;++i)
if(callList[i].pfnBuffProc==pfnBuffProc)
- if(!fAccumulateSameParam || callList[i].lParam==lParam) {
+ if (!fAccumulateSameParam || callList[i].lParam==lParam) {
data=&callList[i];
break;
}
@@ -134,7 +134,7 @@ void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc,LPARAM lParam,BOOL fAccumula
data->pszProcName=pszProcName;
mir_snprintf(szDbgLine,sizeof(szDbgLine),"buffered queue: %s(0x%X)\n",pszProcName,lParam); /* all ascii */
OutputDebugStringA(szDbgLine);
- if(!idBufferedTimer) {
+ if (!idBufferedTimer) {
mir_snprintf(szDbgLine,sizeof(szDbgLine),"next buffered timeout: %ums\n",uElapse); /* all ascii */
OutputDebugStringA(szDbgLine);
}
diff --git a/plugins/CryptoPP/GPGw/gpg.c b/plugins/CryptoPP/GPGw/gpg.c
index 354e455a94..8ec3a57b11 100644
--- a/plugins/CryptoPP/GPGw/gpg.c
+++ b/plugins/CryptoPP/GPGw/gpg.c
@@ -126,7 +126,7 @@ gpgResult gpgListPublicKeys(char *aresult)
replace(commandline, txthome, gpgHomeDirectory);
pxresult=pxExecute(commandline, "", &output, &exitcode);
- if((pxresult!=pxSuccess)||(exitcode!=0))
+ if ((pxresult!=pxSuccess)||(exitcode!=0))
{
free(output);
return gpgExecuteFailed;
@@ -153,7 +153,7 @@ gpgResult gpgListSecretKeys(char *aresult)
replace(commandline, txthome, gpgHomeDirectory);
pxresult=pxExecute(commandline, "", &output, &exitcode);
- if((pxresult!=pxSuccess)||(exitcode!=0))
+ if ((pxresult!=pxSuccess)||(exitcode!=0))
{
free(output);
return gpgExecuteFailed;
@@ -175,7 +175,7 @@ gpgResult gpgImportPublicKey(const char *akey)
char *output;
LogMessage(">>> ", "import public key", "\n");
- if(! writeToFile(filename, akey)) return gpgWriteToFileFailed;
+ if (! writeToFile(filename, akey)) return gpgWriteToFileFailed;
output=(char *)malloc(1);
strcpy(output, "");
@@ -186,7 +186,7 @@ gpgResult gpgImportPublicKey(const char *akey)
remove(filename);
free(output);
- if((pxresult!=pxSuccess)||(exitcode!=0))
+ if ((pxresult!=pxSuccess)||(exitcode!=0))
return gpgExecuteFailed;
return gpgSuccess;
@@ -208,7 +208,7 @@ gpgResult gpgExportPublicKey(char *aresult, const char *auserid)
replace(commandline, txthome, gpgHomeDirectory);
pxresult=pxExecute(commandline, "", &output, &exitcode);
- if((pxresult!=pxSuccess)||(exitcode!=0))
+ if ((pxresult!=pxSuccess)||(exitcode!=0))
{
strcpy(aresult, "");
free(output);
@@ -237,7 +237,7 @@ gpgResult gpgDetectUserID(char *aresult, const char *aciphertext)
LogMessage(">>> ", "detect user id", "\n");
strcpy(aresult, "");
- if(! writeToFile(filename, aciphertext))
+ if (! writeToFile(filename, aciphertext))
return gpgWriteToFileFailed;
output=(char *)malloc(1);
@@ -248,7 +248,7 @@ gpgResult gpgDetectUserID(char *aresult, const char *aciphertext)
pxresult=pxExecute(commandline, "", &output, &exitcode);
remove(filename);
- if((pxresult!=pxSuccess)&&(pxresult!=pxSuccessExitCodeInvalid))
+ if ((pxresult!=pxSuccess)&&(pxresult!=pxSuccessExitCodeInvalid))
{
free(output);
return gpgExecuteFailed;
@@ -287,7 +287,7 @@ gpgResult gpgEncrypt(char *aresult, const char *auserid, const char *aplaintext)
LogMessage(">>> ", "encrypt", "\n");
strcpy(aresult, "");
- if(! writeToFile(plainfile, aplaintext))
+ if (! writeToFile(plainfile, aplaintext))
return gpgWriteToFileFailed;
output=(char *)malloc(1);
@@ -302,13 +302,13 @@ gpgResult gpgEncrypt(char *aresult, const char *auserid, const char *aplaintext)
remove(plainfile);
free(output);
- if((pxresult!=pxSuccess)||(exitcode!=0))
+ if ((pxresult!=pxSuccess)||(exitcode!=0))
{
remove(cipherfile);
return gpgExecuteFailed;
}
- if(! readFromFile(aresult, cipherfile))
+ if (! readFromFile(aresult, cipherfile))
{
remove(cipherfile);
return gpgReadFromFileFailed;
@@ -332,7 +332,7 @@ gpgResult gpgDecrypt(char *aresult, const char *aciphertext, const char *apassph
LogMessage(">>> ", "decrypt", "\n");
strcpy(aresult, "");
- if(! writeToFile(cipherfile, aciphertext))
+ if (! writeToFile(cipherfile, aciphertext))
return gpgWriteToFileFailed;
output=(char *)malloc(1);
@@ -348,13 +348,13 @@ gpgResult gpgDecrypt(char *aresult, const char *aciphertext, const char *apassph
remove(cipherfile);
free(output);
- if((pxresult!=pxSuccess)||(exitcode!=0))
+ if ((pxresult!=pxSuccess)||(exitcode!=0))
{
remove(plainfile);
return gpgExecuteFailed;
}
- if(! readFromFile(aresult, plainfile))
+ if (! readFromFile(aresult, plainfile))
{
remove(plainfile);
return gpgReadFromFileFailed;
diff --git a/plugins/CryptoPP/GPGw/main.c b/plugins/CryptoPP/GPGw/main.c
index 766d491704..fc23b24262 100644
--- a/plugins/CryptoPP/GPGw/main.c
+++ b/plugins/CryptoPP/GPGw/main.c
@@ -27,13 +27,13 @@ int __cdecl _gpg_done()
int __cdecl _gpg_open_keyrings(LPSTR ExecPath, LPSTR HomePath)
{
- if( !ExecPath || (!*ExecPath && !ShowSelectExecDlg(ExecPath)) ) {
+ if ( !ExecPath || (!*ExecPath && !ShowSelectExecDlg(ExecPath)) ) {
return 0;
}
- if( !HomePath || (!*HomePath && !ShowSelectHomeDlg(HomePath)) ) {
+ if ( !HomePath || (!*HomePath && !ShowSelectHomeDlg(HomePath)) ) {
return 0;
}
- if( !existsFile(ExecPath) ) {
+ if ( !existsFile(ExecPath) ) {
// ErrorMessage(txtwarning, txtinvalidexecutable, txtverifyoptions);
return 0;
}
@@ -84,9 +84,9 @@ LPSTR __cdecl _gpg_get_passphrases()
// encrypt
for(i=0; i<strlen(b); i++)
- if( b[i]>2 ) {
+ if ( b[i]>2 ) {
x = b[i] ^ ( (i&0x7f) ^ 13);
- if( x>2 ) b[i]=x;
+ if ( x>2 ) b[i]=x;
}
return b;
@@ -97,16 +97,16 @@ void __cdecl _gpg_set_passphrases(LPCSTR buffer)
{
size_t i, l = strlen(buffer); char *t, *p, *b, x;
- if( !l ) return;
+ if ( !l ) return;
b = (char *) LocalAlloc(LPTR,l+1);
strcpy(b, buffer);
// decrypt
for(i=0; i<strlen(b); i++)
- if( b[i]>2 ) {
+ if ( b[i]>2 ) {
x = b[i] ^ ( (i&0x7f) ^ 13);
- if( x>2 ) b[i]=x;
+ if ( x>2 ) b[i]=x;
}
while(*b) {
@@ -167,7 +167,7 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message)
begin=strstr(message, txtbeginpgpmessage);
end=strstr(message, txtendpgpmessage);
- if((begin!=NULL)&&(end!=NULL))
+ if ((begin!=NULL)&&(end!=NULL))
{
strcpy(buffer, "");
strncat(buffer, begin, end-begin+strlen(txtendpgpmessage));
@@ -218,7 +218,7 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message)
strcpy(buffer, plaintext);
}
- if( gpgresult==gpgSuccess && useridvalid==TRUE)
+ if ( gpgresult==gpgSuccess && useridvalid==TRUE)
addPassphrase(keyuserid, passphrase);
ZeroMemory(passphrase, sizeof(passphrase));
@@ -255,7 +255,7 @@ int __cdecl _gpg_select_keyid(HWND hdlg, LPSTR keyid)
void noBackslash(LPSTR path) {
LPSTR ptr;
ptr = path + strlen(path) - 1;
- if( *ptr=='\\' ) *ptr = '\0';
+ if ( *ptr=='\\' ) *ptr = '\0';
}
@@ -267,7 +267,7 @@ LPSTR GetRegValue(HKEY hKey , LPCSTR szPath, LPCSTR szName){
LPSTR ret=0;
RegOpenKey(hKey,szPath,&hKey);
- if( RegQueryValueEx(hKey,szName,NULL,&type,(LPBYTE)&buf,&len)==ERROR_SUCCESS ){
+ if ( RegQueryValueEx(hKey,szName,NULL,&type,(LPBYTE)&buf,&len)==ERROR_SUCCESS ) {
noBackslash((LPSTR)&buf);
ret = (LPSTR)&buf;
}
@@ -280,7 +280,7 @@ LPSTR GetRegValue(HKEY hKey , LPCSTR szPath, LPCSTR szName){
LPSTR GetEnvValue(LPCSTR szName){
LPSTR ret=0;
- if( GetEnvironmentVariable(szName, buf, MAX_PATH) > 0 ) {
+ if ( GetEnvironmentVariable(szName, buf, MAX_PATH) > 0 ) {
noBackslash((LPSTR)&buf);
ret = (LPSTR)&buf;
}
@@ -295,14 +295,14 @@ BOOL ShowSelectExecDlg(LPSTR path)
ZeroMemory(&ofn,sizeof(ofn));
ofn.lpstrFile = GetRegValue(HKEY_CURRENT_USER,"Software\\GNU\\GnuPG","gpgProgram");
- if( ofn.lpstrFile && existsFile(ofn.lpstrFile) ) {
+ if ( ofn.lpstrFile && existsFile(ofn.lpstrFile) ) {
strcpy(path, ofn.lpstrFile);
return TRUE;
}
ofn.lpstrFile = GetRegValue(HKEY_LOCAL_MACHINE,"Software\\GNU\\GnuPG","Install Directory");
- if( ofn.lpstrFile ) {
+ if ( ofn.lpstrFile ) {
strcat(ofn.lpstrFile,"\\gpg.exe");
- if( existsFile(ofn.lpstrFile) ) {
+ if ( existsFile(ofn.lpstrFile) ) {
strcpy(path, ofn.lpstrFile);
return TRUE;
}
@@ -327,19 +327,19 @@ BOOL ShowSelectHomeDlg(LPSTR path)
OPENFILENAME ofn;
ofn.lpstrFile = GetEnvValue("GNUPGHOME");
- if( ofn.lpstrFile && existsPath(ofn.lpstrFile) ) {
+ if ( ofn.lpstrFile && existsPath(ofn.lpstrFile) ) {
strcpy(path, ofn.lpstrFile);
return TRUE;
}
ofn.lpstrFile = GetRegValue(HKEY_CURRENT_USER,"Software\\GNU\\GnuPG","HomeDir");
- if( ofn.lpstrFile && existsPath(ofn.lpstrFile) ) {
+ if ( ofn.lpstrFile && existsPath(ofn.lpstrFile) ) {
strcpy(path, ofn.lpstrFile);
return TRUE;
}
ofn.lpstrFile = GetEnvValue("APPDATA");
- if( ofn.lpstrFile ) {
+ if ( ofn.lpstrFile ) {
strcat(ofn.lpstrFile,"\\gnupg");
- if( existsPath(ofn.lpstrFile) ) {
+ if ( existsPath(ofn.lpstrFile) ) {
strcpy(path, ofn.lpstrFile);
return TRUE;
}
diff --git a/plugins/CryptoPP/GPGw/pipeexec.c b/plugins/CryptoPP/GPGw/pipeexec.c
index 871dfbe3b4..ea54f85d1a 100644
--- a/plugins/CryptoPP/GPGw/pipeexec.c
+++ b/plugins/CryptoPP/GPGw/pipeexec.c
@@ -32,7 +32,7 @@ void storeOutput(HANDLE ahandle, char **aoutput)
success=ReadFile(ahandle, readbuffer, sizeof(readbuffer), &transfered, NULL);
- if((success)&&(transfered!=0))
+ if ((success)&&(transfered!=0))
appendText(aoutput, readbuffer, transfered);
}
while(available>0);
@@ -66,14 +66,14 @@ pxResult pxExecute(char *acommandline, char *ainput, char **aoutput, LPDWORD aex
else securityattributes.lpSecurityDescriptor=NULL;
success=CreatePipe(&newstdin, &writestdin ,&securityattributes ,0);
- if(! success)
+ if (! success)
{
LogMessage("--- ", "create pipe failed", "\n");
return pxCreatePipeFailed;
}
success=CreatePipe(&readstdout, &newstdout, &securityattributes, 0);
- if(! success)
+ if (! success)
{
LogMessage("--- ", "create pipe failed", "\n");
CloseHandle(newstdin);
@@ -90,7 +90,7 @@ pxResult pxExecute(char *acommandline, char *ainput, char **aoutput, LPDWORD aex
success=CreateProcess(NULL, acommandline, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &startupinfo, &processinformation);
- if(! success)
+ if (! success)
{
LogMessage("--- ", "create process failed", "\n");
CloseHandle(newstdin);
@@ -105,11 +105,11 @@ pxResult pxExecute(char *acommandline, char *ainput, char **aoutput, LPDWORD aex
while(TRUE)
{
success=GetExitCodeProcess(processinformation.hProcess, aexitcode);
- if((success)&&(*aexitcode!=STILL_ACTIVE)) break;
+ if ((success)&&(*aexitcode!=STILL_ACTIVE)) break;
storeOutput(readstdout, aoutput);
- if(*inputpos!='\0') size=1;
+ if (*inputpos!='\0') size=1;
else size=0;
success=WriteFile(writestdin, inputpos, size, &transfered, NULL);
diff --git a/plugins/CryptoPP/GPGw/tools.c b/plugins/CryptoPP/GPGw/tools.c
index ee7adde761..002f18824d 100644
--- a/plugins/CryptoPP/GPGw/tools.c
+++ b/plugins/CryptoPP/GPGw/tools.c
@@ -78,7 +78,7 @@ void appendText(char **abuffer, const char *atext, int atextsize)
{
int size;
- if(*abuffer==NULL) size=0;
+ if (*abuffer==NULL) size=0;
else size=strlen(*abuffer);
size++; // abschliessende 0
if(atextsize==0) atextsize=strlen(atext);
diff --git a/plugins/CryptoPP/PGPw/main.cpp b/plugins/CryptoPP/PGPw/main.cpp
index 116615b839..8427046a16 100644
--- a/plugins/CryptoPP/PGPw/main.cpp
+++ b/plugins/CryptoPP/PGPw/main.cpp
@@ -45,7 +45,7 @@ void _pgp_memcpy(LPSTR dst, LPSTR src, UINT size)
int __cdecl _pgp_init()
{
- if(!pgpErrMsg)
+ if (!pgpErrMsg)
pgpErrMsg = (LPSTR) LocalAlloc(LPTR,pgpErrMsgLen);
pgpVer = 0;
@@ -172,7 +172,7 @@ LPSTR __cdecl _pgp_encrypt_keydb(LPCSTR szPlainMsg, PVOID pgpKeyID)
DWORD dwEncMsgLen;
ClearPGPError();
- if(!pgpKeyDB)
+ if (!pgpKeyDB)
return 0;
#if (PGP_WIN32 < 0x700)
@@ -221,7 +221,7 @@ LPSTR __cdecl _pgp_decrypt_keydb(LPCSTR szEncMsg)
DWORD dwPlainMsgLen;
ClearPGPError();
- if(!pgpKeyDB)
+ if (!pgpKeyDB)
return 0;
int iTry = 0;
diff --git a/plugins/CryptoPP/base16.cpp b/plugins/CryptoPP/base16.cpp
index b8c813eff9..db838e498d 100644
--- a/plugins/CryptoPP/base16.cpp
+++ b/plugins/CryptoPP/base16.cpp
@@ -24,7 +24,7 @@ char *base16decode(const char *inBuffer, int *count) {
BYTE *outBufferPtr = (BYTE *) outBuffer;
bool big_endian = false;
- if(*inBuffer == '0' && *(inBuffer+1) == 'x') {
+ if (*inBuffer == '0' && *(inBuffer+1) == 'x') {
inBuffer += *count;
big_endian = true;
*count -= 2;
@@ -39,7 +39,7 @@ char *base16decode(const char *inBuffer, int *count) {
c0 = decode16(*inBuffer++);
c1 = decode16(*inBuffer++);
}
- if((c0 | c1) == BERR) {
+ if ((c0 | c1) == BERR) {
free(outBuffer);
*count = 0;
return(NULL);
diff --git a/plugins/CryptoPP/base64.cpp b/plugins/CryptoPP/base64.cpp
index f639799b92..70c3d672c7 100644
--- a/plugins/CryptoPP/base64.cpp
+++ b/plugins/CryptoPP/base64.cpp
@@ -75,7 +75,7 @@ char *base64decode(const char *inBuffer, int *count) {
if(delta > 3)
c3 = decode64(inBuffer[srcIndex++]);
}
- if((c0 | c1 | c2 | c3) == BERR) {
+ if ((c0 | c1 | c2 | c3) == BERR) {
free(outBuffer);
return(NULL);
}
diff --git a/plugins/CryptoPP/commonheaders.cpp b/plugins/CryptoPP/commonheaders.cpp
index 4ba0c995fa..e518aecb11 100644
--- a/plugins/CryptoPP/commonheaders.cpp
+++ b/plugins/CryptoPP/commonheaders.cpp
@@ -51,13 +51,13 @@ BOOL ExtractFileFromResource( HANDLE FH, int ResType, int ResId, DWORD* Size )
RH = FindResource( g_hInst, MAKEINTRESOURCE( ResId ), MAKEINTRESOURCE( ResType ) );
- if( RH == NULL ) return FALSE;
+ if ( RH == NULL ) return FALSE;
RP = (PBYTE) LoadResource( g_hInst, RH );
- if( RP == NULL ) return FALSE;
+ if ( RP == NULL ) return FALSE;
s = SizeofResource( g_hInst, RH );
- if( !WriteFile( FH, RP, s, &x, NULL ) ) return FALSE;
- if( x != s ) return FALSE;
- if( Size ) *Size = s;
+ if ( !WriteFile( FH, RP, s, &x, NULL ) ) return FALSE;
+ if ( x != s ) return FALSE;
+ if ( Size ) *Size = s;
return TRUE;
}
@@ -66,7 +66,7 @@ void ExtractFile( char *FileName, int ResType, int ResId )
{
HANDLE FH;
FH = CreateFile( FileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL );
- if( FH == INVALID_HANDLE_VALUE ) return;
+ if ( FH == INVALID_HANDLE_VALUE ) return;
if (!ExtractFileFromResource( FH, ResType, ResId, NULL )) MessageBoxA(0,"Can't extract","!!!",MB_OK);
CloseHandle( FH );
}
@@ -78,7 +78,7 @@ int rtrim(LPCSTR str) {
while( len ) {
char c = *ptr;
- if( c != '\x20' && c != '\x09' && c != '\x0A' && c != '\x0D' ) {
+ if ( c != '\x20' && c != '\x09' && c != '\x0A' && c != '\x0D' ) {
*(ptr+1) = '\0';
break;
}
diff --git a/plugins/CryptoPP/cpp_cntx.cpp b/plugins/CryptoPP/cpp_cntx.cpp
index eba883755d..fe3d5c616f 100644
--- a/plugins/CryptoPP/cpp_cntx.cpp
+++ b/plugins/CryptoPP/cpp_cntx.cpp
@@ -11,14 +11,14 @@ unsigned __stdcall sttTimeoutThread(LPVOID);
// get context data on context id
pCNTX get_context_on_id(HANDLE context) {
- if( !thread_timeout ) {
+ if ( !thread_timeout ) {
unsigned int tID;
thread_timeout = (HANDLE) _beginthreadex(NULL, 0, sttTimeoutThread, NULL, 0, &tID);
}
- if( context ) {
+ if ( context ) {
pCNTX cntx = (pCNTX) context;
- if( cntx->header == HEADER && cntx->footer == FOOTER )
+ if ( cntx->header == HEADER && cntx->footer == FOOTER )
return cntx;
#if defined(_DEBUG) || defined(NETLIB_LOG)
else
@@ -42,16 +42,16 @@ HANDLE __cdecl cpp_create_context(int mode) {
EnterCriticalSection(&localContextMutex);
- if( !CL.empty() ) {
+ if ( !CL.empty() ) {
for(i=CL.begin(); i!=CL.end(); ++i) { // èùåì ïóñòîé
- if( (*i)->header==EMPTYH && (*i)->footer==EMPTYH ) {
+ if ( (*i)->header==EMPTYH && (*i)->footer==EMPTYH ) {
cntx = (pCNTX) *i;
break;
}
}
}
- if( !cntx ) { // íå íàøëè - ñîçäàåì íîâûé
+ if ( !cntx ) { // íå íàøëè - ñîçäàåì íîâûé
cntx = (pCNTX) malloc(sizeof(CNTX));
CL.push_back(cntx); // äîáàâèëè â êîíåö ñïèñêà
}
@@ -87,18 +87,18 @@ void __cdecl cpp_reset_context(HANDLE context) {
// allocate pdata
PBYTE cpp_alloc_pdata(pCNTX ptr) {
- if( !ptr->pdata ) {
- if( ptr->mode & MODE_PGP ) {
+ if ( !ptr->pdata ) {
+ if ( ptr->mode & MODE_PGP ) {
ptr->pdata = (PBYTE) malloc(sizeof(PGPDATA));
memset(ptr->pdata,0,sizeof(PGPDATA));
}
else
- if( ptr->mode & MODE_GPG ) {
+ if ( ptr->mode & MODE_GPG ) {
ptr->pdata = (PBYTE) malloc(sizeof(GPGDATA));
memset(ptr->pdata,0,sizeof(GPGDATA));
}
else
- if( ptr->mode & MODE_RSA ) {
+ if ( ptr->mode & MODE_RSA ) {
rsa_alloc(ptr);
}
else {
@@ -115,20 +115,20 @@ void cpp_free_keys(pCNTX ptr) {
SAFE_FREE(ptr->tmp);
cpp_alloc_pdata(ptr);
- if( ptr->mode & MODE_PGP ) {
+ if ( ptr->mode & MODE_PGP ) {
pPGPDATA p = (pPGPDATA) ptr->pdata;
SAFE_FREE(p->pgpKeyID);
SAFE_FREE(p->pgpKey);
SAFE_FREE(ptr->pdata);
}
else
- if( ptr->mode & MODE_GPG ) {
+ if ( ptr->mode & MODE_GPG ) {
pGPGDATA p = (pGPGDATA) ptr->pdata;
SAFE_FREE(p->gpgKeyID);
SAFE_FREE(ptr->pdata);
}
else
- if( ptr->mode & MODE_RSA ) {
+ if ( ptr->mode & MODE_RSA ) {
rsa_free(ptr);
SAFE_DELETE(ptr->pdata);
}
@@ -151,27 +151,27 @@ unsigned __stdcall sttTimeoutThread( LPVOID ) {
list<pCNTX>::iterator i;
while(1) {
Sleep( 1000 ); // ðàç â ñåêóíäó
- if( CL.empty() ) continue;
+ if ( CL.empty() ) continue;
u_int time = gettime();
// ïðîáåãàåì âñå êîíòåêñòû
EnterCriticalSection(&localContextMutex);
for(i=CL.begin(); i!=CL.end(); ++i) {
pCNTX tmp = *i;
- if( tmp->header!=HEADER || tmp->footer!=FOOTER ) continue;
+ if ( tmp->header!=HEADER || tmp->footer!=FOOTER ) continue;
// ïðîïóñêàåì ïðèâàòíûå êëþ÷è
- if( tmp->mode&MODE_PRIV_KEY ) continue;
+ if ( tmp->mode&MODE_PRIV_KEY ) continue;
else
- if( tmp->deleted && tmp->deleted < time ) {
+ if ( tmp->deleted && tmp->deleted < time ) {
// óäàëèòü ïîìå÷åííûé äëÿ óäàëåíèÿ êîíòåêñò
cpp_free_keys(tmp);
tmp->deleted = 0;
tmp->header = tmp->footer = EMPTYH;
}
else
- if( tmp->mode&MODE_RSA && tmp->pdata ) {
+ if ( tmp->mode&MODE_RSA && tmp->pdata ) {
// ïðîâåðÿåì íå ïðîòóõëî ëè ñîåäèíåíèå
pRSADATA p = (pRSADATA) tmp->pdata;
- if( p->time && p->time < time ) {
+ if ( p->time && p->time < time ) {
rsa_timeout((HANDLE)tmp,p);
}
}
diff --git a/plugins/CryptoPP/cpp_gpgw.cpp b/plugins/CryptoPP/cpp_gpgw.cpp
index f053ef8085..90fe8b3062 100644
--- a/plugins/CryptoPP/cpp_gpgw.cpp
+++ b/plugins/CryptoPP/cpp_gpgw.cpp
@@ -111,7 +111,7 @@ int load_gpg_mem(HMODULE mod) {
int __cdecl gpg_init()
{
int r; char t[MAX_PATH];
- if( isVista ){
+ if ( isVista ) {
sprintf(t,"%s\\gnupgw.dll",TEMP);
ExtractFile(t,666,1);
hgpg = LoadLibraryA(t);
@@ -122,13 +122,13 @@ int __cdecl gpg_init()
hgpg = MemLoadLibrary( pRS_gpg );
}
if (hgpg) {
- if( isVista ) load_gpg_dll(hgpg);
+ if ( isVista ) load_gpg_dll(hgpg);
else load_gpg_mem(hgpg);
r = p_gpg_init();
if(r) {
return r;
}
- if( isVista ){
+ if ( isVista ) {
FreeLibrary(hgpg);
}
else {
@@ -149,7 +149,7 @@ int __cdecl gpg_done()
int r = 0;
if(hgpg) {
r = p_gpg_done();
- if( isVista ){
+ if ( isVista ) {
FreeLibrary(hgpg);
}
else {
@@ -201,7 +201,7 @@ LPSTR __cdecl gpg_encrypt(pCNTX ptr, LPCSTR szPlainMsg)
LPSTR szEncMsg;
szEncMsg = p_gpg_encrypt(szPlainMsg,(LPCSTR)p->gpgKeyID);
- if(!szEncMsg) return 0;
+ if (!szEncMsg) return 0;
ptr->tmp = (LPSTR) strdup(szEncMsg);
LocalFree((LPVOID)szEncMsg);
@@ -216,11 +216,11 @@ LPSTR __cdecl gpg_decrypt(pCNTX ptr, LPCSTR szEncMsg)
SAFE_FREE(ptr->tmp);
LPSTR szPlainMsg = p_gpg_decrypt(szEncMsg);
-/* if(!szPlainMsg) {
+/* if (!szPlainMsg) {
ptr = get_context_on_id(hPGPPRIV); // find private pgp keys
if(ptr && ptr->pgpKey)
szPlainMsg = p_gpg_decrypt_key(szEncMsg,(LPCSTR)ptr->pgpKey);
- if(!szPlainMsg) return NULL;
+ if (!szPlainMsg) return NULL;
}*/
ptr->tmp = (LPSTR) strdup(szPlainMsg);
@@ -232,13 +232,13 @@ LPSTR __cdecl gpg_decrypt(pCNTX ptr, LPCSTR szEncMsg)
LPSTR __cdecl gpg_encode(HANDLE context, LPCSTR szPlainMsg)
{
- pCNTX ptr = get_context_on_id(context); if(!ptr) return NULL;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return NULL;
pGPGDATA p = (pGPGDATA) cpp_alloc_pdata(ptr);
- if(!p->gpgKeyID) { ptr->error = ERROR_NO_GPG_KEY; return NULL; }
+ if (!p->gpgKeyID) { ptr->error = ERROR_NO_GPG_KEY; return NULL; }
// utf8 message: encrypt.
LPSTR szUtfMsg;
- if( ptr->mode & MODE_GPG_ANSI ) {
+ if ( ptr->mode & MODE_GPG_ANSI ) {
LPWSTR wszMsg = utf8decode(szPlainMsg);
int wlen = wcslen(wszMsg)+1;
szUtfMsg = (LPSTR) alloca(wlen);
@@ -254,13 +254,13 @@ LPSTR __cdecl gpg_encode(HANDLE context, LPCSTR szPlainMsg)
LPSTR __cdecl gpg_decode(HANDLE context, LPCSTR szEncMsg)
{
pCNTX ptr = get_context_on_id(context);
- if(!ptr) return NULL;
+ if (!ptr) return NULL;
LPSTR szNewMsg = NULL;
LPSTR szOldMsg = gpg_decrypt(ptr, szEncMsg);
if(szOldMsg) {
- if( !is_7bit_string(szOldMsg) && !is_utf8_string(szOldMsg) ) {
+ if ( !is_7bit_string(szOldMsg) && !is_utf8_string(szOldMsg) ) {
int slen = strlen(szOldMsg)+1;
LPWSTR wszMsg = (LPWSTR) alloca(slen*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, szOldMsg, -1, wszMsg, slen*sizeof(WCHAR));
@@ -279,10 +279,10 @@ LPSTR __cdecl gpg_decode(HANDLE context, LPCSTR szEncMsg)
int __cdecl gpg_set_key(HANDLE context, LPCSTR RemoteKey)
{
/* pCNTX ptr = get_context_on_id(context);
- if(!ptr) return 0;
+ if (!ptr) return 0;
ptr->error = ERROR_NONE;
-// if(!p_gpg_check_key(RemoteKey)) return 0;
+// if (!p_gpg_check_key(RemoteKey)) return 0;
SAFE_FREE(ptr->pgpKey);
ptr->pgpKey = (BYTE *) malloc(strlen(RemoteKey)+1);
@@ -296,7 +296,7 @@ int __cdecl gpg_set_key(HANDLE context, LPCSTR RemoteKey)
int __cdecl gpg_set_keyid(HANDLE context, LPCSTR RemoteKeyID)
{
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pGPGDATA p = (pGPGDATA) cpp_alloc_pdata(ptr);
ptr->error = ERROR_NONE;
diff --git a/plugins/CryptoPP/cpp_keys.cpp b/plugins/CryptoPP/cpp_keys.cpp
index 51ac7247b4..16e4e0d281 100644
--- a/plugins/CryptoPP/cpp_keys.cpp
+++ b/plugins/CryptoPP/cpp_keys.cpp
@@ -6,7 +6,7 @@ const unsigned char IV[] = "PSKhell@MIRANDA!";
// generate KeyA pair, return public key as ASCII
LPSTR __cdecl cpp_init_keya(HANDLE context, int features) {
- pCNTX ptr = get_context_on_id(context); if(!ptr) return NULL;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return NULL;
pSIMDATA p = (pSIMDATA) cpp_alloc_pdata(ptr);
int send_features = FEATURES;
@@ -70,19 +70,19 @@ LPSTR __cdecl cpp_init_keya(HANDLE context, int features) {
// store KeyB
int __cdecl cpp_init_keyb(HANDLE context, LPCSTR key) {
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pSIMDATA p = (pSIMDATA) cpp_alloc_pdata(ptr);
int clen = rtrim(key);
ptr->features = 0;
LPSTR pub_binary;
- if((clen==KEYSIZE*2) || (clen==(KEYSIZE+2)*2))
+ if ((clen==KEYSIZE*2) || (clen==(KEYSIZE+2)*2))
pub_binary = base16decode(key,&clen);
else
pub_binary = base64decode(key,&clen);
- if( !pub_binary || (clen!=KEYSIZE && clen!=KEYSIZE+2) ) {
+ if ( !pub_binary || (clen!=KEYSIZE && clen!=KEYSIZE+2) ) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("cpp_init_keyb: error bad_keyb");
#endif
@@ -95,7 +95,7 @@ int __cdecl cpp_init_keyb(HANDLE context, LPCSTR key) {
memcpy((PVOID)&ptr->features,(PVOID)(pub_binary+KEYSIZE),2);
if(p->KeyP) {
- if(!(ptr->features & FEATURES_PSK)) { // if NO PSK on other side
+ if (!(ptr->features & FEATURES_PSK)) { // if NO PSK on other side
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("cpp_init_keyb: error no_psk");
#endif
@@ -141,11 +141,11 @@ int __cdecl cpp_init_keyb(HANDLE context, LPCSTR key) {
// calculate secret key, return true or false
int __cdecl cpp_calc_keyx(HANDLE context) {
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pSIMDATA p = (pSIMDATA) cpp_alloc_pdata(ptr);
- if(!p->KeyA) { ptr->error = ERROR_NO_KEYA; return 0; }
- if(!p->KeyB) { ptr->error = ERROR_NO_KEYB; return 0; }
+ if (!p->KeyA) { ptr->error = ERROR_NO_KEYA; return 0; }
+ if (!p->KeyB) { ptr->error = ERROR_NO_KEYB; return 0; }
ptr->error = ERROR_NONE;
BYTE agreeVal[KEYSIZE];
@@ -178,7 +178,7 @@ int __cdecl cpp_calc_keyx(HANDLE context) {
// create pre-shared key from password
int __cdecl cpp_init_keyp(HANDLE context, LPCSTR password) {
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pSIMDATA p = (pSIMDATA) cpp_alloc_pdata(ptr);
BYTE buffer[Tiger::DIGESTSIZE]; // buffer for hash
diff --git a/plugins/CryptoPP/cpp_misc.cpp b/plugins/CryptoPP/cpp_misc.cpp
index 526cebf6bc..5e5720df18 100644
--- a/plugins/CryptoPP/cpp_misc.cpp
+++ b/plugins/CryptoPP/cpp_misc.cpp
@@ -2,13 +2,13 @@
int __cdecl cpp_get_features(HANDLE context) {
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
return ptr->features;
}
int __cdecl cpp_get_error(HANDLE context) {
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
return ptr->error;
}
@@ -20,8 +20,8 @@ int __cdecl cpp_get_version(void) {
BOOL cpp_get_simdata(HANDLE context, pCNTX *ptr, pSIMDATA *p) {
*ptr = get_context_on_id(context);
-// if(!*ptr || !(*ptr)->pdata || (*ptr)->mode&(MODE_PGP|MODE_GPG|MODE_RSA)) return FALSE;
- if(!*ptr || (*ptr)->mode&(MODE_PGP|MODE_GPG|MODE_RSA)) return FALSE;
+// if (!*ptr || !(*ptr)->pdata || (*ptr)->mode&(MODE_PGP|MODE_GPG|MODE_RSA)) return FALSE;
+ if (!*ptr || (*ptr)->mode&(MODE_PGP|MODE_GPG|MODE_RSA)) return FALSE;
*p = (pSIMDATA) cpp_alloc_pdata(*ptr);
return TRUE;
}
@@ -33,14 +33,14 @@ int __cdecl cpp_size_keyx(void) {
void __cdecl cpp_get_keyx(HANDLE context, BYTE *key) {
- pCNTX ptr; pSIMDATA p; if(!cpp_get_simdata(context,&ptr,&p)) return;
+ pCNTX ptr; pSIMDATA p; if (!cpp_get_simdata(context,&ptr,&p)) return;
memcpy(key,p->KeyX,Tiger::DIGESTSIZE);
memcpy(key+Tiger::DIGESTSIZE,&ptr->features,2);
}
void __cdecl cpp_set_keyx(HANDLE context, BYTE *key) {
- pCNTX ptr; pSIMDATA p; if(!cpp_get_simdata(context,&ptr,&p)) return;
+ pCNTX ptr; pSIMDATA p; if (!cpp_get_simdata(context,&ptr,&p)) return;
SAFE_FREE(p->PubA);
SAFE_FREE(p->KeyA);
SAFE_FREE(p->KeyB);
@@ -52,7 +52,7 @@ void __cdecl cpp_set_keyx(HANDLE context, BYTE *key) {
void __cdecl cpp_get_keyp(HANDLE context, BYTE *key) {
- pCNTX ptr; pSIMDATA p; if(!cpp_get_simdata(context,&ptr,&p)) return;
+ pCNTX ptr; pSIMDATA p; if (!cpp_get_simdata(context,&ptr,&p)) return;
memcpy(key,p->KeyP,Tiger::DIGESTSIZE);
}
@@ -63,7 +63,7 @@ int __cdecl cpp_size_keyp(void) {
void __cdecl cpp_set_keyp(HANDLE context, BYTE *key) {
- pCNTX ptr; pSIMDATA p; if(!cpp_get_simdata(context,&ptr,&p)) return;
+ pCNTX ptr; pSIMDATA p; if (!cpp_get_simdata(context,&ptr,&p)) return;
SAFE_FREE(p->KeyP);
p->KeyP = (PBYTE) malloc(Tiger::DIGESTSIZE);
memcpy(p->KeyP,key,Tiger::DIGESTSIZE);
@@ -71,25 +71,25 @@ void __cdecl cpp_set_keyp(HANDLE context, BYTE *key) {
int __cdecl cpp_keya(HANDLE context) {
- pCNTX ptr; pSIMDATA p; if(!cpp_get_simdata(context,&ptr,&p)) return 0;
+ pCNTX ptr; pSIMDATA p; if (!cpp_get_simdata(context,&ptr,&p)) return 0;
return p->KeyA!=NULL;
}
int __cdecl cpp_keyb(HANDLE context) {
- pCNTX ptr; pSIMDATA p; if(!cpp_get_simdata(context,&ptr,&p)) return 0;
+ pCNTX ptr; pSIMDATA p; if (!cpp_get_simdata(context,&ptr,&p)) return 0;
return p->KeyB!=NULL;
}
int __cdecl cpp_keyx(HANDLE context) {
- pCNTX ptr; pSIMDATA p; if(!cpp_get_simdata(context,&ptr,&p)) return 0;
+ pCNTX ptr; pSIMDATA p; if (!cpp_get_simdata(context,&ptr,&p)) return 0;
return p->KeyX!=NULL;
}
int __cdecl cpp_keyp(HANDLE context) {
- pCNTX ptr; pSIMDATA p; if(!cpp_get_simdata(context,&ptr,&p)) return 0;
+ pCNTX ptr; pSIMDATA p; if (!cpp_get_simdata(context,&ptr,&p)) return 0;
return p->KeyP!=NULL;
}
diff --git a/plugins/CryptoPP/cpp_pgpw.cpp b/plugins/CryptoPP/cpp_pgpw.cpp
index 6d06ac0d7f..e8f9f98ab4 100644
--- a/plugins/CryptoPP/cpp_pgpw.cpp
+++ b/plugins/CryptoPP/cpp_pgpw.cpp
@@ -101,7 +101,7 @@ BOOL load_pgp_sdk(int type, int id)
int r; char t[MAX_PATH];
pgpVer = 0;
- if( isVista ){
+ if ( isVista ) {
sprintf(t,"%s\\pgpsdkw.dll",TEMP);
ExtractFile(t,type,id);
hpgpsdk = LoadLibraryA(t);
@@ -112,14 +112,14 @@ BOOL load_pgp_sdk(int type, int id)
hpgpsdk = MemLoadLibrary( pRS_pgp );
}
if (hpgpsdk) {
- if( isVista ) load_pgpsdk_dll(hpgpsdk);
+ if ( isVista ) load_pgpsdk_dll(hpgpsdk);
else load_pgpsdk_mem(hpgpsdk);
r = p_pgp_init();
if(r) {
pgpVer = p_pgp_get_version();
return r;
}
- if( isVista ){
+ if ( isVista ) {
FreeLibrary(hpgpsdk);
}
else {
@@ -136,7 +136,7 @@ int __cdecl pgp_init()
{
int r;
- if( !hPGPPRIV ) {
+ if ( !hPGPPRIV ) {
// create context for private pgp keys
hPGPPRIV = (HANDLE) cpp_create_context(MODE_PGP|MODE_PRIV_KEY);
pCNTX tmp = (pCNTX) hPGPPRIV;
@@ -144,8 +144,8 @@ int __cdecl pgp_init()
memset(tmp->pdata,0,sizeof(PGPDATA));
}
- if( r = load_pgp_sdk(666,6) ) return r;
- if( r = load_pgp_sdk(666,8) ) return r;
+ if ( r = load_pgp_sdk(666,6) ) return r;
+ if ( r = load_pgp_sdk(666,8) ) return r;
hpgpsdk = 0;
@@ -159,7 +159,7 @@ int __cdecl pgp_done()
pgpVer = 0;
if(hpgpsdk) {
r = p_pgp_done();
- if( isVista ){
+ if ( isVista ) {
FreeLibrary(hpgpsdk);
}
else {
@@ -208,7 +208,7 @@ LPSTR __cdecl pgp_encrypt(pCNTX ptr, LPCSTR szPlainMsg)
szEncMsg = p_pgp_encrypt_key(szPlainMsg,(LPCSTR)p->pgpKey);
else
szEncMsg = p_pgp_encrypt_keydb(szPlainMsg,p->pgpKeyID);
- if(!szEncMsg) return 0;
+ if (!szEncMsg) return 0;
ptr->tmp = (LPSTR) strdup(szEncMsg);
LocalFree((LPVOID)szEncMsg);
@@ -223,14 +223,14 @@ LPSTR __cdecl pgp_decrypt(pCNTX ptr, LPCSTR szEncMsg)
SAFE_FREE(ptr->tmp);
LPSTR szPlainMsg = p_pgp_decrypt_keydb(szEncMsg);
- if(!szPlainMsg) {
+ if (!szPlainMsg) {
ptr = get_context_on_id(hPGPPRIV); // find private pgp keys
if(ptr) {
pPGPDATA p = (pPGPDATA) ptr->pdata;
if(p->pgpKey)
szPlainMsg = p_pgp_decrypt_key(szEncMsg,(LPCSTR)p->pgpKey);
}
- if(!szPlainMsg) return NULL;
+ if (!szPlainMsg) return NULL;
}
ptr->tmp = (LPSTR) strdup(szPlainMsg);
@@ -242,9 +242,9 @@ LPSTR __cdecl pgp_decrypt(pCNTX ptr, LPCSTR szEncMsg)
LPSTR __cdecl pgp_encode(HANDLE context, LPCSTR szPlainMsg)
{
- pCNTX ptr = get_context_on_id(context); if(!ptr) return NULL;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return NULL;
pPGPDATA p = (pPGPDATA) cpp_alloc_pdata(ptr);
- if( !p->pgpKeyID && !p->pgpKey ) { ptr->error = ERROR_NO_PGP_KEY; return NULL; }
+ if ( !p->pgpKeyID && !p->pgpKey ) { ptr->error = ERROR_NO_PGP_KEY; return NULL; }
// utf8 message: encrypt.
return pgp_encrypt(ptr, szPlainMsg);
@@ -254,13 +254,13 @@ LPSTR __cdecl pgp_encode(HANDLE context, LPCSTR szPlainMsg)
LPSTR __cdecl pgp_decode(HANDLE context, LPCSTR szEncMsg)
{
pCNTX ptr = get_context_on_id(context);
- if(!ptr) return NULL;
+ if (!ptr) return NULL;
LPSTR szNewMsg = NULL;
LPSTR szOldMsg = pgp_decrypt(ptr, szEncMsg);
if(szOldMsg) {
- if( !is_7bit_string(szOldMsg) && !is_utf8_string(szOldMsg) ) {
+ if ( !is_7bit_string(szOldMsg) && !is_utf8_string(szOldMsg) ) {
int slen = strlen(szOldMsg)+1;
LPWSTR wszMsg = (LPWSTR) alloca(slen*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, szOldMsg, -1, wszMsg, slen*sizeof(WCHAR));
@@ -284,11 +284,11 @@ int __cdecl pgp_set_priv_key(LPCSTR LocalKey)
int __cdecl pgp_set_key(HANDLE context, LPCSTR RemoteKey)
{
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pPGPDATA p = (pPGPDATA) cpp_alloc_pdata(ptr);
ptr->error = ERROR_NONE;
-// if(!p_pgp_check_key(RemoteKey)) return 0;
+// if (!p_pgp_check_key(RemoteKey)) return 0;
SAFE_FREE(p->pgpKey);
p->pgpKey = (PBYTE) strdup(RemoteKey);
@@ -299,7 +299,7 @@ int __cdecl pgp_set_key(HANDLE context, LPCSTR RemoteKey)
int __cdecl pgp_set_keyid(HANDLE context, PVOID RemoteKeyID)
{
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pPGPDATA p = (pPGPDATA) cpp_alloc_pdata(ptr);
ptr->error = ERROR_NONE;
diff --git a/plugins/CryptoPP/cpp_rsam.cpp b/plugins/CryptoPP/cpp_rsam.cpp
index 2cdd77b6e1..a40c11f4b6 100644
--- a/plugins/CryptoPP/cpp_rsam.cpp
+++ b/plugins/CryptoPP/cpp_rsam.cpp
@@ -53,7 +53,7 @@ int __cdecl rsa_init(pRSA_EXPORT* e, pRSA_IMPORT i) {
#endif
*e = &exp;
imp = i;
- if( !hRSA4096 ) {
+ if ( !hRSA4096 ) {
// create context for private rsa keys
hRSA4096 = (HANDLE) cpp_create_context(MODE_RSA_4096|MODE_PRIV_KEY);
pCNTX tmp = (pCNTX) hRSA4096;
@@ -77,7 +77,7 @@ int __cdecl rsa_done(void) {
pRSAPRIV rsa_gen_keys(HANDLE context) {
- if( context!=hRSA4096 ) return 0;
+ if ( context!=hRSA4096 ) return 0;
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_gen_keys: %d", context);
@@ -117,7 +117,7 @@ int __cdecl rsa_gen_keypair(short mode) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_gen_keypair: %d", mode);
#endif
- if( mode&MODE_RSA_4096 ) rsa_gen_keys(hRSA4096); // 4096
+ if ( mode&MODE_RSA_4096 ) rsa_gen_keys(hRSA4096); // 4096
return 1;
}
@@ -130,8 +130,8 @@ int __cdecl rsa_get_keypair(short mode, PBYTE privKey, int* privKeyLen, PBYTE pu
pCNTX ptr = get_context_on_id(hRSA4096);
pRSAPRIV r = (pRSAPRIV) ptr->pdata;
- *privKeyLen = r->priv_k.length(); if( privKey ) r->priv_k.copy((char*)privKey, *privKeyLen);
- *pubKeyLen = r->pub_k.length(); if( pubKey ) r->pub_k.copy((char*)pubKey, *pubKeyLen);
+ *privKeyLen = r->priv_k.length(); if ( privKey ) r->priv_k.copy((char*)privKey, *privKeyLen);
+ *pubKeyLen = r->pub_k.length(); if ( pubKey ) r->pub_k.copy((char*)pubKey, *pubKeyLen);
return 1;
}
@@ -144,8 +144,8 @@ int __cdecl rsa_get_keyhash(short mode, PBYTE privKey, int* privKeyLen, PBYTE pu
pCNTX ptr = get_context_on_id(hRSA4096);
pRSAPRIV r = (pRSAPRIV) ptr->pdata;
- if( privKey ) { *privKeyLen = r->priv_s.length(); r->priv_s.copy((char*)privKey, *privKeyLen); }
- if( pubKey ) { *pubKeyLen = r->pub_s.length(); r->pub_s.copy((char*)pubKey, *pubKeyLen); }
+ if ( privKey ) { *privKeyLen = r->priv_s.length(); r->priv_s.copy((char*)privKey, *privKeyLen); }
+ if ( pubKey ) { *pubKeyLen = r->pub_s.length(); r->pub_s.copy((char*)pubKey, *pubKeyLen); }
return 1;
}
@@ -158,11 +158,11 @@ int __cdecl rsa_set_keypair(short mode, PBYTE privKey, int privKeyLen) {
pCNTX ptr = get_context_on_id(hRSA4096);
pRSAPRIV r = (pRSAPRIV) ptr->pdata;
- if( privKey && privKeyLen ) {
+ if ( privKey && privKeyLen ) {
string priv;
priv.assign((char*)privKey, privKeyLen);
- if( mode & MODE_RSA_BER ) {
+ if ( mode & MODE_RSA_BER ) {
// old BER format
StringStore s(priv);
r->priv.BERDecode(s);
@@ -190,10 +190,10 @@ int __cdecl rsa_get_pubkey(HANDLE context, PBYTE pubKey, int* pubKeyLen) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_get_pubkey: %s", pubKey);
#endif
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pRSADATA p = (pRSADATA) cpp_alloc_pdata(ptr);
- *pubKeyLen = p->pub_k.length(); if( pubKey ) p->pub_k.copy((char*)pubKey, *pubKeyLen);
+ *pubKeyLen = p->pub_k.length(); if ( pubKey ) p->pub_k.copy((char*)pubKey, *pubKeyLen);
return 1;
}
@@ -203,10 +203,10 @@ int __cdecl rsa_set_pubkey(HANDLE context, PBYTE pubKey, int pubKeyLen) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_set_pubkey: %s", pubKey);
#endif
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pRSADATA p = (pRSADATA) cpp_alloc_pdata(ptr);
- if( pubKey && pubKeyLen ) {
+ if ( pubKey && pubKeyLen ) {
string pub;
pub.assign((char*)pubKey, pubKeyLen);
init_pub(p,pub);
@@ -226,7 +226,7 @@ void __cdecl rsa_set_timeout(int t) {
int __cdecl rsa_get_state(HANDLE context) {
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pRSADATA p = (pRSADATA) cpp_alloc_pdata(ptr);
return p->state;
@@ -241,7 +241,7 @@ int __cdecl rsa_get_hash(PBYTE pubKey, int pubKeyLen, PBYTE pubHash, int* pubHas
sig = hash(pubKey, pubKeyLen);
*pubHashLen = sig.length();
- if( pubHash ) sig.copy((char*)pubHash, *pubHashLen);
+ if ( pubHash ) sig.copy((char*)pubHash, *pubHashLen);
return 1;
}
@@ -251,7 +251,7 @@ int __cdecl rsa_connect(HANDLE context) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_connect: %08x", context);
#endif
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pRSADATA p = (pRSADATA) cpp_alloc_pdata(ptr); if(p->state) return p->state;
pRSAPRIV r = rsa_get_priv(ptr);
@@ -273,11 +273,11 @@ int __cdecl rsa_disconnect(HANDLE context) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_disconnect: %08x", context);
#endif
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
rsa_free( ptr ); // óäàëèì òðýä è î÷åðåäü ñîîáùåíèé
pRSADATA p = (pRSADATA) cpp_alloc_pdata(ptr);
- if( !p->state ) return 1;
+ if ( !p->state ) return 1;
PBYTE buffer=(PBYTE) alloca(RAND_SIZE);
GlobalRNG().GenerateBlock(buffer,RAND_SIZE);
@@ -294,7 +294,7 @@ int __cdecl rsa_disabled(HANDLE context) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_disabled: %08x", context);
#endif
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
rsa_free( ptr ); // óäàëèì òðýä è î÷åðåäü ñîîáùåíèé
pRSADATA p = (pRSADATA) cpp_alloc_pdata(ptr);
@@ -310,24 +310,24 @@ LPSTR __cdecl rsa_recv(HANDLE context, LPCSTR msg) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_recv: %s", msg);
#endif
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pRSADATA p = (pRSADATA) cpp_alloc_pdata(ptr);
pRSAPRIV r = rsa_get_priv(ptr);
rtrim(msg);
string buf = base64decode(msg);
- if( !buf.length() ) return 0;
+ if ( !buf.length() ) return 0;
string data; int type;
un_tlv(buf,type,data);
- if( type==-1 ) return 0;
+ if ( type==-1 ) return 0;
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_recv: %02x %d", type, p->state);
#endif
- if( type>0x10 && type<0xE0 ) // ïðîâåðèì òèï ñîîáùåíèÿ (êîãäà ñîåäèíåíèå åùå íå óñòàíîâëåíî)
- if( p->state==0 || p->state!=(type>>4) ) { // íåâåðíîå ñîñòîÿíèå
+ if ( type>0x10 && type<0xE0 ) // ïðîâåðèì òèï ñîîáùåíèÿ (êîãäà ñîåäèíåíèå åùå íå óñòàíîâëåíî)
+ if ( p->state==0 || p->state!=(type>>4) ) { // íåâåðíîå ñîñòîÿíèå
// øëåì ïåðåðûâàíèå ñåññèè
p->state=0; p->time=0;
rsa_free( ptr ); // óäàëèì òðýä è î÷åðåäü ñîîáùåíèé
@@ -340,7 +340,7 @@ LPSTR __cdecl rsa_recv(HANDLE context, LPCSTR msg) {
case 0x00: // ïðåðûâàíèå ñåññèè ïî îøèáêå äðóãîé ñòîðîíîé
{
// åñëè ñîåäèíåíèå óñòàíîâëåíî - íè÷åãî íå äåëàåì
- if( p->state == 0 || p->state == 7 ) return 0;
+ if ( p->state == 0 || p->state == 7 ) return 0;
// èíà÷å ñáðàñûâàåì òåêóùåå ñîñòîÿíèå
p->state=0; p->time=0;
imp->rsa_notify(context,-2); // ñåññèÿ ðàçîðâàíà ïî îøèáêå äðóãîé ñòîðîíîé
@@ -359,7 +359,7 @@ LPSTR __cdecl rsa_recv(HANDLE context, LPCSTR msg) {
case 0x0D: // çàïðîñ ïàáëèêà
case 0xD0: // îòâåò ïàáëèêîì
{
- if( !p->event ) {
+ if ( !p->event ) {
p->event = CreateEvent(NULL,FALSE,FALSE,NULL);
unsigned int tID;
p->thread = (HANDLE) _beginthreadex(NULL, 0, sttConnectThread, (PVOID)context, 0, &tID);
@@ -376,7 +376,7 @@ LPSTR __cdecl rsa_recv(HANDLE context, LPCSTR msg) {
case 0x50: // ïîëó÷èëè êðèïòîòåñò, îòïðàâëÿåì ñâîé êðèïòîòåñò
{
string msg = decode_msg(p,data);
- if( !msg.length() ) {
+ if ( !msg.length() ) {
p->state=0; p->time=0;
null_msg(context,0x00,-type); // ñåññèÿ ðàçîðâàíà ïî îøèáêå
return 0;
@@ -392,7 +392,7 @@ LPSTR __cdecl rsa_recv(HANDLE context, LPCSTR msg) {
case 0x60: // ïîëó÷èëè êðèïòîòåñò, ñåññèÿ óñòàíîâëåíà
{
string msg = decode_msg(p,data);
- if( !msg.length() ) {
+ if ( !msg.length() ) {
p->state=0; p->time=0;
null_msg(context,0x00,-type); // ñåññèÿ ðàçîðâàíà ïî îøèáêå
return 0;
@@ -406,7 +406,7 @@ LPSTR __cdecl rsa_recv(HANDLE context, LPCSTR msg) {
{
SAFE_FREE(ptr->tmp);
string msg = decode_msg(p,data);
- if( msg.length() ) {
+ if ( msg.length() ) {
ptr->tmp = (LPSTR) strdup(msg.c_str());
}
else {
@@ -419,7 +419,7 @@ LPSTR __cdecl rsa_recv(HANDLE context, LPCSTR msg) {
{
SAFE_FREE(ptr->tmp);
string msg = decode_rsa(p,r,data);
- if( msg.length() ) {
+ if ( msg.length() ) {
ptr->tmp = (LPSTR) strdup(msg.c_str());
}
else {
@@ -430,9 +430,9 @@ LPSTR __cdecl rsa_recv(HANDLE context, LPCSTR msg) {
case 0xF0: // ðàçðûâ ñîåäèíåíèÿ âðó÷íóþ
{
- if( p->state != 7 ) return 0;
+ if ( p->state != 7 ) return 0;
string msg = decode_msg(p,data);
- if( !msg.length() ) return 0;
+ if ( !msg.length() ) return 0;
p->state=0;
rsa_free( ptr ); // óäàëèì òðýä è î÷åðåäü ñîîáùåíèé
imp->rsa_notify(context,-4); // ñîåäèíåíèå ðàçîðâàíî âðó÷íóþ äðóãîé ñòîðîíîé
@@ -447,7 +447,7 @@ LPSTR __cdecl rsa_recv(HANDLE context, LPCSTR msg) {
}
- if( p->state != 0 && p->state != 7 )
+ if ( p->state != 0 && p->state != 7 )
p->time = gettime() + timeout;
return 0;
@@ -455,14 +455,14 @@ LPSTR __cdecl rsa_recv(HANDLE context, LPCSTR msg) {
int __cdecl rsa_send(HANDLE context, LPCSTR msg) {
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pRSADATA p = (pRSADATA) cpp_alloc_pdata(ptr); if(p->state!=0 && p->state!=7) return 0;
- if( p->state == 7 ) // ñåññèÿ óñòàíîâëåíà, øèôðóåì AES è îòïðàâëÿåì
+ if ( p->state == 7 ) // ñåññèÿ óñòàíîâëåíà, øèôðóåì AES è îòïðàâëÿåì
inject_msg(context,0x70,encode_msg(1,p,string(msg)));
else
- if( p->state == 0 ) { // ñåññèÿ óñòàíîâëåíà, îòïðàâëÿåì RSA ñîîáùåíèå
- if( !p->pub_k.length() ) return 0;
+ if ( p->state == 0 ) { // ñåññèÿ óñòàíîâëåíà, îòïðàâëÿåì RSA ñîîáùåíèå
+ if ( !p->pub_k.length() ) return 0;
// åñòü ïàáëèê êëþ÷ - îòïðàâèì ñîîáùåíèå
pRSAPRIV r = rsa_get_priv(ptr);
inject_msg(context,0xE0,encode_rsa(1,p,r,string(msg)));
@@ -517,7 +517,7 @@ string decode_msg(pRSADATA p, string& msg) {
cbcDecryptor.Put((PBYTE)ciphered.data(),ciphered.length());
cbcDecryptor.MessageEnd();
- if( sig == hash(zlib) ) {
+ if ( sig == hash(zlib) ) {
unciphered = (t1==1) ? cpp_zlibd(zlib) : zlib;
}
}
@@ -551,7 +551,7 @@ string decode_rsa(pRSADATA p, pRSAPRIV r, string& msg) {
string unciphered,zlib;
zlib = RSADecryptString(r->priv,ciphered);
- if( zlib.length() && RSAVerifyString(p->pub,zlib,sig) ) {
+ if ( zlib.length() && RSAVerifyString(p->pub,zlib,sig) ) {
unciphered = (t1==1) ? cpp_zlibd(zlib) : zlib;
}
return unciphered;
@@ -598,7 +598,7 @@ void init_priv(pRSAPRIV r, string& priv) {
}
}
- // if( !empty );
+ // if ( !empty );
r->pub_k = tlv(1,n)+tlv(2,e);
r->pub_s = hash(r->pub_k);
@@ -625,7 +625,7 @@ void init_pub(pRSADATA p, string& pub) {
}
}
- // if( !empty );
+ // if ( !empty );
p->pub.Initialize(BinaryToInteger(n),BinaryToInteger(e));
}
@@ -652,7 +652,7 @@ void rsa_timeout(HANDLE context, pRSADATA p) {
int __cdecl rsa_encrypt_file(HANDLE context,LPCSTR file_in,LPCSTR file_out) {
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pRSADATA p = (pRSADATA) cpp_alloc_pdata(ptr); if(p->state!=7) return 0;
try {
@@ -669,7 +669,7 @@ int __cdecl rsa_encrypt_file(HANDLE context,LPCSTR file_in,LPCSTR file_out) {
int __cdecl rsa_decrypt_file(HANDLE context,LPCSTR file_in,LPCSTR file_out) {
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pRSADATA p = (pRSADATA) cpp_alloc_pdata(ptr); if(p->state!=7) return 0;
try {
@@ -689,13 +689,13 @@ int __cdecl rsa_recv_thread(HANDLE context, string& msg) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_recv_thread: %s", msg.c_str());
#endif
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pRSADATA p = (pRSADATA) cpp_alloc_pdata(ptr);
pRSAPRIV r = rsa_get_priv(ptr);
string data; int type;
un_tlv(msg,type,data);
- if( type==-1 ) return 0;
+ if ( type==-1 ) return 0;
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_recv_thread: %02x %d", type, p->state);
@@ -709,7 +709,7 @@ int __cdecl rsa_recv_thread(HANDLE context, string& msg) {
int features; string sha1,sha2;
un_tlv(un_tlv(un_tlv(data,t[0],features),t[1],sha1),t[2],sha2);
BOOL lr = (p->pub_s==sha1); BOOL ll = (r->pub_s==sha2);
- switch( (lr<<4)|ll ){
+ switch( (lr<<4)|ll ) {
case 0x11: { // îáà ïàáëèêà ñîâïàëè
inject_msg(context,0x21,gen_aes_key_iv(ptr->mode,p,r));
p->state=5;
@@ -734,13 +734,13 @@ int __cdecl rsa_recv_thread(HANDLE context, string& msg) {
int features; string pub;
un_tlv(un_tlv(data,t[0],features),t[1],pub);
string sig = hash(pub);
- if( !imp->rsa_check_pub(context,(PBYTE)pub.data(),pub.length(),(PBYTE)sig.data(),sig.length()) ) {
+ if ( !imp->rsa_check_pub(context,(PBYTE)pub.data(),pub.length(),(PBYTE)sig.data(),sig.length()) ) {
p->state=0; p->time=0;
null_msg(context,0x00,-type); // ñåññèÿ ðàçîðâàíà ïî îøèáêå
return 0;
}
init_pub(p,pub);
- if( p->state==0 ) { // timeout
+ if ( p->state==0 ) { // timeout
// rsa_connect(context);
return -1;
}
@@ -761,13 +761,13 @@ int __cdecl rsa_recv_thread(HANDLE context, string& msg) {
int features; string pub;
un_tlv(un_tlv(data,t[0],features),t[1],pub);
string sig = hash(pub);
- if( !imp->rsa_check_pub(context,(PBYTE)pub.data(),pub.length(),(PBYTE)sig.data(),sig.length()) ) {
+ if ( !imp->rsa_check_pub(context,(PBYTE)pub.data(),pub.length(),(PBYTE)sig.data(),sig.length()) ) {
p->state=0; p->time=0;
null_msg(context,0x00,-type); // ñåññèÿ ðàçîðâàíà ïî îøèáêå
return 0;
}
init_pub(p,pub);
- if( p->state==0 ) { // timeout
+ if ( p->state==0 ) { // timeout
// rsa_connect(context);
return -1;
}
@@ -781,13 +781,13 @@ int __cdecl rsa_recv_thread(HANDLE context, string& msg) {
string pub;
un_tlv(data,t[0],pub);
string sig = hash(pub);
- if( !imp->rsa_check_pub(context,(PBYTE)pub.data(),pub.length(),(PBYTE)sig.data(),sig.length()) ) {
+ if ( !imp->rsa_check_pub(context,(PBYTE)pub.data(),pub.length(),(PBYTE)sig.data(),sig.length()) ) {
p->state=0; p->time=0;
null_msg(context,0x00,-type); // ñåññèÿ ðàçîðâàíà ïî îøèáêå
return 0;
}
init_pub(p,pub);
- if( p->state==0 ) { // timeout
+ if ( p->state==0 ) { // timeout
// rsa_connect(context);
return -1;
}
@@ -800,7 +800,7 @@ int __cdecl rsa_recv_thread(HANDLE context, string& msg) {
case 0x40:
{
string key = decode_rsa(p,r,data);
- if( !key.length() ) {
+ if ( !key.length() ) {
p->state=0; p->time=0;
null_msg(context,0x00,-type); // ñåññèÿ ðàçîðâàíà ïî îøèáêå
return 0;
@@ -818,16 +818,16 @@ int __cdecl rsa_recv_thread(HANDLE context, string& msg) {
{
int features; string pub,sha;
un_tlv(un_tlv(un_tlv(data,t[0],features),t[1],pub),t[2],sha);
- if( p->pub_k!=pub ) { // ïðèøåë íîâûé ïàáëèê
+ if ( p->pub_k!=pub ) { // ïðèøåë íîâûé ïàáëèê
string sig = hash(pub);
- if( !imp->rsa_check_pub(context,(PBYTE)pub.data(),pub.length(),(PBYTE)sig.data(),sig.length()) ) {
+ if ( !imp->rsa_check_pub(context,(PBYTE)pub.data(),pub.length(),(PBYTE)sig.data(),sig.length()) ) {
p->state=0; p->time=0;
null_msg(context,0x00,-type); // ñåññèÿ ðàçîðâàíà ïî îøèáêå
return 0;
}
init_pub(p,pub);
}
- if( type == 0x0D ) { // íóæíî îòïðàâèòü ìîé ïàáëèê
+ if ( type == 0x0D ) { // íóæíî îòïðàâèòü ìîé ïàáëèê
inject_msg(context,0xD0,tlv(0,features)+tlv(1,r->pub_k)+tlv(2,p->pub_s));
}
p->state=0; p->time=0;
@@ -835,7 +835,7 @@ int __cdecl rsa_recv_thread(HANDLE context, string& msg) {
}
- if( p->state != 0 && p->state != 7 )
+ if ( p->state != 0 && p->state != 7 )
p->time = gettime() + timeout;
return 1;
@@ -855,7 +855,7 @@ void rsa_alloc( pCNTX ptr ) {
void rsa_free( pCNTX ptr ) {
pRSADATA p = (pRSADATA) ptr->pdata;
- if( p && p->event ) {
+ if ( p && p->event ) {
p->thread_exit = 2; // îòïóñêàåì ïîòîê â ñâîáîäíîå ïëàâàíèå
SetEvent( p->event );
rsa_alloc(ptr);
@@ -864,7 +864,7 @@ void rsa_free( pCNTX ptr ) {
void rsa_free_thread( pRSADATA p ) {
- if( p->event ) {
+ if ( p->event ) {
p->thread_exit = 1;
SetEvent( p->event );
// æäåì çàâåðøåíèÿ ïîòîêà
@@ -893,7 +893,7 @@ unsigned __stdcall sttConnectThread( LPVOID arg ) {
HANDLE context = (HANDLE) arg;
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pRSADATA p = (pRSADATA) cpp_alloc_pdata(ptr);
while(1) {
@@ -901,8 +901,8 @@ unsigned __stdcall sttConnectThread( LPVOID arg ) {
Sent_NetLog("sttConnectThread: WaitForSingleObject");
#endif
WaitForSingleObject(p->event, INFINITE); // dwMsec rc==WAIT_TIMEOUT
- if( p->thread_exit == 1 ) return 0;
- if( p->thread_exit == 2 ) {
+ if ( p->thread_exit == 1 ) return 0;
+ if ( p->thread_exit == 2 ) {
// ìû â ñâîáîäíîì ïëàâàíèè - îñâîáîäèì ïàìÿòü è çàâåðøèì òðýä
CloseHandle( p->thread );
CloseHandle( p->event );
@@ -913,7 +913,7 @@ unsigned __stdcall sttConnectThread( LPVOID arg ) {
// äîæäàëèñü ñîîáùåíèÿ â î÷åðåäè
while( !p->thread_exit && p->queue && !p->queue->empty() ) {
// îáðàáîòàåì ñîîáùåíèÿ èç î÷åðåäè
- if( rsa_recv_thread(context, p->queue->front()) == -1 ) {
+ if ( rsa_recv_thread(context, p->queue->front()) == -1 ) {
// î÷èñòèòü î÷åðåäü
clear_queue(p);
break;
@@ -933,14 +933,14 @@ int __cdecl rsa_export_keypair(short mode, LPSTR privKey, LPSTR pubKey, LPSTR pa
pCNTX ptr = get_context_on_id(hRSA4096);
pRSAPRIV r = (pRSAPRIV) ptr->pdata;
- if( pubKey ) {
+ if ( pubKey ) {
string pub;
pub = tlv(3,r->pub_k) + tlv(4,r->pub_s);
pub = pub_beg + crlf + add_delim(base64encode(pub),crlf,65) + pub_end + crlf;
strcpy(pubKey, pub.c_str());
}
- if( privKey && passPhrase ) {
+ if ( privKey && passPhrase ) {
string key = hash256(passPhrase);
string iv = hash256(key);
string priv = pad256(r->priv_k);
@@ -976,7 +976,7 @@ int __cdecl rsa_import_keypair(short mode, LPSTR privKey, LPSTR passPhrase) {
pCNTX ptr = get_context_on_id(hRSA4096);
pRSAPRIV r = (pRSAPRIV) ptr->pdata;
- if( !passPhrase ) return 0;
+ if ( !passPhrase ) return 0;
string priv;
u_int found;
@@ -985,13 +985,13 @@ int __cdecl rsa_import_keypair(short mode, LPSTR privKey, LPSTR passPhrase) {
del_delim(priv,crlf);
found = priv.find(priv_beg);
- if( found != string::npos ) {
+ if ( found != string::npos ) {
priv = priv.substr(found+priv_beg.length());
found = priv.find(priv_end);
- if( found != string::npos ) {
+ if ( found != string::npos ) {
priv = base64decode(priv.substr(0,found));
TLV k(priv);
- if( k.exist(1) && k.exist(2) && hash(k.get(1)) == k.get(2) ) {
+ if ( k.exist(1) && k.exist(2) && hash(k.get(1)) == k.get(2) ) {
priv = k.get(1);
string key = hash256(passPhrase);
@@ -1025,10 +1025,10 @@ int __cdecl rsa_export_pubkey(HANDLE context, LPSTR pubKey) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_export_pubkey: %08x", context);
#endif
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pRSADATA p = (pRSADATA) cpp_alloc_pdata(ptr);
- if( !p->pub_k.length() || !pubKey ) return 0;
+ if ( !p->pub_k.length() || !pubKey ) return 0;
string pub;
pub = tlv(3,p->pub_k) + tlv(4,p->pub_s);
@@ -1043,10 +1043,10 @@ int __cdecl rsa_import_pubkey(HANDLE context, LPSTR pubKey) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_import_pubkey: %08x", context);
#endif
- pCNTX ptr = get_context_on_id(context); if(!ptr) return 0;
+ pCNTX ptr = get_context_on_id(context); if (!ptr) return 0;
pRSADATA p = (pRSADATA) cpp_alloc_pdata(ptr);
- if( !pubKey ) return 0;
+ if ( !pubKey ) return 0;
string pub;
u_int found;
@@ -1055,13 +1055,13 @@ int __cdecl rsa_import_pubkey(HANDLE context, LPSTR pubKey) {
del_delim(pub,crlf);
found = pub.find(pub_beg);
- if( found != string::npos ) {
+ if ( found != string::npos ) {
pub = pub.substr(found+pub_beg.length());
found = pub.find(pub_end);
- if( found != string::npos ) {
+ if ( found != string::npos ) {
pub = base64decode(pub.substr(0,found));
TLV k(pub);
- if( k.exist(3) && k.exist(4) && hash(k.get(3)) == k.get(4) ) {
+ if ( k.exist(3) && k.exist(4) && hash(k.get(3)) == k.get(4) ) {
init_pub(p,k.get(3));
return 1;
}
diff --git a/plugins/CryptoPP/cpp_rsau.cpp b/plugins/CryptoPP/cpp_rsau.cpp
index 6644e715fa..be8e499ed1 100644
--- a/plugins/CryptoPP/cpp_rsau.cpp
+++ b/plugins/CryptoPP/cpp_rsau.cpp
@@ -6,14 +6,14 @@ const string padding = "PADDING!PADDING!PADDING!PADDING!"; // 256 bit
string pad256(string& str) {
string out = str;
int pad = out.length() % 32;
- if( pad ) { // ­ ¤® ¢ë஢­ïâì ­  256 ¡¨â
- if( pad>3 ) {
+ if ( pad ) { // ­ ¤® ¢ë஢­ïâì ­  256 ¡¨â
+ if ( pad>3 ) {
out += tlv(0,padding.substr(0,32-3-pad));
}
else {
- if( pad==3 ) out += string("\0\0\0");
+ if ( pad==3 ) out += string("\0\0\0");
else
- if( pad==2 ) out += string("\0\0");
+ if ( pad==2 ) out += string("\0\0");
else out += string("\0");
}
}
@@ -23,7 +23,7 @@ string pad256(string& str) {
string& add_delim(string& str, const string& del, int len) {
string val;
- for( u_int i=0; i<str.length(); i+=len ) {
+ for ( u_int i=0; i<str.length(); i+=len ) {
val += str.substr(i,len) + del;
}
str = val;
@@ -33,8 +33,8 @@ string& add_delim(string& str, const string& del, int len) {
string& del_delim(string& str, const string& del) {
string val;
- for( u_int i=0; i<str.length(); i++ ) {
- if( del.find(str[i]) == string::npos )
+ for ( u_int i=0; i<str.length(); i++ ) {
+ if ( del.find(str[i]) == string::npos )
val += str[i];
}
str = val;
@@ -66,17 +66,17 @@ string tlv(int t, int v) {
string& un_tlv(string& b, int& t, string& v) {
string r; v = r;
- if( b.length() > 3 ) {
+ if ( b.length() > 3 ) {
t = 0;
b.copy((char*)&t,3);
u_int l = t>>8;
t &= 0xFF;
- if( b.length() >= 3+l ) {
+ if ( b.length() >= 3+l ) {
v = b.substr(3,l);
r = b.substr(3+l);
}
}
- if( !v.length() ) {
+ if ( !v.length() ) {
t = -1;
}
b = r;
@@ -95,7 +95,7 @@ string& un_tlv(string& b, int& t, int& v) {
int str2int(string& s) {
int v = 0;
- if( s.length()<=sizeof(int) )
+ if ( s.length()<=sizeof(int) )
s.copy((char*)&v,s.length());
return v;
}
diff --git a/plugins/CryptoPP/cpp_rsau.h b/plugins/CryptoPP/cpp_rsau.h
index adb017c18b..ae41e64def 100644
--- a/plugins/CryptoPP/cpp_rsau.h
+++ b/plugins/CryptoPP/cpp_rsau.h
@@ -12,7 +12,7 @@ public:
string encode() {
map<u_char,string>::const_iterator i;
string b;
- for( i=data.begin(); i!=data.end(); ++i ) {
+ for ( i=data.begin(); i!=data.end(); ++i ) {
b += tlv(i->first,i->second);
}
return b;
@@ -23,7 +23,7 @@ public:
string r = b;
while( r.length() ) {
t = un_tlv(r,v);
- if( t==-1 ) {
+ if ( t==-1 ) {
break;
}
data[t] = v;
@@ -46,16 +46,16 @@ private:
u_char un_tlv(string& b, string& v) {
string r; v = r;
u_int t = 0;
- if( b.length() > 3 ) {
+ if ( b.length() > 3 ) {
b.copy((char*)&t,3);
u_int l = t>>8;
t &= 0xFF;
- if( b.length() >= 3+l ) {
+ if ( b.length() >= 3+l ) {
v = b.substr(3,l);
r = b.substr(3+l);
}
}
- if( !v.length() ) {
+ if ( !v.length() ) {
return -1;
}
b = r;
diff --git a/plugins/CryptoPP/cpp_svcs.cpp b/plugins/CryptoPP/cpp_svcs.cpp
index 50a3ee1a54..e03800648d 100644
--- a/plugins/CryptoPP/cpp_svcs.cpp
+++ b/plugins/CryptoPP/cpp_svcs.cpp
@@ -159,9 +159,9 @@ LPSTR __cdecl cpp_decrypt(pCNTX ptr, LPCSTR szEncMsg) {
LPSTR __cdecl cpp_encodeA(HANDLE context, LPCSTR msg) {
pCNTX ptr = get_context_on_id(context);
- if(!ptr) return NULL;
+ if (!ptr) return NULL;
cpp_alloc_pdata(ptr); pSIMDATA p = (pSIMDATA) ptr->pdata;
- if(!p->KeyX) { ptr->error = ERROR_NO_KEYX; return NULL; }
+ if (!p->KeyX) { ptr->error = ERROR_NO_KEYX; return NULL; }
LPSTR szNewMsg = NULL;
LPSTR szOldMsg = (LPSTR) msg;
@@ -187,9 +187,9 @@ LPSTR __cdecl cpp_encodeA(HANDLE context, LPCSTR msg) {
LPSTR __cdecl cpp_encodeU(HANDLE context, LPCSTR msg) {
pCNTX ptr = get_context_on_id(context);
- if(!ptr) return NULL;
+ if (!ptr) return NULL;
cpp_alloc_pdata(ptr); pSIMDATA p = (pSIMDATA) ptr->pdata;
- if(!p->KeyX) { ptr->error = ERROR_NO_KEYX; return NULL; }
+ if (!p->KeyX) { ptr->error = ERROR_NO_KEYX; return NULL; }
LPSTR szNewMsg = NULL;
LPSTR szOldMsg = (LPSTR) msg;
@@ -215,9 +215,9 @@ LPSTR __cdecl cpp_encodeU(HANDLE context, LPCSTR msg) {
LPSTR __cdecl cpp_encodeW(HANDLE context, LPWSTR msg) {
pCNTX ptr = get_context_on_id(context);
- if(!ptr) return NULL;
+ if (!ptr) return NULL;
cpp_alloc_pdata(ptr); pSIMDATA p = (pSIMDATA) ptr->pdata;
- if(!p->KeyX) { ptr->error = ERROR_NO_KEYX; return NULL; }
+ if (!p->KeyX) { ptr->error = ERROR_NO_KEYX; return NULL; }
LPSTR szNewMsg = NULL;
LPSTR szOldMsg = (LPSTR) msg;
@@ -242,9 +242,9 @@ LPSTR __cdecl cpp_encodeW(HANDLE context, LPWSTR msg) {
LPSTR __cdecl cpp_decode(HANDLE context, LPCSTR szEncMsg) {
pCNTX ptr = get_context_on_id(context);
- if(!ptr) return NULL;
+ if (!ptr) return NULL;
cpp_alloc_pdata(ptr); pSIMDATA p = (pSIMDATA) ptr->pdata;
- if(!p->KeyX) { ptr->error = ERROR_NO_KEYX; return NULL; }
+ if (!p->KeyX) { ptr->error = ERROR_NO_KEYX; return NULL; }
LPSTR szNewMsg = NULL;
LPSTR szOldMsg = cpp_decrypt(ptr, szEncMsg);
@@ -278,9 +278,9 @@ LPSTR __cdecl cpp_decode(HANDLE context, LPCSTR szEncMsg) {
LPSTR __cdecl cpp_decodeU(HANDLE context, LPCSTR szEncMsg) {
pCNTX ptr = get_context_on_id(context);
- if(!ptr) return NULL;
+ if (!ptr) return NULL;
cpp_alloc_pdata(ptr); pSIMDATA p = (pSIMDATA) ptr->pdata;
- if(!p->KeyX) { ptr->error = ERROR_NO_KEYX; return NULL; }
+ if (!p->KeyX) { ptr->error = ERROR_NO_KEYX; return NULL; }
LPSTR szNewMsg = NULL;
LPSTR szOldMsg = cpp_decrypt(ptr, szEncMsg);
@@ -307,9 +307,9 @@ LPSTR __cdecl cpp_decodeU(HANDLE context, LPCSTR szEncMsg) {
int __cdecl cpp_encrypt_file(HANDLE context,LPCSTR file_in,LPCSTR file_out) {
pCNTX ptr = get_context_on_id(context);
- if(!ptr) return 0;
+ if (!ptr) return 0;
cpp_alloc_pdata(ptr); pSIMDATA p = (pSIMDATA) ptr->pdata;
- if(!p->KeyX) return 0;
+ if (!p->KeyX) return 0;
try{
CBC_Mode<AES>::Encryption enc(p->KeyX,Tiger::DIGESTSIZE,IV);
@@ -326,9 +326,9 @@ int __cdecl cpp_encrypt_file(HANDLE context,LPCSTR file_in,LPCSTR file_out) {
int __cdecl cpp_decrypt_file(HANDLE context,LPCSTR file_in,LPCSTR file_out) {
pCNTX ptr = get_context_on_id(context);
- if(!ptr) return 0;
+ if (!ptr) return 0;
cpp_alloc_pdata(ptr); pSIMDATA p = (pSIMDATA) ptr->pdata;
- if(!p->KeyX) return 0;
+ if (!p->KeyX) return 0;
try{
CBC_Mode<AES>::Decryption dec(p->KeyX,Tiger::DIGESTSIZE,IV);
diff --git a/plugins/CryptoPP/crypto/crc.cpp b/plugins/CryptoPP/crypto/crc.cpp
index 3a2cb4fee3..a27f891ba4 100644
--- a/plugins/CryptoPP/crypto/crc.cpp
+++ b/plugins/CryptoPP/crypto/crc.cpp
@@ -126,7 +126,7 @@ void CRC32::Update(const byte *s, size_t n)
{
word32 crc = m_crc;
- for(; !IsAligned<word32>(s) && n > 0; n--)
+ for (; !IsAligned<word32>(s) && n > 0; n--)
crc = m_tab[CRC32_INDEX(crc) ^ *s++] ^ CRC32_SHIFTED(crc);
while (n >= 4)
diff --git a/plugins/CryptoPP/crypto/des.cpp b/plugins/CryptoPP/crypto/des.cpp
index 5002f26588..69c4ba066d 100644
--- a/plugins/CryptoPP/crypto/des.cpp
+++ b/plugins/CryptoPP/crypto/des.cpp
@@ -292,9 +292,9 @@ void RawDES::RawSetKey(CipherDir dir, const byte *key)
for (j=0; j<56; j++) /* rotate pc1 the right amount */
pcr[j] = pc1m[(l=j+totrot[i])<(j<28? 28 : 56) ? l: l-28];
/* rotate left and right halves independently */
- for (j=0; j<48; j++){ /* select bits individually */
+ for (j=0; j<48; j++) { /* select bits individually */
/* check bit that goes to ks[j] */
- if (pcr[pc2[j]-1]){
+ if (pcr[pc2[j]-1]) {
/* mask it in if it's there */
l= j % 6;
ks[j/6] |= bytebit[l] >> 2;
diff --git a/plugins/CryptoPP/crypto/gzip.cpp b/plugins/CryptoPP/crypto/gzip.cpp
index c9f75584de..3a52529dc6 100644
--- a/plugins/CryptoPP/crypto/gzip.cpp
+++ b/plugins/CryptoPP/crypto/gzip.cpp
@@ -65,12 +65,12 @@ void Gunzip::ProcessPrestreamHeader()
if (flags & FILENAME) // skip filename
do
- if(!m_inQueue.Get(b)) throw HeaderErr();
+ if (!m_inQueue.Get(b)) throw HeaderErr();
while (b);
if (flags & COMMENTS) // skip comments
do
- if(!m_inQueue.Get(b)) throw HeaderErr();
+ if (!m_inQueue.Get(b)) throw HeaderErr();
while (b);
}
diff --git a/plugins/CryptoPP/crypto/mars.cpp b/plugins/CryptoPP/crypto/mars.cpp
index 74aad3a9b9..6e2fe9d94f 100644
--- a/plugins/CryptoPP/crypto/mars.cpp
+++ b/plugins/CryptoPP/crypto/mars.cpp
@@ -28,7 +28,7 @@ static word32 gen_mask(word32 x)
m = (~x ^ (x >> 1)) & 0x7fffffff;
m &= (m >> 1) & (m >> 2); m &= (m >> 3) & (m >> 6);
- if(!m)
+ if (!m)
return 0;
m <<= 1; m |= (m << 1); m |= (m << 2); m |= (m << 4);
diff --git a/plugins/CryptoPP/crypto/osrng.cpp b/plugins/CryptoPP/crypto/osrng.cpp
index 6ad488c56f..ff7f034de7 100644
--- a/plugins/CryptoPP/crypto/osrng.cpp
+++ b/plugins/CryptoPP/crypto/osrng.cpp
@@ -47,7 +47,7 @@ OS_RNG_Err::OS_RNG_Err(const std::string &operation)
MicrosoftCryptoProvider::MicrosoftCryptoProvider()
{
- if(!CryptAcquireContext(&m_hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
+ if (!CryptAcquireContext(&m_hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
throw OS_RNG_Err("CryptAcquireContext");
}
diff --git a/plugins/CryptoPP/main.cpp b/plugins/CryptoPP/main.cpp
index 69f30cc1ff..042086d4b3 100644
--- a/plugins/CryptoPP/main.cpp
+++ b/plugins/CryptoPP/main.cpp
@@ -5,7 +5,7 @@ int hLangpack;
// dllmain
BOOL WINAPI DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID) {
g_hInst = hInst;
- if( dwReason == DLL_PROCESS_ATTACH ) {
+ if ( dwReason == DLL_PROCESS_ATTACH ) {
{
char temp[MAX_PATH];
GetTempPath(sizeof(temp),temp);
diff --git a/plugins/Db3x/dbcache.c b/plugins/Db3x/dbcache.c
index 4cf338bfb9..9e8cbc7a76 100644
--- a/plugins/Db3x/dbcache.c
+++ b/plugins/Db3x/dbcache.c
@@ -186,7 +186,7 @@ static VOID CALLBACK DoBufferFlushTimerProc(HWND hwnd,UINT message,UINT_PTR idEv
void DBFlush(int setting)
{
- if(!setting) {
+ if (!setting) {
log0("nflush1");
if(safetyMode) FlushFileBuffers(hDbFile);
log0("nflush2");
diff --git a/plugins/Db3x/dbcontacts.c b/plugins/Db3x/dbcontacts.c
index eb5d13d52c..03f248457e 100644
--- a/plugins/Db3x/dbcontacts.c
+++ b/plugins/Db3x/dbcontacts.c
@@ -145,7 +145,7 @@ static INT_PTR DeleteContact(WPARAM wParam,LPARAM lParam)
struct DBEvent *dbe;
int index;
- if((HANDLE)wParam==NULL) return 1;
+ if ((HANDLE)wParam==NULL) return 1;
EnterCriticalSection(&csDbAccess);
dbc=(struct DBContact*)DBRead(wParam,sizeof(struct DBContact),NULL);
if(dbc->signature!=DBCONTACT_SIGNATURE) {
diff --git a/plugins/Db3x/dbevents.c b/plugins/Db3x/dbevents.c
index 39de07d187..aff845b76b 100644
--- a/plugins/Db3x/dbevents.c
+++ b/plugins/Db3x/dbevents.c
@@ -137,7 +137,7 @@ static INT_PTR AddEvent(WPARAM wParam,LPARAM lParam)
// Loop through the chain, starting at the end
ofsThis = dbc.ofsLastEvent;
dbeTest = (struct DBEvent*)DBRead(ofsThis, sizeof(struct DBEvent), NULL);
- for(;;) {
+ for (;;) {
// If the new event's timesstamp is equal to or greater than the
// current dbevent, it will be inserted after. If not, continue
// with the previous dbevent in chain.
@@ -161,7 +161,7 @@ static INT_PTR AddEvent(WPARAM wParam,LPARAM lParam)
}
}
dbc.eventCount++;
- if(!(dbe.flags&(DBEF_READ|DBEF_SENT))) {
+ if (!(dbe.flags&(DBEF_READ|DBEF_SENT))) {
if(dbe.timestamp<dbc.timestampFirstUnread || dbc.timestampFirstUnread==0) {
dbc.timestampFirstUnread=dbe.timestamp;
dbc.ofsFirstUnreadEvent=ofsNew;
@@ -203,7 +203,7 @@ static INT_PTR DeleteEvent(WPARAM wParam,LPARAM lParam)
//check if this was the first unread, if so, recalc the first unread
if(dbc.ofsFirstUnreadEvent==(DWORD)lParam) {
dbeNext=&dbe;
- for(;;) {
+ for (;;) {
if(dbeNext->ofsNext==0) {
dbc.ofsFirstUnreadEvent=0;
dbc.timestampFirstUnread=0;
@@ -211,7 +211,7 @@ static INT_PTR DeleteEvent(WPARAM wParam,LPARAM lParam)
}
ofsThis=dbeNext->ofsNext;
dbeNext=(struct DBEvent*)DBRead(ofsThis,sizeof(struct DBEvent),NULL);
- if(!(dbeNext->flags&(DBEF_READ|DBEF_SENT))) {
+ if (!(dbeNext->flags&(DBEF_READ|DBEF_SENT))) {
dbc.ofsFirstUnreadEvent=ofsThis;
dbc.timestampFirstUnread=dbeNext->timestamp;
break;
@@ -331,7 +331,7 @@ static INT_PTR MarkEventRead(WPARAM wParam,LPARAM lParam)
DBWrite(lParam,dbe,sizeof(struct DBEvent));
ret=(INT_PTR)dbe->flags;
if(dbc.ofsFirstUnreadEvent==(DWORD)lParam) {
- for(;;) {
+ for (;;) {
if(dbe->ofsNext==0) {
dbc.ofsFirstUnreadEvent=0;
dbc.timestampFirstUnread=0;
@@ -339,7 +339,7 @@ static INT_PTR MarkEventRead(WPARAM wParam,LPARAM lParam)
}
ofsThis=dbe->ofsNext;
dbe=(struct DBEvent*)DBRead(ofsThis,sizeof(struct DBEvent),NULL);
- if(!(dbe->flags&(DBEF_READ|DBEF_SENT))) {
+ if (!(dbe->flags&(DBEF_READ|DBEF_SENT))) {
dbc.ofsFirstUnreadEvent=ofsThis;
dbc.timestampFirstUnread=dbe->timestamp;
break;
diff --git a/plugins/Db3x/dbsettings.c b/plugins/Db3x/dbsettings.c
index 590eddc2e8..16bf2aa2bb 100644
--- a/plugins/Db3x/dbsettings.c
+++ b/plugins/Db3x/dbsettings.c
@@ -65,7 +65,7 @@ static DWORD GetSettingsGroupOfsByModuleNameOfs(struct DBContact *dbc,DWORD ofsC
settingsGroupOfsCache[nextSGOCacheEntry].ofsContact=ofsContact;
settingsGroupOfsCache[nextSGOCacheEntry].ofsModuleName=ofsModuleName;
settingsGroupOfsCache[nextSGOCacheEntry].ofsSettingsGroup=ofsThis;
- if(++nextSGOCacheEntry==SETTINGSGROUPOFSCOUNT) nextSGOCacheEntry=0;
+ if (++nextSGOCacheEntry==SETTINGSGROUPOFSCOUNT) nextSGOCacheEntry=0;
return ofsThis;
}
ofsThis=dbcs->ofsNext;
@@ -319,7 +319,7 @@ static __inline int GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING
NeedBytes(3+*(PWORD)(pBlob+1));
if(isStatic) {
dbcgs->pValue->cchVal--;
- if(*(PWORD)(pBlob+1)<dbcgs->pValue->cchVal) dbcgs->pValue->cchVal=*(PWORD)(pBlob+1);
+ if (*(PWORD)(pBlob+1)<dbcgs->pValue->cchVal) dbcgs->pValue->cchVal=*(PWORD)(pBlob+1);
CopyMemory(dbcgs->pValue->pszVal,pBlob+3,dbcgs->pValue->cchVal);
dbcgs->pValue->pszVal[dbcgs->pValue->cchVal]=0;
dbcgs->pValue->cchVal=*(PWORD)(pBlob+1);
@@ -333,7 +333,7 @@ static __inline int GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING
case DBVT_BLOB:
NeedBytes(3+*(PWORD)(pBlob+1));
if(isStatic) {
- if(*(PWORD)(pBlob+1)<dbcgs->pValue->cpbVal) dbcgs->pValue->cpbVal=*(PWORD)(pBlob+1);
+ if (*(PWORD)(pBlob+1)<dbcgs->pValue->cpbVal) dbcgs->pValue->cpbVal=*(PWORD)(pBlob+1);
CopyMemory(dbcgs->pValue->pbVal,pBlob+3,dbcgs->pValue->cpbVal);
}
else {
@@ -716,7 +716,7 @@ static INT_PTR WriteContactSetting(WPARAM wParam,LPARAM lParam)
else bytesRequired=tmp.value.type;
bytesRequired+=2+settingNameLen;
bytesRequired+=ofsBlobPtr+1-(ofsSettingsGroup+offsetof(struct DBContactSettings,blob));
- if((DWORD)bytesRequired>dbcs.cbBlob) {
+ if ((DWORD)bytesRequired>dbcs.cbBlob) {
//doesn't fit: move entire group
struct DBContactSettings *dbcsPrev;
DWORD ofsDbcsPrev,oldSize,ofsNew;
@@ -843,7 +843,7 @@ static INT_PTR DeleteContactSetting(WPARAM wParam,LPARAM lParam)
MoveAlong(1+GetSettingValueLength(pBlob));
NeedBytes(1);
}
- if(!pBlob[0]) { //setting didn't exist
+ if (!pBlob[0]) { //setting didn't exist
LeaveCriticalSection(&csDbAccess);
return 1;
}
@@ -906,7 +906,7 @@ static INT_PTR EnumContactSettings(WPARAM wParam,LPARAM lParam)
return -1;
}
dbces->ofsSettings=GetSettingsGroupOfsByModuleNameOfs(&dbc,ofsContact,ofsModuleName);
- if(!dbces->ofsSettings) {
+ if (!dbces->ofsSettings) {
LeaveCriticalSection(&csDbAccess);
return -1;
}
diff --git a/plugins/Db3x_mmap/dbcache.c b/plugins/Db3x_mmap/dbcache.c
index 8e177c6f6d..625d8aa775 100644
--- a/plugins/Db3x_mmap/dbcache.c
+++ b/plugins/Db3x_mmap/dbcache.c
@@ -144,7 +144,7 @@ static VOID CALLBACK DoBufferFlushTimerProc(HWND hwnd, UINT message, UINT_PTR id
void DBFlush(int setting)
{
- if(!setting) {
+ if (!setting) {
log0("nflush1");
if(safetyMode && pDbCache) {
if (FlushViewOfFile(pDbCache, 0) == 0) {
diff --git a/plugins/Db3x_mmap/dbcontacts.c b/plugins/Db3x_mmap/dbcontacts.c
index 0803f1f746..51e533266d 100644
--- a/plugins/Db3x_mmap/dbcontacts.c
+++ b/plugins/Db3x_mmap/dbcontacts.c
@@ -153,7 +153,7 @@ static INT_PTR DeleteContact(WPARAM wParam,LPARAM lParam)
struct DBEvent *dbe;
int index;
- if((HANDLE)wParam==NULL) return 1;
+ if ((HANDLE)wParam==NULL) return 1;
EnterCriticalSection(&csDbAccess);
dbc=(struct DBContact*)DBRead(wParam,sizeof(struct DBContact),NULL);
if(dbc->signature!=DBCONTACT_SIGNATURE) {
diff --git a/plugins/Db3x_mmap/dbevents.c b/plugins/Db3x_mmap/dbevents.c
index 24c568f02d..5576455daf 100644
--- a/plugins/Db3x_mmap/dbevents.c
+++ b/plugins/Db3x_mmap/dbevents.c
@@ -135,7 +135,7 @@ static INT_PTR AddEvent(WPARAM wParam,LPARAM lParam)
// Loop through the chain, starting at the end
ofsThis = dbc.ofsLastEvent;
dbeTest = (struct DBEvent*)DBRead(ofsThis, sizeof(struct DBEvent), NULL);
- for(;;) {
+ for (;;) {
// If the new event's timesstamp is equal to or greater than the
// current dbevent, it will be inserted after. If not, continue
// with the previous dbevent in chain.
@@ -159,7 +159,7 @@ static INT_PTR AddEvent(WPARAM wParam,LPARAM lParam)
}
}
dbc.eventCount++;
- if(!(dbe.flags&(DBEF_READ|DBEF_SENT))) {
+ if (!(dbe.flags&(DBEF_READ|DBEF_SENT))) {
if(dbe.timestamp<dbc.timestampFirstUnread || dbc.timestampFirstUnread==0) {
dbc.timestampFirstUnread=dbe.timestamp;
dbc.ofsFirstUnreadEvent=ofsNew;
@@ -209,7 +209,7 @@ static INT_PTR DeleteEvent(WPARAM wParam,LPARAM lParam)
//check if this was the first unread, if so, recalc the first unread
if(dbc.ofsFirstUnreadEvent==(DWORD)lParam) {
dbeNext=&dbe;
- for(;;) {
+ for (;;) {
if(dbeNext->ofsNext==0) {
dbc.ofsFirstUnreadEvent=0;
dbc.timestampFirstUnread=0;
@@ -217,7 +217,7 @@ static INT_PTR DeleteEvent(WPARAM wParam,LPARAM lParam)
}
ofsThis=dbeNext->ofsNext;
dbeNext=(struct DBEvent*)DBRead(ofsThis,sizeof(struct DBEvent),NULL);
- if(!(dbeNext->flags&(DBEF_READ|DBEF_SENT))) {
+ if (!(dbeNext->flags&(DBEF_READ|DBEF_SENT))) {
dbc.ofsFirstUnreadEvent=ofsThis;
dbc.timestampFirstUnread=dbeNext->timestamp;
break;
@@ -340,7 +340,7 @@ static INT_PTR MarkEventRead(WPARAM wParam,LPARAM lParam)
DBWrite(lParam,dbe,sizeof(struct DBEvent));
ret=(int)dbe->flags;
if(dbc.ofsFirstUnreadEvent==(DWORD)lParam) {
- for(;;) {
+ for (;;) {
if(dbe->ofsNext==0) {
dbc.ofsFirstUnreadEvent=0;
dbc.timestampFirstUnread=0;
@@ -348,7 +348,7 @@ static INT_PTR MarkEventRead(WPARAM wParam,LPARAM lParam)
}
ofsThis=dbe->ofsNext;
dbe=(struct DBEvent*)DBRead(ofsThis,sizeof(struct DBEvent),NULL);
- if(!(dbe->flags&(DBEF_READ|DBEF_SENT))) {
+ if (!(dbe->flags&(DBEF_READ|DBEF_SENT))) {
dbc.ofsFirstUnreadEvent=ofsThis;
dbc.timestampFirstUnread=dbe->timestamp;
break;
diff --git a/plugins/Db3x_mmap/dbsettings.c b/plugins/Db3x_mmap/dbsettings.c
index 85b91b1b6c..ab306e8b48 100644
--- a/plugins/Db3x_mmap/dbsettings.c
+++ b/plugins/Db3x_mmap/dbsettings.c
@@ -323,7 +323,7 @@ static __inline int GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING
NeedBytes(3+*(PWORD)(pBlob+1));
if(isStatic) {
dbcgs->pValue->cchVal--;
- if(*(PWORD)(pBlob+1)<dbcgs->pValue->cchVal) dbcgs->pValue->cchVal=*(PWORD)(pBlob+1);
+ if (*(PWORD)(pBlob+1)<dbcgs->pValue->cchVal) dbcgs->pValue->cchVal=*(PWORD)(pBlob+1);
CopyMemory(dbcgs->pValue->pszVal,pBlob+3,dbcgs->pValue->cchVal);
dbcgs->pValue->pszVal[dbcgs->pValue->cchVal]=0;
dbcgs->pValue->cchVal=*(PWORD)(pBlob+1);
@@ -337,7 +337,7 @@ static __inline int GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING
case DBVT_BLOB:
NeedBytes(3+*(PWORD)(pBlob+1));
if(isStatic) {
- if(*(PWORD)(pBlob+1)<dbcgs->pValue->cpbVal) dbcgs->pValue->cpbVal=*(PWORD)(pBlob+1);
+ if (*(PWORD)(pBlob+1)<dbcgs->pValue->cpbVal) dbcgs->pValue->cpbVal=*(PWORD)(pBlob+1);
CopyMemory(dbcgs->pValue->pbVal,pBlob+3,dbcgs->pValue->cpbVal);
}
else {
@@ -733,7 +733,7 @@ static INT_PTR WriteContactSetting(WPARAM wParam,LPARAM lParam)
else bytesRequired=tmp.value.type;
bytesRequired+=2+settingNameLen;
bytesRequired+=ofsBlobPtr+1-(ofsSettingsGroup+offsetof(struct DBContactSettings,blob));
- if((DWORD)bytesRequired>dbcs.cbBlob) {
+ if ((DWORD)bytesRequired>dbcs.cbBlob) {
//doesn't fit: move entire group
struct DBContactSettings *dbcsPrev;
DWORD ofsDbcsPrev,ofsNew;
@@ -863,7 +863,7 @@ static INT_PTR DeleteContactSetting(WPARAM wParam,LPARAM lParam)
MoveAlong(1+GetSettingValueLength(pBlob));
NeedBytes(1);
}
- if(!pBlob[0]) { //setting didn't exist
+ if (!pBlob[0]) { //setting didn't exist
LeaveCriticalSection(&csDbAccess);
return 1;
}
@@ -925,7 +925,7 @@ static INT_PTR EnumContactSettings(WPARAM wParam,LPARAM lParam)
return -1;
}
dbces->ofsSettings=GetSettingsGroupOfsByModuleNameOfs(dbc,ofsModuleName);
- if(!dbces->ofsSettings) {
+ if (!dbces->ofsSettings) {
LeaveCriticalSection(&csDbAccess);
return -1;
}
diff --git a/plugins/Db_autobackups/backup.c b/plugins/Db_autobackups/backup.c
index 377a1fe539..3b0229ac56 100644
--- a/plugins/Db_autobackups/backup.c
+++ b/plugins/Db_autobackups/backup.c
@@ -98,7 +98,7 @@ int RotateBackups(HWND progress_dialog, DWORD start_time)
i++;
while(PeekMessage(&msg, progress_dialog, 0, 0, PM_REMOVE) != 0)
{
- if(!IsDialogMessage(progress_dialog, &msg))
+ if (!IsDialogMessage(progress_dialog, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
@@ -154,10 +154,10 @@ int Backup(TCHAR* backup_filename)
else
lstrcpyn(dest_file, backup_filename, MAX_PATH);
- if(!options.disable_popups)
+ if (!options.disable_popups)
ShowPopup(dbname, TranslateT("Backup in Progress"));
- if(!options.disable_progress) {
+ if (!options.disable_progress) {
progress_dialog = CreateDialog(hInst, MAKEINTRESOURCE(IDD_COPYPROGRESS), 0, (DLGPROC)DlgProcProgress);
SetDlgItemText(progress_dialog, IDC_PROGRESSMESSAGE, TranslateT("Rotating backup files..."));
}
@@ -175,7 +175,7 @@ int Backup(TCHAR* backup_filename)
SendMessage(progress_dialog, PBM_SETPOS, (WPARAM)(int)(100), 0);
UpdateWindow(progress_dialog);
DBWriteContactSettingDword(0, "AutoBackups", "LastBackupTimestamp", (DWORD)time(0));
- if(!options.disable_popups)
+ if (!options.disable_popups)
{
dest_file_len = lstrlen(dest_file);
if(dest_file_len > 50)
diff --git a/plugins/Db_autobackups/options.c b/plugins/Db_autobackups/options.c
index 51baa1b687..acb6072718 100644
--- a/plugins/Db_autobackups/options.c
+++ b/plugins/Db_autobackups/options.c
@@ -12,9 +12,9 @@ int LoadOptions(void) {
options.period = (unsigned int)DBGetContactSettingWord(0, "AutoBackups", "Period", 1);
options.period_type = (PeriodType)DBGetContactSettingByte(0, "AutoBackups", "PeriodType", (BYTE)PT_DAYS);
- if(!ServiceExists(MS_FOLDERS_GET_PATH)) {
+ if (!ServiceExists(MS_FOLDERS_GET_PATH)) {
- if(!DBGetContactSettingTString(0, "AutoBackups", "Folder", &dbv)) {
+ if (!DBGetContactSettingTString(0, "AutoBackups", "Folder", &dbv)) {
tmp = Utils_ReplaceVarsT(dbv.ptszVal);
if(_tcslen(tmp) >= 2 && tmp[1] == ':')
@@ -244,7 +244,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
bi.lParam = 0;
bi.iImage = 0;
- if((pidl = SHBrowseForFolder(&bi)) != 0) {
+ if ((pidl = SHBrowseForFolder(&bi)) != 0) {
SHGetPathFromIDList(pidl, folder_buff);
SetDlgItemText(hwndDlg, IDC_ED_FOLDER, folder_buff);
diff --git a/plugins/Dbx_mmap_SA/Dbtool/aggressive.cpp b/plugins/Dbx_mmap_SA/Dbtool/aggressive.cpp
index 26312ea5b0..5ec62707f1 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/aggressive.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/aggressive.cpp
@@ -31,7 +31,7 @@ int WorkAggressive(int firstTime)
BYTE *buf;
if(firstTime) {
- if(!opts.bAggressive) return ERROR_NO_MORE_ITEMS;
+ if (!opts.bAggressive) return ERROR_NO_MORE_ITEMS;
AddToStatus(STATUS_MESSAGE,TranslateT("Performing aggressive pass"));
ofsCurrent=0;
spaceProcessed=0;
@@ -43,13 +43,13 @@ int WorkAggressive(int firstTime)
blockBytes-=3;
for(i=0;i<blockBytes;i++) {
if(buf[i]) {
- if((*(PDWORD)&buf[i]&0x00FFFFFF)!=0xDECADE)
+ if ((*(PDWORD)&buf[i]&0x00FFFFFF)!=0xDECADE)
AddToStatus(STATUS_WARNING,TranslateT("Aggressive: random junk at %08X: skipping"),ofsCurrent+i);
else {
//TODO: give user the option of placing manually
AddToStatus(STATUS_ERROR,TranslateT("Aggressive: unlinked data at %08X: can't automatically place"),ofsCurrent+i);
}
- for(;i<blockBytes;i++)
+ for (;i<blockBytes;i++)
if(buf[i]==0) {i--; break;}
}
}
diff --git a/plugins/Dbx_mmap_SA/Dbtool/contactchain.cpp b/plugins/Dbx_mmap_SA/Dbtool/contactchain.cpp
index dd6d50556b..0452f90d0d 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/contactchain.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/contactchain.cpp
@@ -54,7 +54,7 @@ int WorkContactChain(int firstTime)
FinishUp();
return ERROR_NO_MORE_ITEMS;
}
- if(!SignatureValid(ofsThisContact,DBCONTACT_SIGNATURE)) {
+ if (!SignatureValid(ofsThisContact,DBCONTACT_SIGNATURE)) {
AddToStatus(STATUS_ERROR,TranslateT("Contact chain corrupted, further entries ignored"));
FinishUp();
return ERROR_NO_MORE_ITEMS;
@@ -66,7 +66,7 @@ int WorkContactChain(int firstTime)
ofsNextContact=dbc.ofsNext;
dbc.ofsNext=0;
if (!opts.bCheckOnly) {
- if((ofsDestThis=WriteSegment(WSOFS_END,&dbc,sizeof(dbc)))==WS_ERROR)
+ if ((ofsDestThis=WriteSegment(WSOFS_END,&dbc,sizeof(dbc)))==WS_ERROR)
return ERROR_HANDLE_DISK_FULL;
if(ofsDestPrevContact)
WriteSegment(ofsDestPrevContact+offsetof(DBContact,ofsNext),&ofsDestThis,sizeof(DWORD));
diff --git a/plugins/Dbx_mmap_SA/Dbtool/disk.cpp b/plugins/Dbx_mmap_SA/Dbtool/disk.cpp
index 685f86569f..1ac84a3dc6 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/disk.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/disk.cpp
@@ -55,7 +55,7 @@ int PeekSegment(DWORD ofs,PVOID buf,int cbBytes)
CopyMemory(buf, opts.pFile+ofs, bytesRead);
- if((int)bytesRead<cbBytes) return ERROR_HANDLE_EOF;
+ if ((int)bytesRead<cbBytes) return ERROR_HANDLE_EOF;
return ERROR_SUCCESS;
}
@@ -88,7 +88,7 @@ DWORD WriteSegment(DWORD ofs,PVOID buf,int cbBytes)
}
SetFilePointer(opts.hOutFile,ofs,NULL,FILE_BEGIN);
WriteFile(opts.hOutFile,buf,cbBytes,&bytesWritten,NULL);
- if((int)bytesWritten<cbBytes) {
+ if ((int)bytesWritten<cbBytes) {
AddToStatus(STATUS_FATAL,TranslateT("Can't write to output file - disk full? (%u)"),GetLastError());
return WS_ERROR;
}
@@ -105,7 +105,7 @@ int ReadWrittenSegment(DWORD ofs,PVOID buf,int cbBytes)
SetFilePointer(opts.hOutFile,ofs,NULL,FILE_BEGIN);
ReadFile(opts.hOutFile,buf,cbBytes,&bytesRead,NULL);
- if((int)bytesRead<cbBytes)
+ if ((int)bytesRead<cbBytes)
return ERROR_READ_FAULT;
return ERROR_SUCCESS;
diff --git a/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp b/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp
index aabe3f98b2..cab515864c 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp
@@ -59,7 +59,7 @@ void InitSecurity()
TCHAR *str2;
GetModuleFileName(NULL,szMirandaDir,SIZEOF(szMirandaDir));
str2 = _tcsrchr(szMirandaDir,'\\');
- if( str2 != NULL )
+ if ( str2 != NULL )
*str2=0;
_tchdir(szMirandaDir);
}
@@ -105,7 +105,7 @@ void InitSecurity()
}
}
if(ModulesCount >= 100) break;
- if(!FindNextFileA(hFile, &fd)) break;
+ if (!FindNextFileA(hFile, &fd)) break;
}
AddToStatus(STATUS_MESSAGE,TranslateT("%d crypto modules loaded"), ModulesCount);
@@ -166,14 +166,14 @@ int CheckPassword(WORD checkWord, WORD cryptorUID, char * szDBName)
{
int i;
int Found = 0;
- for(i = 0; i < ModulesCount; i++){
+ for(i = 0; i < ModulesCount; i++) {
if(cryptorUID == Modules[i]->cryptor->uid){
CryptoEngine = Modules[i]->cryptor;
Found = 1;
break;
}
}
- if(!Found){
+ if (!Found){
AddToStatus(STATUS_FATAL, TranslateT("Sorry, but your database encrypted with unknown module"), MB_OK);
bCheckingPass = 0;
return 0;
@@ -277,7 +277,7 @@ BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
UINT uid = LOWORD(wParam);
if(uid == IDOK){
- if(!GetWindowLongPtr(hDlg,GWLP_USERDATA))
+ if (!GetWindowLongPtr(hDlg,GWLP_USERDATA))
{
encryptKeyLength = GetDlgItemTextA(hDlg, IDC_USERPASS, encryptKey, 254);
EndDialog(hDlg,IDOK);
diff --git a/plugins/Dbx_mmap_SA/Dbtool/eventchain.cpp b/plugins/Dbx_mmap_SA/Dbtool/eventchain.cpp
index c48ab1b821..23dab85843 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/eventchain.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/eventchain.cpp
@@ -44,7 +44,7 @@ static void ConvertOldEvent( DBEvent*& dbei )
break;
} } }
else {
- if( !is_utf8_string(( char* )dbei->blob) )
+ if ( !is_utf8_string(( char* )dbei->blob) )
dbei->flags &= ~DBEF_UTF;
}
@@ -132,7 +132,7 @@ int WorkEventChain(DWORD ofsContact,DBContact *dbc,int firstTime)
FinishUp(ofsDestPrevEvent,dbc);
return ERROR_NO_MORE_ITEMS;
}
- if(!SignatureValid(ofsThisEvent,DBEVENT_SIGNATURE))
+ if (!SignatureValid(ofsThisEvent,DBEVENT_SIGNATURE))
{
DWORD ofsNew = 0;
DWORD ofsTmp = dbc->ofsLastEvent;
@@ -163,7 +163,7 @@ int WorkEventChain(DWORD ofsContact,DBContact *dbc,int firstTime)
}
if(firstTime) {
- if(!(dbeOld.flags&DBEF_FIRST)) {
+ if (!(dbeOld.flags&DBEF_FIRST)) {
AddToStatus(STATUS_WARNING,TranslateT("First event not marked as such: correcting"));
dbeOld.flags|=DBEF_FIRST;
}
@@ -180,7 +180,7 @@ int WorkEventChain(DWORD ofsContact,DBContact *dbc,int firstTime)
dbeOld.flags&=(DBEF_FIRST|DBEF_READ|DBEF_SENT|DBEF_RTL|DBEF_UTF);
}
- if(!(dbeOld.flags&(DBEF_READ|DBEF_SENT))) {
+ if (!(dbeOld.flags&(DBEF_READ|DBEF_SENT))) {
if(opts.bMarkRead) dbeOld.flags|=DBEF_READ;
else if(ofsFirstUnread==0) {
if(dbc->ofsFirstUnreadEvent!=ofsThisEvent || dbc->timestampFirstUnread!=dbeOld.timestamp)
@@ -211,12 +211,12 @@ int WorkEventChain(DWORD ofsContact,DBContact *dbc,int firstTime)
return ERROR_NO_MORE_ITEMS;
}
- if((dbeNew->ofsModuleName=ConvertModuleNameOfs(dbeOld.ofsModuleName))==0) {
+ if ((dbeNew->ofsModuleName=ConvertModuleNameOfs(dbeOld.ofsModuleName))==0) {
ofsThisEvent=dbeOld.ofsNext;
return ERROR_SUCCESS;
}
- if(!firstTime && dbeOld.ofsPrev!=ofsPrevEvent)
+ if (!firstTime && dbeOld.ofsPrev!=ofsPrevEvent)
AddToStatus(STATUS_WARNING,TranslateT("Event not backlinked correctly: fixing"));
dbeNew->flags=dbeOld.flags;
diff --git a/plugins/Dbx_mmap_SA/Dbtool/finaltasks.cpp b/plugins/Dbx_mmap_SA/Dbtool/finaltasks.cpp
index b7a99a5189..2ed8b7183d 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/finaltasks.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/finaltasks.cpp
@@ -72,7 +72,7 @@ int WorkFinalTasks(int firstTime)
}
MoveFile(opts.filename,opts.backupFilename) || AddToStatus(STATUS_WARNING,TranslateT("Unable to rename original file"));
}
- else if(!opts.bCheckOnly) DeleteFile(opts.filename) || AddToStatus(STATUS_WARNING,TranslateT("Unable to delete original file"));
- if(!opts.bCheckOnly) MoveFile(opts.outputFilename,opts.filename) || AddToStatus(STATUS_WARNING,TranslateT("Unable to rename output file"));
+ else if (!opts.bCheckOnly) DeleteFile(opts.filename) || AddToStatus(STATUS_WARNING,TranslateT("Unable to delete original file"));
+ if (!opts.bCheckOnly) MoveFile(opts.outputFilename,opts.filename) || AddToStatus(STATUS_WARNING,TranslateT("Unable to rename output file"));
return ERROR_NO_MORE_ITEMS;
}
diff --git a/plugins/Dbx_mmap_SA/Dbtool/initialchecks.cpp b/plugins/Dbx_mmap_SA/Dbtool/initialchecks.cpp
index a2f621df46..385d31cb92 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/initialchecks.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/initialchecks.cpp
@@ -40,13 +40,13 @@ int WorkInitialChecks(int firstTime)
}
bEncrypted = false;
if(memcmp(dbhdr.signature,&dbSignature,sizeof(dbhdr.signature))) {
- if(memcmp(dbhdr.signature,&dbSignatureEncrypted,sizeof(dbhdr.signature))){
+ if(memcmp(dbhdr.signature,&dbSignatureEncrypted,sizeof(dbhdr.signature))) {
AddToStatus(STATUS_FATAL,TranslateT("Database signature is corrupted, automatic repair is impossible"));
return ERROR_BAD_FORMAT;
}
AddToStatus(STATUS_SUCCESS,TranslateT("Database is Secured MMAP database"));
InitSecurity();
- if(CheckPassword(dbhdr.checkWord, dbhdr.cryptorUID, (char*)Translate("your database"))){
+ if(CheckPassword(dbhdr.checkWord, dbhdr.cryptorUID, (char*)Translate("your database"))) {
AddToStatus(STATUS_SUCCESS,TranslateT("Secured MMAP: authorization successful"));
bEncrypted = true;
}
diff --git a/plugins/Dbx_mmap_SA/Dbtool/langpack.cpp b/plugins/Dbx_mmap_SA/Dbtool/langpack.cpp
index 85df5cdf22..af251fe2f2 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/langpack.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/langpack.cpp
@@ -76,7 +76,7 @@ void ConvertBackslashes(char *str, UINT fileCp)
char *pstr;
for (pstr = str; *pstr; pstr = CharNextExA(fileCp, pstr, 0))
{
- if( *pstr == '\\' )
+ if ( *pstr == '\\' )
{
switch( pstr[1] )
{
@@ -215,11 +215,11 @@ static int LoadLangPack(const TCHAR *szLangPack)
pszColon=strchr(line,':');
if(pszColon==NULL) {fclose(fp); return 3;}
*pszColon=0;
- if(!lstrcmpA(line,"Language")) {_snprintf(langPack.language,sizeof(langPack.language),"%s",pszColon+1); TrimString(langPack.language);}
- else if(!lstrcmpA(line,"Last-Modified-Using")) {_snprintf(langPack.lastModifiedUsing,sizeof(langPack.lastModifiedUsing),"%s",pszColon+1); TrimString(langPack.lastModifiedUsing);}
- else if(!lstrcmpA(line,"Authors")) {_snprintf(langPack.authors,sizeof(langPack.authors),"%s",pszColon+1); TrimString(langPack.authors);}
- else if(!lstrcmpA(line,"Author-email")) {_snprintf(langPack.authorEmail,sizeof(langPack.authorEmail),"%s",pszColon+1); TrimString(langPack.authorEmail);}
- else if(!lstrcmpA(line, "Locale")) {
+ if (!lstrcmpA(line,"Language")) {_snprintf(langPack.language,sizeof(langPack.language),"%s",pszColon+1); TrimString(langPack.language);}
+ else if (!lstrcmpA(line,"Last-Modified-Using")) {_snprintf(langPack.lastModifiedUsing,sizeof(langPack.lastModifiedUsing),"%s",pszColon+1); TrimString(langPack.lastModifiedUsing);}
+ else if (!lstrcmpA(line,"Authors")) {_snprintf(langPack.authors,sizeof(langPack.authors),"%s",pszColon+1); TrimString(langPack.authors);}
+ else if (!lstrcmpA(line,"Author-email")) {_snprintf(langPack.authorEmail,sizeof(langPack.authorEmail),"%s",pszColon+1); TrimString(langPack.authorEmail);}
+ else if (!lstrcmpA(line, "Locale")) {
char szBuf[20], *stopped;
TrimString(pszColon + 1);
@@ -249,7 +249,7 @@ static int LoadLangPack(const TCHAR *szLangPack)
pszLine = line+1;
line[lstrlenA(line)-1]='\0';
TrimStringSimple(line);
- if(++langPack.entryCount>entriesAlloced) {
+ if (++langPack.entryCount>entriesAlloced) {
entriesAlloced+=128;
langPack.entry=(struct LangPackEntry*)realloc(langPack.entry,sizeof(struct LangPackEntry)*entriesAlloced);
}
@@ -339,9 +339,9 @@ static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd,LPARAM lParam)
int id = GetDlgCtrlID( hwnd );
GetClassName(hwnd,szClass,SIZEOF(szClass));
- if(!lstrcmpi(szClass,_T("static")) || !lstrcmpi(szClass,_T("hyperlink")) || !lstrcmpi(szClass,_T("button")) || !lstrcmpi(szClass,_T("MButtonClass")))
+ if (!lstrcmpi(szClass,_T("static")) || !lstrcmpi(szClass,_T("hyperlink")) || !lstrcmpi(szClass,_T("button")) || !lstrcmpi(szClass,_T("MButtonClass")))
TranslateWindow(hwnd);
- else if(!lstrcmpi(szClass,_T("edit"))) {
+ else if (!lstrcmpi(szClass,_T("edit"))) {
if ( GetWindowLong(hwnd,GWL_STYLE)&ES_READONLY)
TranslateWindow(hwnd);
}
diff --git a/plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp b/plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp
index 515ec9bfbd..a93f1720e6 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp
@@ -48,7 +48,7 @@ int WorkModuleChain(int firstTime)
phase++;
return ERROR_SUCCESS;
}
- if(!SignatureValid(ofsCurrent,DBMODULENAME_SIGNATURE)) {
+ if (!SignatureValid(ofsCurrent,DBMODULENAME_SIGNATURE)) {
AddToStatus(STATUS_ERROR,TranslateT("Module chain corrupted, further entries ignored"));
phase++;
return ERROR_SUCCESS;
@@ -87,12 +87,12 @@ int WorkModuleChain(int firstTime)
newModName=(DBModuleName*)_alloca(modChain[iCurrentModName].size);
if(ReadSegment(modChain[iCurrentModName].ofsOld,newModName,modChain[iCurrentModName].size)!=ERROR_SUCCESS)
return ERROR_NO_MORE_ITEMS;
- if((modChain[iCurrentModName].ofsNew=WriteSegment(WSOFS_END,newModName,modChain[iCurrentModName].size))==WS_ERROR)
+ if ((modChain[iCurrentModName].ofsNew=WriteSegment(WSOFS_END,newModName,modChain[iCurrentModName].size))==WS_ERROR)
return ERROR_HANDLE_DISK_FULL;
{ // check duplicated modulenames
int i, n=0;
for(i=iCurrentModName+1;i<modChainCount;i++)
- if(!strcmp(modChain[i].name, modChain[iCurrentModName].name)) {
+ if (!strcmp(modChain[i].name, modChain[iCurrentModName].name)) {
modChain[i].ofsNew = modChain[iCurrentModName].ofsNew;
n++;
}
diff --git a/plugins/Dbx_mmap_SA/Dbtool/progress.cpp b/plugins/Dbx_mmap_SA/Dbtool/progress.cpp
index 4b7d7979b4..caca179482 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/progress.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/progress.cpp
@@ -42,7 +42,7 @@ int AddToStatus(DWORD flags, TCHAR* fmt,...)
OutputDebugString(str);
OutputDebugStringA("\n");
#endif
- if((flags&STATUS_CLASSMASK)==STATUS_ERROR) errorCount++;
+ if ((flags&STATUS_CLASSMASK)==STATUS_ERROR) errorCount++;
return ret;
}
@@ -118,7 +118,7 @@ INT_PTR CALLBACK ProgressDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPa
TCHAR str[256];
int bold=0;
HFONT hoFont;
- if((int)dis->itemID==-1) break;
+ if ((int)dis->itemID==-1) break;
SendMessage(dis->hwndItem,LB_GETTEXT,dis->itemID,(LPARAM)str);
switch(dis->itemData&STATUS_CLASSMASK) {
case STATUS_MESSAGE:
@@ -175,7 +175,7 @@ INT_PTR CALLBACK ProgressDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPa
switch(LOWORD(wParam)) {
case IDC_BACK:
ResetEvent(hEventRun);
- if(!IsWindowEnabled(GetDlgItem(GetParent(hdlg),IDOK))) {
+ if (!IsWindowEnabled(GetDlgItem(GetParent(hdlg),IDOK))) {
if(MessageBox(hdlg,TranslateT("Processing has not yet completed, if you go back now then the changes that have currently been made will be rolled back and the original database will be restored. Do you still want to go back?"),TranslateT("Miranda Database Tool"),MB_YESNO)==IDYES) {
manualAbort=2;
SetEvent(hEventAbort);
diff --git a/plugins/Dbx_mmap_SA/Dbtool/selectdb.cpp b/plugins/Dbx_mmap_SA/Dbtool/selectdb.cpp
index d8fa36ed75..08bbd35016 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/selectdb.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/selectdb.cpp
@@ -27,7 +27,7 @@ void GetProfileDirectory(TCHAR* szMirandaDir, TCHAR* szPath, int cbPath)
GetPrivateProfileString(_T("Database"),_T("ProfileDir"),_T("./Profiles"),szProfileDir,SIZEOF(szProfileDir),szMirandaBootIni);
ExpandEnvironmentStrings(szProfileDir,szExpandedProfileDir,SIZEOF(szExpandedProfileDir));
_tchdir(szMirandaDir);
- if(!_tfullpath(szPath,szExpandedProfileDir,cbPath))
+ if (!_tfullpath(szPath,szExpandedProfileDir,cbPath))
lstrcpyn(szPath,szMirandaDir,cbPath);
if(szPath[lstrlen(szPath)-1]=='\\')
szPath[lstrlen(szPath)-1] = 0;
@@ -48,7 +48,7 @@ static int AddDatabaseToList(HWND hwndList, TCHAR* filename, TCHAR* dir)
lvi.iSubItem=0;
for(lvi.iItem=ListView_GetItemCount(hwndList)-1;lvi.iItem>=0;lvi.iItem--) {
ListView_GetItem(hwndList,&lvi);
- if( !_tcsicmp(( TCHAR* )lvi.lParam,filename)) return lvi.iItem;
+ if ( !_tcsicmp(( TCHAR* )lvi.lParam,filename)) return lvi.iItem;
}
hDbFile=CreateFile(filename,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL);
if ( hDbFile == INVALID_HANDLE_VALUE )
@@ -59,7 +59,7 @@ static int AddDatabaseToList(HWND hwndList, TCHAR* filename, TCHAR* dir)
broken = (bytesRead<sizeof(dbhdr) || memcmp(dbhdr.signature,&dbSignature,sizeof(dbhdr.signature)));
- if(!broken) {
+ if (!broken) {
wasted = dbhdr.slackSpace;
if (totalSize>dbhdr.ofsFileEnd)
wasted+=totalSize-dbhdr.ofsFileEnd;
@@ -166,7 +166,7 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPa
TCHAR *str2;
GetModuleFileName(NULL,szMirandaPath,SIZEOF(szMirandaPath));
str2 = _tcsrchr(szMirandaPath,'\\');
- if( str2 != NULL )
+ if ( str2 != NULL )
*str2=0;
}
{
@@ -181,7 +181,7 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPa
GetProfileDirectory(szMirandaPath,szProfileDir,SIZEOF(szProfileDir));
// search in profile dir (using ini file)
- if( lstrcmpi(szProfileDir,szMirandaProfiles) )
+ if ( lstrcmpi(szProfileDir,szMirandaProfiles) )
FindAdd(hdlg, szProfileDir, _T("[ini]\\"));
FindAdd(hdlg, szMirandaProfiles, _T("[prf]\\"));
@@ -191,7 +191,7 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPa
// search in profile dir (using registry path + ini file)
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,_T("Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\miranda32.exe"),0,KEY_QUERY_VALUE,&hKey) == ERROR_SUCCESS) {
if(RegQueryValueEx(hKey,_T("Path"),NULL,NULL,(PBYTE)szMirandaPath,&cbData) == ERROR_SUCCESS) {
- if( lstrcmp(szProfileDir,szMirandaPath) ) {
+ if ( lstrcmp(szProfileDir,szMirandaPath) ) {
GetProfileDirectory(szMirandaPath,szProfileDir,SIZEOF(szProfileDir));
FindAdd(hdlg, szProfileDir, _T("[reg]\\"));
}
diff --git a/plugins/Dbx_mmap_SA/Dbtool/settingschain.cpp b/plugins/Dbx_mmap_SA/Dbtool/settingschain.cpp
index 6c7b95febc..a6e7ecab3b 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/settingschain.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/settingschain.cpp
@@ -33,7 +33,7 @@ int WorkSettingsChain(DWORD ofsContact,DBContact *dbc,int firstTime)
}
if(ofsThisSettings==0)
return ERROR_NO_MORE_ITEMS;
- if(!SignatureValid(ofsThisSettings,DBCONTACTSETTINGS_SIGNATURE)) {
+ if (!SignatureValid(ofsThisSettings,DBCONTACTSETTINGS_SIGNATURE)) {
AddToStatus(STATUS_ERROR,TranslateT("Settings chain corrupted, further entries ignored"));
return ERROR_NO_MORE_ITEMS;
}
@@ -45,12 +45,12 @@ int WorkSettingsChain(DWORD ofsContact,DBContact *dbc,int firstTime)
return ERROR_SUCCESS;
}
dbcsNew=(DBContactSettings*)_alloca(offsetof(DBContactSettings,blob)+dbcsOld.cbBlob);
- if((ret=ReadSegment(ofsThisSettings,dbcsNew,offsetof(DBContactSettings,blob)+dbcsOld.cbBlob))!=ERROR_SUCCESS) {
+ if ((ret=ReadSegment(ofsThisSettings,dbcsNew,offsetof(DBContactSettings,blob)+dbcsOld.cbBlob))!=ERROR_SUCCESS) {
if(ret!=ERROR_HANDLE_EOF) { //eof is OK because blank space at the end doesn't matter
return ERROR_NO_MORE_ITEMS;
}
}
- if((dbcsNew->ofsModuleName=ConvertModuleNameOfs(dbcsOld.ofsModuleName))==0) {
+ if ((dbcsNew->ofsModuleName=ConvertModuleNameOfs(dbcsOld.ofsModuleName))==0) {
ofsThisSettings=dbcsOld.ofsNext;
return ERROR_SUCCESS;
}
@@ -61,7 +61,7 @@ int WorkSettingsChain(DWORD ofsContact,DBContact *dbc,int firstTime)
}
dbcsNew->ofsNext=0;
//TODO? validate all settings in blob/compact if necessary
- if((ofsDestThis=WriteSegment(WSOFS_END,dbcsNew,offsetof(DBContactSettings,blob)+dbcsNew->cbBlob))==WS_ERROR) {
+ if ((ofsDestThis=WriteSegment(WSOFS_END,dbcsNew,offsetof(DBContactSettings,blob)+dbcsNew->cbBlob))==WS_ERROR) {
return ERROR_HANDLE_DISK_FULL;
}
if(ofsDestPrevSettings) WriteSegment(ofsDestPrevSettings+offsetof(DBContactSettings,ofsNext),&ofsDestThis,sizeof(DWORD));
diff --git a/plugins/Dbx_mmap_SA/Dbtool/user.cpp b/plugins/Dbx_mmap_SA/Dbtool/user.cpp
index 79f30eace7..9922f1630f 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/user.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/user.cpp
@@ -31,7 +31,7 @@ int WorkUser(int firstTime)
if(firstTime) {
AddToStatus(STATUS_MESSAGE,TranslateT("Processing user data"));
- if(!SignatureValid(dbhdr.ofsUser,DBCONTACT_SIGNATURE)) {
+ if (!SignatureValid(dbhdr.ofsUser,DBCONTACT_SIGNATURE)) {
AddToStatus(STATUS_ERROR,TranslateT("User corrupted, this could cause major problems"));
return ERROR_NO_MORE_ITEMS;
}
@@ -41,7 +41,7 @@ int WorkUser(int firstTime)
AddToStatus(STATUS_WARNING,TranslateT("More than one user contact: keeping only first"));
user.ofsNext=0;
}
- if((ofsUser=WriteSegment(WSOFS_END,&user,sizeof(DBContact)))==WS_ERROR)
+ if ((ofsUser=WriteSegment(WSOFS_END,&user,sizeof(DBContact)))==WS_ERROR)
return ERROR_HANDLE_DISK_FULL;
dbhdr.ofsUser=ofsUser;
phase=0;
diff --git a/plugins/Dbx_mmap_SA/Dbtool/wizard.cpp b/plugins/Dbx_mmap_SA/Dbtool/wizard.cpp
index 499b420dd9..ab3c46f360 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/wizard.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/wizard.cpp
@@ -31,11 +31,11 @@ static BOOL CALLBACK MyControlsEnumChildren(HWND hwnd,LPARAM lParam)
int makeBold=0;
GetClassNameA(hwnd,szClass,sizeof(szClass));
- if(!strcmp(szClass,"Static")) {
- if(((style&SS_TYPEMASK)==SS_LEFT || (style&SS_TYPEMASK)==SS_CENTER || (style&SS_TYPEMASK)==SS_RIGHT) && exstyle&WS_EX_CLIENTEDGE)
+ if (!strcmp(szClass,"Static")) {
+ if (((style&SS_TYPEMASK)==SS_LEFT || (style&SS_TYPEMASK)==SS_CENTER || (style&SS_TYPEMASK)==SS_RIGHT) && exstyle&WS_EX_CLIENTEDGE)
makeBold=1;
}
- else if(!strcmp(szClass,"Button")) {
+ else if (!strcmp(szClass,"Button")) {
if(exstyle&WS_EX_CLIENTEDGE)
makeBold=1;
}
@@ -67,10 +67,10 @@ int DoMyControlProcessing(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam,INT
*bReturn=(BOOL)GetStockObject(WHITE_BRUSH);
return TRUE;
}
- if((GetWindowLongPtr((HWND)lParam,GWL_STYLE)&0xFFFF)==0) {
+ if ((GetWindowLongPtr((HWND)lParam,GWL_STYLE)&0xFFFF)==0) {
TCHAR szText[256];
GetWindowText((HWND)lParam,szText,SIZEOF(szText));
- if(!_tcscmp(szText,_T("whiterect"))) {
+ if (!_tcscmp(szText,_T("whiterect"))) {
SetTextColor((HDC)wParam,RGB(255,255,255));
SetBkColor((HDC)wParam,RGB(255,255,255));
SetBkMode((HDC)wParam,OPAQUE);
diff --git a/plugins/Dbx_mmap_SA/Dbtool/worker.cpp b/plugins/Dbx_mmap_SA/Dbtool/worker.cpp
index 7f22539f8f..dd73c83947 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/worker.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/worker.cpp
@@ -59,7 +59,7 @@ void __cdecl WorkerThread(void *unused)
ret=Workers[task](firstTime);
firstTime=0;
if(ret==ERROR_NO_MORE_ITEMS) {
- if(++task==sizeof(Workers)/sizeof(Workers[0])) {
+ if (++task==sizeof(Workers)/sizeof(Workers[0])) {
AddToStatus(STATUS_MESSAGE,TranslateT("Elapsed time: %d sec"), time(NULL)-ts);
if(errorCount)
AddToStatus(STATUS_SUCCESS,TranslateT("All tasks completed but with errors (%d)"),errorCount);
diff --git a/plugins/Dbx_mmap_SA/Import_SA/encryption.c b/plugins/Dbx_mmap_SA/Import_SA/encryption.c
index 6cb98d20c1..f261581041 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/encryption.c
+++ b/plugins/Dbx_mmap_SA/Import_SA/encryption.c
@@ -62,7 +62,7 @@ void InitSecurity()
GetModuleFileName(NULL,szMirandaDir,SIZEOF(szMirandaDir));
str2 = _tcsrchr(szMirandaDir,'\\');
- if( str2 != NULL )
+ if ( str2 != NULL )
*str2=0;
_tchdir(szMirandaDir);
}
@@ -112,7 +112,7 @@ void InitSecurity()
}
}
if(ModulesCount >= 100) break;
- if(!FindNextFileA(hFile, &fd)) break;
+ if (!FindNextFileA(hFile, &fd)) break;
}
AddMessage(LPGEN("%d crypto modules loaded"), ModulesCount);
@@ -173,14 +173,14 @@ int CheckPassword(WORD checkWord, WORD cryptorUID, TCHAR * szDBName)
{
int i;
int Found = 0;
- for(i = 0; i < ModulesCount; i++){
+ for(i = 0; i < ModulesCount; i++) {
if(cryptorUID == Modules[i]->cryptor->uid){
CryptoEngine = Modules[i]->cryptor;
Found = 1;
break;
}
}
- if(!Found){
+ if (!Found){
AddMessage(LPGEN("Sorry, but your database encrypted with unknown module"), MB_OK);
bCheckingPass = 0;
return 0;
@@ -245,7 +245,7 @@ BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_PASS));
SendMessage(GetDlgItem(hDlg, IDC_HEADERBAR), WM_SETICON, 0, (LPARAM)hIcon);
- if(!wrongPass)
+ if (!wrongPass)
{
mir_sntprintf(tszHeaderTxt, SIZEOF(tszHeaderTxt), _T("%s\n%s"), TranslateT("Please type in your password for"), lParam);
SetWindowText(GetDlgItem(hDlg, IDC_HEADERBAR), tszHeaderTxt);
@@ -287,7 +287,7 @@ BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
UINT uid = LOWORD(wParam);
if(uid == IDOK){
- if(!GetWindowLongPtr(hDlg,GWLP_USERDATA))
+ if (!GetWindowLongPtr(hDlg,GWLP_USERDATA))
{
encryptKeyLength = GetDlgItemTextA(hDlg, IDC_USERPASS, encryptKey, 254);
EndDialog(hDlg,IDOK);
diff --git a/plugins/Dbx_mmap_SA/Import_SA/mirabilis.c b/plugins/Dbx_mmap_SA/Import_SA/mirabilis.c
index 6d99757d4d..130843205e 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/mirabilis.c
+++ b/plugins/Dbx_mmap_SA/Import_SA/mirabilis.c
@@ -244,7 +244,7 @@ static int GetHighestIndexEntry(void)
DWORD ofs;
ofs=*(PDWORD)(pIdx+12);
- for(;;) {
+ for (;;) {
entry=(struct TIdxIndexEntry*)(pIdx+ofs);
if(entry->entryIdLow==(DWORD)-2) return ((struct TIdxDatEntry*)entry)->entryId;
if(entry->ofsHigher>=0xF0000000) ofs=entry->ofsInHere;
@@ -256,7 +256,7 @@ static int GetIdDatOfs(DWORD id)
{
struct TIdxIndexEntry *entry;
DWORD ofs = *(PDWORD)(pIdx+12);
- for(;;) {
+ for (;;) {
entry=(struct TIdxIndexEntry*)(pIdx+ofs);
if(entry->entryIdLow==(DWORD)-2) {
if(entry->entryIdHigh==id) return ((struct TIdxDatEntry*)entry)->datOfs;
@@ -389,7 +389,7 @@ DWORD ReadPropertyBlock(DWORD dwOffset, char* SearchWord, int* nSearchResult)
if ( SearchWord ) {
// Is this the property we are searching for?
- if(!lstrcmpA((char*)(pDat+nameOfs),SearchWord)){
+ if (!lstrcmpA((char*)(pDat+nameOfs),SearchWord)) {
*nSearchResult = 1;
return dwOffset;
} }
@@ -485,10 +485,10 @@ DWORD FindMyDetails(void)
DWORD dwOffset = GetIdDatOfs(1005);
if (!dwOffset) return 0;
- if(*(PDWORD)(pDat+dwOffset+0x08) != 1005) return 0;
- if(*(PBYTE)(pDat+dwOffset+0x0C) != 0xE4) return 0;
- if(*(int*)(pDat+dwOffset+0x1e) != 'USER') return 0;
- if(*(PDWORD)(pDat+dwOffset+0x22) != 6) return 0;
+ if (*(PDWORD)(pDat+dwOffset+0x08) != 1005) return 0;
+ if (*(PBYTE)(pDat+dwOffset+0x0C) != 0xE4) return 0;
+ if (*(int*)(pDat+dwOffset+0x1e) != 'USER') return 0;
+ if (*(PDWORD)(pDat+dwOffset+0x22) != 6) return 0;
return dwOffset;
}
@@ -527,7 +527,7 @@ DWORD FindGroupList(DWORD dwOffset)
dwOffset += 0x04; // ++ UNKNOWN ++
dwPhoneEntries = *(PDWORD)(pDat+dwOffset); // Phonebook starts here
dwOffset += 0x04;
- for(n = 0;n<dwPhoneEntries;n++){
+ for(n = 0;n<dwPhoneEntries;n++) {
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
@@ -597,7 +597,7 @@ DWORD FindGroupList(DWORD dwOffset)
dwOffset += 0x08;
dwPhoneEntries = *(PDWORD)(pDat+dwOffset); // Phonebook
dwOffset += 0x04;
- for(n = 0;n<dwPhoneEntries;n++){
+ for(n = 0;n<dwPhoneEntries;n++) {
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
@@ -649,8 +649,8 @@ char* GetGroupName(DWORD dwGroupID)
switch (dwDBVersion) {
case DBV99A:
case DBV99B:
- for (n = 0; n < dwGroups; n++){
- if (dwGroupID == *(PDWORD)(pDat + dwOffset)){
+ for (n = 0; n < dwGroups; n++) {
+ if (dwGroupID == *(PDWORD)(pDat + dwOffset)) {
if (*(PWORD)(pDat + dwOffset + 4) > 1)
return 6 + (char*)(pDat + dwOffset);
@@ -665,10 +665,10 @@ char* GetGroupName(DWORD dwGroupID)
case DBV2000A:
case DBV2000B:
case DBV2001A:
- for (n = 0; n < dwGroups; n++){
- if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupID", &nSearchResult)){
+ for (n = 0; n < dwGroups; n++) {
+ if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupID", &nSearchResult)) {
if (nSearchResult) {
- if (dwGroupID == *(PDWORD)(pDat + tmpOfs + 1)){
+ if (dwGroupID == *(PDWORD)(pDat + tmpOfs + 1)) {
strGroupName = 3 + (char*)(pDat + ReadPropertyBlock(dwOffset, "GroupName", &nSearchResult));
if (nSearchResult) {
if ((DWORD)*(strGroupName - 2) > 1)
@@ -745,7 +745,7 @@ int ImportGroups()
switch (nFormat) {
case ENTRYV99A:
case ENTRYV99B:
- for (n = 0; n < dwGroups; n++){
+ for (n = 0; n < dwGroups; n++) {
if (*(PWORD)(pDat+dwOffset+4) > 1) {
if ( CreateGroup(DBVT_ASCIIZ, (char*)(pDat + dwOffset) + 6, NULL ))
nImported++;
@@ -758,8 +758,8 @@ int ImportGroups()
case ENTRYV2001A:
case ENTRYV2001B:
case ENTRYV2002A:
- for (n = 0; n < dwGroups; n++){
- if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupName", &nSearchResult)){
+ for (n = 0; n < dwGroups; n++) {
+ if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupName", &nSearchResult)) {
if (nSearchResult) {
if (CreateGroup( DBVT_ASCIIZ, (char*)(pDat + tmpOfs + 3), NULL ))
nImported++;
diff --git a/plugins/Dbx_mmap_SA/Import_SA/miranda.c b/plugins/Dbx_mmap_SA/Import_SA/miranda.c
index 6812557533..69b348d192 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/miranda.c
+++ b/plugins/Dbx_mmap_SA/Import_SA/miranda.c
@@ -517,7 +517,7 @@ int CheckFileFormat(HANDLE hDbFile)
bEncrypted = FALSE;
if (memcmp(pdbHeader->signature, &dbSignature, sizeof(pdbHeader->signature))) {
// Unsane: if not encrypted signature
- if (memcmp(pdbHeader->signature, &dbSignatureEncrypted, sizeof(pdbHeader->signature))){
+ if (memcmp(pdbHeader->signature, &dbSignatureEncrypted, sizeof(pdbHeader->signature))) {
AddMessage( LPGEN("Signature mismatch" ));
return DB_INVALID;
}
@@ -525,7 +525,7 @@ int CheckFileFormat(HANDLE hDbFile)
// Unsane: check password
InitSecurity();
tszDbName = _tcsrchr(importFile, _T('\\')) + 1;
- if (CheckPassword(pdbHeader->checkWord, pdbHeader->cryptorUID, tszDbName)){
+ if (CheckPassword(pdbHeader->checkWord, pdbHeader->cryptorUID, tszDbName)) {
AddMessage(LPGEN("Secured MMAP: authorization successful"));
bEncrypted = TRUE;
}
diff --git a/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c b/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c
index 232d295f8d..ba7a923df7 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c
+++ b/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c
@@ -92,7 +92,7 @@ static PBYTE ReadHistoryLines(FILE *fp,int *cbBlob)
blob=(char*)realloc(blob,*cbBlob+1);
lstrcpy(blob+ofs,str);
}
- if(*cbBlob) {
+ if (*cbBlob) {
(*cbBlob)--;
blob[*cbBlob-1]=0;
}
@@ -150,7 +150,7 @@ static void OldMirandaHistoryImport(HWND hdlgProgress)
tmEventTime.tm_mon=atoi(timeofs+10)-1;
tmEventTime.tm_year=atoi(timeofs+13)-1900;
dbei.timestamp=mktime(&tmEventTime)+_timezone;
- if(!(importOptions&historyTypeToOption[type])) continue;
+ if (!(importOptions&historyTypeToOption[type])) continue;
hContact=HistoryImportFindContact(hdlgProgress,uin,importOptions&IOPT_ADDUNKNOWN);
if(hContact==INVALID_HANDLE_VALUE) break;
dbei.flags=issent(type)?DBEF_SENT:DBEF_READ;
diff --git a/plugins/Dbx_mmap_SA/dbcache.c b/plugins/Dbx_mmap_SA/dbcache.c
index 8e177c6f6d..625d8aa775 100644
--- a/plugins/Dbx_mmap_SA/dbcache.c
+++ b/plugins/Dbx_mmap_SA/dbcache.c
@@ -144,7 +144,7 @@ static VOID CALLBACK DoBufferFlushTimerProc(HWND hwnd, UINT message, UINT_PTR id
void DBFlush(int setting)
{
- if(!setting) {
+ if (!setting) {
log0("nflush1");
if(safetyMode && pDbCache) {
if (FlushViewOfFile(pDbCache, 0) == 0) {
diff --git a/plugins/Dbx_mmap_SA/dbcontacts.c b/plugins/Dbx_mmap_SA/dbcontacts.c
index 0803f1f746..51e533266d 100644
--- a/plugins/Dbx_mmap_SA/dbcontacts.c
+++ b/plugins/Dbx_mmap_SA/dbcontacts.c
@@ -153,7 +153,7 @@ static INT_PTR DeleteContact(WPARAM wParam,LPARAM lParam)
struct DBEvent *dbe;
int index;
- if((HANDLE)wParam==NULL) return 1;
+ if ((HANDLE)wParam==NULL) return 1;
EnterCriticalSection(&csDbAccess);
dbc=(struct DBContact*)DBRead(wParam,sizeof(struct DBContact),NULL);
if(dbc->signature!=DBCONTACT_SIGNATURE) {
diff --git a/plugins/Dbx_mmap_SA/dbevents.c b/plugins/Dbx_mmap_SA/dbevents.c
index afc3838b6d..6ecde67a55 100644
--- a/plugins/Dbx_mmap_SA/dbevents.c
+++ b/plugins/Dbx_mmap_SA/dbevents.c
@@ -135,7 +135,7 @@ static INT_PTR AddEvent(WPARAM wParam,LPARAM lParam)
// Loop through the chain, starting at the end
ofsThis = dbc.ofsLastEvent;
dbeTest = (struct DBEvent*)DBRead(ofsThis, sizeof(struct DBEvent), NULL);
- for(;;) {
+ for (;;) {
// If the new event's timesstamp is equal to or greater than the
// current dbevent, it will be inserted after. If not, continue
// with the previous dbevent in chain.
@@ -159,7 +159,7 @@ static INT_PTR AddEvent(WPARAM wParam,LPARAM lParam)
}
}
dbc.eventCount++;
- if(!(dbe.flags&(DBEF_READ|DBEF_SENT))) {
+ if (!(dbe.flags&(DBEF_READ|DBEF_SENT))) {
if(dbe.timestamp<dbc.timestampFirstUnread || dbc.timestampFirstUnread==0) {
dbc.timestampFirstUnread=dbe.timestamp;
dbc.ofsFirstUnreadEvent=ofsNew;
@@ -209,7 +209,7 @@ static INT_PTR DeleteEvent(WPARAM wParam,LPARAM lParam)
//check if this was the first unread, if so, recalc the first unread
if(dbc.ofsFirstUnreadEvent==(DWORD)lParam) {
dbeNext=&dbe;
- for(;;) {
+ for (;;) {
if(dbeNext->ofsNext==0) {
dbc.ofsFirstUnreadEvent=0;
dbc.timestampFirstUnread=0;
@@ -217,7 +217,7 @@ static INT_PTR DeleteEvent(WPARAM wParam,LPARAM lParam)
}
ofsThis=dbeNext->ofsNext;
dbeNext=(struct DBEvent*)DBRead(ofsThis,sizeof(struct DBEvent),NULL);
- if(!(dbeNext->flags&(DBEF_READ|DBEF_SENT))) {
+ if (!(dbeNext->flags&(DBEF_READ|DBEF_SENT))) {
dbc.ofsFirstUnreadEvent=ofsThis;
dbc.timestampFirstUnread=dbeNext->timestamp;
break;
@@ -390,7 +390,7 @@ static INT_PTR MarkEventRead(WPARAM wParam,LPARAM lParam)
DBWrite(lParam,dbe,sizeof(struct DBEvent));
ret=(int)dbe->flags;
if(dbc.ofsFirstUnreadEvent==(DWORD)lParam) {
- for(;;) {
+ for (;;) {
if(dbe->ofsNext==0) {
dbc.ofsFirstUnreadEvent=0;
dbc.timestampFirstUnread=0;
@@ -398,7 +398,7 @@ static INT_PTR MarkEventRead(WPARAM wParam,LPARAM lParam)
}
ofsThis=dbe->ofsNext;
dbe=(struct DBEvent*)DBRead(ofsThis,sizeof(struct DBEvent),NULL);
- if(!(dbe->flags&(DBEF_READ|DBEF_SENT))) {
+ if (!(dbe->flags&(DBEF_READ|DBEF_SENT))) {
dbc.ofsFirstUnreadEvent=ofsThis;
dbc.timestampFirstUnread=dbe->timestamp;
break;
diff --git a/plugins/Dbx_mmap_SA/dbsettings.c b/plugins/Dbx_mmap_SA/dbsettings.c
index bf876d0570..1d0fb69d62 100644
--- a/plugins/Dbx_mmap_SA/dbsettings.c
+++ b/plugins/Dbx_mmap_SA/dbsettings.c
@@ -327,7 +327,7 @@ static __inline int GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING
NeedBytes(3+*(PWORD)(pBlob+1));
if(isStatic) {
dbcgs->pValue->cchVal--;
- if(*(PWORD)(pBlob+1)<dbcgs->pValue->cchVal) dbcgs->pValue->cchVal=*(PWORD)(pBlob+1);
+ if (*(PWORD)(pBlob+1)<dbcgs->pValue->cchVal) dbcgs->pValue->cchVal=*(PWORD)(pBlob+1);
DecodeCopyMemory(dbcgs->pValue->pszVal,pBlob+3,dbcgs->pValue->cchVal);
dbcgs->pValue->pszVal[dbcgs->pValue->cchVal]=0;
dbcgs->pValue->cchVal=*(PWORD)(pBlob+1);
@@ -341,7 +341,7 @@ static __inline int GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING
case DBVT_BLOB:
NeedBytes(3+*(PWORD)(pBlob+1));
if(isStatic) {
- if(*(PWORD)(pBlob+1)<dbcgs->pValue->cpbVal) dbcgs->pValue->cpbVal=*(PWORD)(pBlob+1);
+ if (*(PWORD)(pBlob+1)<dbcgs->pValue->cpbVal) dbcgs->pValue->cpbVal=*(PWORD)(pBlob+1);
DecodeCopyMemory(dbcgs->pValue->pbVal,pBlob+3,dbcgs->pValue->cpbVal);
}
else {
@@ -749,7 +749,7 @@ static INT_PTR WriteContactSetting(WPARAM wParam, LPARAM lParam)
else bytesRequired=tmp.value.type;
bytesRequired+=2+settingNameLen;
bytesRequired+=ofsBlobPtr+1-(ofsSettingsGroup+offsetof(struct DBContactSettings,blob));
- if((DWORD)bytesRequired>dbcs.cbBlob) {
+ if ((DWORD)bytesRequired>dbcs.cbBlob) {
//doesn't fit: move entire group
struct DBContactSettings *dbcsPrev;
DWORD ofsDbcsPrev,ofsNew;
@@ -879,7 +879,7 @@ static INT_PTR DeleteContactSetting(WPARAM wParam, LPARAM lParam)
MoveAlong(1+GetSettingValueLength(pBlob));
NeedBytes(1);
}
- if(!pBlob[0]) { //setting didn't exist
+ if (!pBlob[0]) { //setting didn't exist
LeaveCriticalSection(&csDbAccess);
return 1;
}
@@ -941,7 +941,7 @@ static INT_PTR EnumContactSettings(WPARAM wParam, LPARAM lParam)
return -1;
}
dbces->ofsSettings=GetSettingsGroupOfsByModuleNameOfs(dbc,ofsModuleName);
- if(!dbces->ofsSettings) {
+ if (!dbces->ofsSettings) {
LeaveCriticalSection(&csDbAccess);
return -1;
}
@@ -986,7 +986,7 @@ void EncodeContactSettings(HANDLE hContact)
struct DBContactSettings * setting;
DWORD offset;
- if(!hContact) hContact = (HANDLE)dbHeader.ofsUser;
+ if (!hContact) hContact = (HANDLE)dbHeader.ofsUser;
contact = (struct DBContact *)DBRead((DWORD)hContact, sizeof(struct DBContact), NULL);
if(contact -> ofsFirstSettings){
setting = (struct DBContactSettings *)DBRead(contact -> ofsFirstSettings, sizeof(struct DBContactSettings), NULL);
@@ -1059,7 +1059,7 @@ void DecodeContactSettings(HANDLE hContact)
DWORD offset;
- if(!hContact) hContact = (HANDLE)dbHeader.ofsUser;
+ if (!hContact) hContact = (HANDLE)dbHeader.ofsUser;
contact = (struct DBContact *)DBRead((DWORD)hContact, sizeof(struct DBContact), NULL);
if(contact -> ofsFirstSettings){
setting = (struct DBContactSettings *)DBRead(contact -> ofsFirstSettings, sizeof(struct DBContactSettings), NULL);
diff --git a/plugins/Dbx_mmap_SA/dialogs.c b/plugins/Dbx_mmap_SA/dialogs.c
index 48c13183f8..15405ff5ee 100644
--- a/plugins/Dbx_mmap_SA/dialogs.c
+++ b/plugins/Dbx_mmap_SA/dialogs.c
@@ -212,7 +212,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
uid = DBGetContactSettingWord(NULL, "SecureMMAP", "CryptoModule", 0);
- for(i = 0; i < ModulesCount; i++){
+ for(i = 0; i < ModulesCount; i++) {
char buf[100];
item.mask = LVIF_TEXT;
@@ -262,7 +262,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if ( hdr && hdr->hdr.code == LVN_ITEMCHANGED && IsWindowVisible(hdr->hdr.hwndFrom) && hdr->iItem != (-1) ) {
iIndex = hdr->iItem;
if(hdr->uNewState & 0x2000){
- for(i = 0; i < ModulesCount; i++){
+ for(i = 0; i < ModulesCount; i++) {
if(i != iIndex) ListView_SetCheckState(hwndList, i, 0);
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -296,19 +296,19 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
if (((LPNMHDR)lParam)->code == PSN_APPLY ) {
int alg = -1;
- for(i = 0; i < ModulesCount; i++){
- if(ListView_GetCheckState(hwndList, i)){
+ for(i = 0; i < ModulesCount; i++) {
+ if(ListView_GetCheckState(hwndList, i)) {
alg = i;
break;
}
}
if(alg > -1){
- if(!bEncoding){
+ if (!bEncoding){
DBWriteContactSettingWord(NULL, "SecureMMAP", "CryptoModule", Modules[alg]->cryptor->uid);
EncryptDB();
}else{
- if(Modules[alg]->cryptor->uid != DBGetContactSettingWord(NULL, "SecureMMAP", "CryptoModule", -1)){
+ if(Modules[alg]->cryptor->uid != DBGetContactSettingWord(NULL, "SecureMMAP", "CryptoModule", -1)) {
DBWriteContactSettingWord(NULL, "SecureMMAP", "CryptoModule", Modules[alg]->cryptor->uid);
RecryptDB();
}
@@ -321,7 +321,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
uid = DBGetContactSettingWord(NULL, "SecureMMAP", "CryptoModule", 0);
- for(i = 0; i < ModulesCount; i++){
+ for(i = 0; i < ModulesCount; i++) {
if(uid == Modules[i]->cryptor->uid && bEncoding)
ListView_SetCheckState(hwndList, i, 1);
@@ -374,7 +374,7 @@ BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ICON2));
SendMessage(GetDlgItem(hDlg, IDC_HEADERBAR), WM_SETICON, 0, (LPARAM)hIcon);
- if(!wrongPass)
+ if (!wrongPass)
{
tszDbName = mir_a2t((char*)lParam);
mir_sntprintf(tszHeaderTxt, SIZEOF(tszHeaderTxt), _T("%s\n%s"), TranslateT("Please type in your password for"), tszDbName);
@@ -419,7 +419,7 @@ BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
UINT uid = LOWORD(wParam);
if(uid == IDOK){
- if(!GetWindowLongPtr(hDlg,GWLP_USERDATA))
+ if (!GetWindowLongPtr(hDlg,GWLP_USERDATA))
{
encryptKeyLength = GetDlgItemTextA(hDlg, IDC_USERPASS, encryptKey, 254);
EndDialog(hDlg,IDOK);
@@ -485,7 +485,7 @@ BOOL CALLBACK DlgStdNewPass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
UINT uid = LOWORD(wParam);
if(uid == IDOK){
- if(!GetWindowLongPtr(hDlg,GWLP_USERDATA))
+ if (!GetWindowLongPtr(hDlg,GWLP_USERDATA))
{
char pass1[255], pass2[255];
if(GetDlgItemTextA(hDlg, IDC_USERPASS1, pass1, 254) < 3){
@@ -496,7 +496,7 @@ BOOL CALLBACK DlgStdNewPass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
}else{
GetDlgItemTextA(hDlg, IDC_USERPASS2, pass2, 254);
- if(!strcmp(pass1, pass2)){
+ if (!strcmp(pass1, pass2)) {
encryptKeyLength = strlen(pass1);
strcpy(encryptKey, pass1);
EndDialog(hDlg,IDOK);
@@ -573,7 +573,7 @@ BOOL CALLBACK DlgChangePass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
if(uid == IDOK){
char pass1[255], pass2[255], oldpass[255];
GetDlgItemTextA(hDlg, IDC_OLDPASS, oldpass, 254);
- if(strcmp(oldpass, encryptKey)){
+ if(strcmp(oldpass, encryptKey)) {
SetWindowText(GetDlgItem(hDlg, IDC_HEADERBAR), TranslateT("Wrong password!"));
SendMessage(GetDlgItem(hDlg, IDC_HEADERBAR), WM_NCPAINT, 0, 0);
break;
@@ -584,7 +584,7 @@ BOOL CALLBACK DlgChangePass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
}else{
GetDlgItemTextA(hDlg, IDC_NEWPASS2, pass2, 254);
- if(!strcmp(pass1, pass2)){
+ if (!strcmp(pass1, pass2)) {
strcpy(newPass, pass1);
EndDialog(hDlg,IDOK);
}else{
@@ -597,7 +597,7 @@ BOOL CALLBACK DlgChangePass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
}else if(uid == IDREMOVE){
char oldpass[255];
GetDlgItemTextA(hDlg, IDC_OLDPASS, oldpass, 254);
- if(strcmp(oldpass, encryptKey)){
+ if(strcmp(oldpass, encryptKey)) {
SetWindowText(GetDlgItem(hDlg, IDC_HEADERBAR), TranslateT("Wrong password!"));
SendMessage(GetDlgItem(hDlg, IDC_HEADERBAR), WM_NCPAINT, 0, 0);
break;
diff --git a/plugins/Dbx_mmap_SA/security.c b/plugins/Dbx_mmap_SA/security.c
index 92a82a4bfe..f4b9b06004 100644
--- a/plugins/Dbx_mmap_SA/security.c
+++ b/plugins/Dbx_mmap_SA/security.c
@@ -59,7 +59,7 @@ void InitSecurity()
}
}
if(ModulesCount >= 100) break;
- if(!FindNextFileA(hFile, &fd)) break;
+ if (!FindNextFileA(hFile, &fd)) break;
}
}
@@ -78,7 +78,7 @@ void UnloadSecurity()
void EncoderInit()
{
- if(!bEncoding) return;
+ if (!bEncoding) return;
encryptKey[encryptKeyLength] = 0;
key = CryptoEngine->GenerateKey(encryptKey);
@@ -88,7 +88,7 @@ void EncodeCopyMemory(void * dst, void * src, size_t size )
{
memcpy(dst, src, size);
- if(!bEncoding)
+ if (!bEncoding)
return;
CryptoEngine->EncryptMem(dst, (int)size, key);
@@ -98,7 +98,7 @@ void DecodeCopyMemory(void * dst, void * src, size_t size )
{
memcpy(dst, src, size);
- if(!bEncoding)
+ if (!bEncoding)
return;
CryptoEngine->DecryptMem(dst, (int)size, key);
@@ -152,14 +152,14 @@ int CheckPassword(WORD checkWord, char * szDBName)
{
int i;
int Found = 0;
- for(i = 0; i < ModulesCount; i++){
+ for(i = 0; i < ModulesCount; i++) {
if(dbHeader.cryptorUID == Modules[i]->cryptor->uid){
CryptoEngine = Modules[i]->cryptor;
Found = 1;
break;
}
}
- if(!Found){
+ if (!Found){
MessageBoxA(0, "Sorry, but your database encrypted with unknown module", "Error", MB_OK);
bCheckingPass = 0;
return 0;
@@ -208,14 +208,14 @@ int SelectEncoder()
}
else{
int Found = 0;
- for(i = 0; i < ModulesCount; i++){
+ for(i = 0; i < ModulesCount; i++) {
if(Modules[i]->cryptor->uid == uid){
CryptoEngine = Modules[i]->cryptor;
Found = 1;
break;
}
}
- if(!Found){
+ if (!Found){
MessageBox(0, TranslateT("Crypto module hasn't been chosen, using first one found"), TranslateT("Notice"), MB_OK);
DBWriteContactSettingWord(NULL, "SecureMMAP", "CryptoModule", Modules[0]->cryptor->uid);
CryptoEngine = Modules[0]->cryptor;
@@ -302,14 +302,14 @@ void EncryptDB()
return;
}
- if(SelectEncoder()){
+ if(SelectEncoder()) {
return;
}
bEncProcess = 1;
action = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_NEWPASS), NULL, (DLGPROC)DlgStdNewPass, (LPARAM)NULL);
- if(action != IDOK || !strlen(encryptKey)){
+ if(action != IDOK || !strlen(encryptKey)) {
bEncProcess = 0;
DBWriteContactSettingByte(NULL, "SecureMMAP", "CryptoModule", 0);
return;
@@ -336,7 +336,7 @@ void DecryptDB()
char oldKey[255];
strcpy(oldKey, encryptKey);
- if(!CheckPassword(dbHeader.checkWord, Translate("current database"))){strcpy(encryptKey, oldKey); encryptKeyLength = strlen(oldKey); return;}
+ if (!CheckPassword(dbHeader.checkWord, Translate("current database"))){strcpy(encryptKey, oldKey); encryptKeyLength = strlen(oldKey); return;}
WritePlainHeader();
diff --git a/plugins/Dbx_tree/sigslot.h b/plugins/Dbx_tree/sigslot.h
index cdf17f3303..1e67a152bf 100644
--- a/plugins/Dbx_tree/sigslot.h
+++ b/plugins/Dbx_tree/sigslot.h
@@ -139,7 +139,7 @@ namespace sigslot {
{
static bool isinitialised = false;
- if(!isinitialised)
+ if (!isinitialised)
{
InitializeCriticalSection(get_critsec());
isinitialised = true;
@@ -545,7 +545,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == pclass)
+ if ((*it)->getdest() == pclass)
{
delete *it;
m_connected_slots.erase(it);
@@ -568,7 +568,7 @@ namespace sigslot {
iterator itNext = it;
++itNext;
- if((*it)->getdest() == pslot)
+ if ((*it)->getdest() == pslot)
{
delete *it;
m_connected_slots.erase(it);
@@ -587,7 +587,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == oldtarget)
+ if ((*it)->getdest() == oldtarget)
{
m_connected_slots.push_back((*it)->duplicate(newtarget));
}
@@ -637,7 +637,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == oldtarget)
+ if ((*it)->getdest() == oldtarget)
{
m_connected_slots.push_back((*it)->duplicate(newtarget));
}
@@ -676,7 +676,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == pclass)
+ if ((*it)->getdest() == pclass)
{
delete *it;
m_connected_slots.erase(it);
@@ -699,7 +699,7 @@ namespace sigslot {
iterator itNext = it;
++itNext;
- if((*it)->getdest() == pslot)
+ if ((*it)->getdest() == pslot)
{
delete *it;
m_connected_slots.erase(it);
@@ -753,7 +753,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == oldtarget)
+ if ((*it)->getdest() == oldtarget)
{
m_connected_slots.push_back((*it)->duplicate(newtarget));
}
@@ -792,7 +792,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == pclass)
+ if ((*it)->getdest() == pclass)
{
delete *it;
m_connected_slots.erase(it);
@@ -815,7 +815,7 @@ namespace sigslot {
iterator itNext = it;
++itNext;
- if((*it)->getdest() == pslot)
+ if ((*it)->getdest() == pslot)
{
delete *it;
m_connected_slots.erase(it);
@@ -868,7 +868,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == oldtarget)
+ if ((*it)->getdest() == oldtarget)
{
m_connected_slots.push_back((*it)->duplicate(newtarget));
}
@@ -907,7 +907,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == pclass)
+ if ((*it)->getdest() == pclass)
{
delete *it;
m_connected_slots.erase(it);
@@ -930,7 +930,7 @@ namespace sigslot {
iterator itNext = it;
++itNext;
- if((*it)->getdest() == pslot)
+ if ((*it)->getdest() == pslot)
{
delete *it;
m_connected_slots.erase(it);
@@ -983,7 +983,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == oldtarget)
+ if ((*it)->getdest() == oldtarget)
{
m_connected_slots.push_back((*it)->duplicate(newtarget));
}
@@ -1022,7 +1022,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == pclass)
+ if ((*it)->getdest() == pclass)
{
delete *it;
this->m_connected_slots.erase(it);
@@ -1045,7 +1045,7 @@ namespace sigslot {
iterator itNext = it;
++itNext;
- if((*it)->getdest() == pslot)
+ if ((*it)->getdest() == pslot)
{
delete *it;
m_connected_slots.erase(it);
@@ -1100,7 +1100,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == oldtarget)
+ if ((*it)->getdest() == oldtarget)
{
m_connected_slots.push_back((*it)->duplicate(newtarget));
}
@@ -1139,7 +1139,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == pclass)
+ if ((*it)->getdest() == pclass)
{
delete *it;
m_connected_slots.erase(it);
@@ -1162,7 +1162,7 @@ namespace sigslot {
iterator itNext = it;
++itNext;
- if((*it)->getdest() == pslot)
+ if ((*it)->getdest() == pslot)
{
delete *it;
m_connected_slots.erase(it);
@@ -1217,7 +1217,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == oldtarget)
+ if ((*it)->getdest() == oldtarget)
{
m_connected_slots.push_back((*it)->duplicate(newtarget));
}
@@ -1256,7 +1256,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == pclass)
+ if ((*it)->getdest() == pclass)
{
delete *it;
m_connected_slots.erase(it);
@@ -1279,7 +1279,7 @@ namespace sigslot {
iterator itNext = it;
++itNext;
- if((*it)->getdest() == pslot)
+ if ((*it)->getdest() == pslot)
{
delete *it;
m_connected_slots.erase(it);
@@ -1334,7 +1334,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == oldtarget)
+ if ((*it)->getdest() == oldtarget)
{
m_connected_slots.push_back((*it)->duplicate(newtarget));
}
@@ -1373,7 +1373,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == pclass)
+ if ((*it)->getdest() == pclass)
{
delete *it;
m_connected_slots.erase(it);
@@ -1396,7 +1396,7 @@ namespace sigslot {
iterator itNext = it;
++itNext;
- if((*it)->getdest() == pslot)
+ if ((*it)->getdest() == pslot)
{
delete *it;
m_connected_slots.erase(it);
@@ -1452,7 +1452,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == oldtarget)
+ if ((*it)->getdest() == oldtarget)
{
m_connected_slots.push_back((*it)->duplicate(newtarget));
}
@@ -1491,7 +1491,7 @@ namespace sigslot {
while(it != itEnd)
{
- if((*it)->getdest() == pclass)
+ if ((*it)->getdest() == pclass)
{
delete *it;
m_connected_slots.erase(it);
@@ -1514,7 +1514,7 @@ namespace sigslot {
iterator itNext = it;
++itNext;
- if((*it)->getdest() == pslot)
+ if ((*it)->getdest() == pslot)
{
delete *it;
m_connected_slots.erase(it);
diff --git a/plugins/ExternalAPI/m_assocmgr.h b/plugins/ExternalAPI/m_assocmgr.h
index 4e15168643..4cb02bb74b 100644
--- a/plugins/ExternalAPI/m_assocmgr.h
+++ b/plugins/ExternalAPI/m_assocmgr.h
@@ -273,13 +273,13 @@ Returns 0 on success, nonzero otherwise.
static __inline char *Netlib_UrlDecode(char *str)
{
char *psz=str;
- for(;*psz;++psz)
+ for (;*psz;++psz)
switch(*psz) {
case '+':
*psz=' ';
break;
case '%':
- if(!psz[1] || !psz[2]) break;
+ if (!psz[1] || !psz[2]) break;
MoveMemory(psz,&psz[1],2);
psz[2]=0;
*psz=(char)strtol(psz,NULL,16);
diff --git a/plugins/ExternalAPI/m_flags.h b/plugins/ExternalAPI/m_flags.h
index aafa2fb251..9760c1b419 100644
--- a/plugins/ExternalAPI/m_flags.h
+++ b/plugins/ExternalAPI/m_flags.h
@@ -47,11 +47,11 @@ Returns a icon handle (HICON) on success, NULL on error.
#if !defined(FLAGS_NOHELPERFUNCTIONS)
__inline static HICON LoadFlagIcon(int countryNumber) {
- if(!ServiceExists(MS_FLAGS_LOADFLAGICON)) return NULL;
+ if (!ServiceExists(MS_FLAGS_LOADFLAGICON)) return NULL;
return (HICON)CallService(MS_FLAGS_LOADFLAGICON,countryNumber,0);
}
__inline static HANDLE LoadFlagIconHandle(int countryNumber) {
- if(!ServiceExists(MS_FLAGS_LOADFLAGICON)) return NULL;
+ if (!ServiceExists(MS_FLAGS_LOADFLAGICON)) return NULL;
return (HICON)CallService(MS_FLAGS_LOADFLAGICON,countryNumber,1);
}
#endif
diff --git a/plugins/ExternalAPI/m_help.h b/plugins/ExternalAPI/m_help.h
index 04425a5e8d..fa7434695f 100644
--- a/plugins/ExternalAPI/m_help.h
+++ b/plugins/ExternalAPI/m_help.h
@@ -60,7 +60,7 @@ Returns 0 on success or nonzero on failure
// only works for non-editable
#if !defined(HELP_NOHELPERFUNCTIONS)
__inline static int Help_SetContextState(HWND hwndCtl,DWORD flags) {
- if(!ServiceExists(MS_HELP_SETCONTEXTSTATE)) return -1;
+ if (!ServiceExists(MS_HELP_SETCONTEXTSTATE)) return -1;
return CallService(MS_HELP_SETCONTEXTSTATE,(WPARAM)hwndCtl,flags);
}
#endif
diff --git a/plugins/ExternalAPI/m_mails.h b/plugins/ExternalAPI/m_mails.h
index 06bd9dfd80..cb168e34e9 100644
--- a/plugins/ExternalAPI/m_mails.h
+++ b/plugins/ExternalAPI/m_mails.h
@@ -147,7 +147,7 @@ typedef struct CMimeMsgQueue
void *PluginData;
CMimeMsgQueue(): ID(NULL), Number(0), Flags(0), MailData(NULL), MsgWindow(NULL), PluginData(NULL), Next(NULL){}
- ~CMimeMsgQueue(){}
+ ~CMimeMsgQueue() {}
struct CMimeMsgQueue *Next;
} YAMNMAIL,*HYAMNMAIL;
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp
index 53e8875657..4f24c2e362 100644
--- a/plugins/FavContacts/src/main.cpp
+++ b/plugins/FavContacts/src/main.cpp
@@ -58,7 +58,7 @@ PLUGININFOEX pluginInfo = {
HWND g_hwndMenuHost = NULL;
static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
-static BOOL CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static void sttLoadOptions();
static void sttSaveOptions();
@@ -1224,7 +1224,7 @@ static void sttActivateOptionsPage(HWND hwnd, TCHAR *aSection, TCHAR *aPage)
}
}
-static BOOL CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static bool bInitialized = false;
static HANDLE hSelectedContact = 0;
diff --git a/plugins/FingerPrintModPlus/src/fingerprint.cpp b/plugins/FingerPrintModPlus/src/fingerprint.cpp
index 5e3e2ba619..8a729bad7c 100644
--- a/plugins/FingerPrintModPlus/src/fingerprint.cpp
+++ b/plugins/FingerPrintModPlus/src/fingerprint.cpp
@@ -208,7 +208,7 @@ extern "C" int __declspec(dllexport) Unload()
*/
void FASTCALL FreeIcon(HICON hIcon, BOOL mode)
{
- if(!mode) return;
+ if (!mode) return;
if(mode > 0)
CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, (WPARAM)0);
else
@@ -221,7 +221,7 @@ void FASTCALL FreeIcon(HICON hIcon, BOOL mode)
*/
void FASTCALL Prepare(KN_FP_MASK* mask)
{
- if(!mask->szMask) return;
+ if (!mask->szMask) return;
size_t iMaskLen;
LPTSTR pszNewMask;
LPTSTR pszTranslatedMask;
@@ -404,7 +404,7 @@ int OnPreShutdown(WPARAM wParam, LPARAM lParam)
UnhookEvent(hPreShutdown);
UnhookEvent(hIconsChanged);
UnhookEvent(hOptInitialise);
- if(!g_bExtraIcon_Register_ServiceExist) UninitFingerEvents();
+ if (!g_bExtraIcon_Register_ServiceExist) UninitFingerEvents();
UnhookEvent(hFolderChanged);
DestroyServiceFunction(compClientServA);
DestroyServiceFunction(getClientIconA);
@@ -513,7 +513,7 @@ int OnExtraImageApply(WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbvMirVer = { 0 };
- if(!DBGetContactSettingTString(hContact, szProto, "MirVer", &dbvMirVer))
+ if (!DBGetContactSettingTString(hContact, szProto, "MirVer", &dbvMirVer))
{
ApplyFingerprintImage(hContact, dbvMirVer.ptszVal);
DBFreeVariant(&dbvMirVer);
@@ -532,7 +532,7 @@ int OnExtraImageApply(WPARAM wParam, LPARAM lParam)
*/
int OnContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
- if((HANDLE)wParam == NULL) return 0;
+ if ((HANDLE)wParam == NULL) return 0;
{
DBCONTACTWRITESETTING* cws = (DBCONTACTWRITESETTING*)lParam;
if(cws && cws->szSetting && !strcmp(cws->szSetting, "MirVer"))
@@ -648,7 +648,7 @@ HICON FASTCALL LoadIconFromExternalFile(LPTSTR filename, int nLibrary, LPSTR Ico
if(nLibrary == LIB_USE)
{
hIcon = ((HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)IconName));
- if(!hIcon)
+ if (!hIcon)
{
ExtractIconEx(destfile, -internalidx, NULL, &hIcon, 1);
return hIcon;
@@ -712,7 +712,7 @@ HICON FASTCALL LoadIconFromExternalFile(LPTSTR filename, int nLibrary, LPSTR Ico
*/
BOOL FASTCALL WildCompareA(LPSTR szName, LPSTR szMask)
{
- if(*szMask != '|') return WildCompareProcA(szName, szMask);
+ if (*szMask != '|') return WildCompareProcA(szName, szMask);
{
size_t s = 1, e = 1;
// static char temp[100]; //lets made temp static local var - should be faster than dynamic
@@ -768,7 +768,7 @@ BOOL FASTCALL WildCompareA(LPSTR szName, LPSTR szMask)
*/
BOOL FASTCALL WildCompareW(LPWSTR wszName, LPWSTR wszMask)
{
- if(*wszMask != L'|') return WildCompareProcW(wszName, wszMask);
+ if (*wszMask != L'|') return WildCompareProcW(wszName, wszMask);
{
size_t s = 1, e = 1;
// static char temp[100]; //lets made temp static local var - should be faster than dynamic
@@ -1003,21 +1003,21 @@ int OnOptInitialise(WPARAM wParam, LPARAM lParam)
BOOL __inline WildCompareProcA(LPSTR szName, LPSTR szMask)
{
LPSTR szLast = NULL;
- for(;; szMask++, szName++)
+ for (;; szMask++, szName++)
{
- if(*szMask != '?' && *szMask != *szName) break;
- if(*szName == '\0') return ((BOOL)!*szMask);
+ if (*szMask != '?' && *szMask != *szName) break;
+ if (*szName == '\0') return ((BOOL)!*szMask);
}
- if(*szMask != '*') return FALSE;
- for(;; szMask++, szName++)
+ if (*szMask != '*') return FALSE;
+ for (;; szMask++, szName++)
{
while(*szMask == '*')
{
szLast = szMask++;
- if(*szMask == '\0') return ((BOOL)!*szMask); /* true */
+ if (*szMask == '\0') return ((BOOL)!*szMask); /* true */
}
- if(*szName == '\0') return ((BOOL)!*szMask); /* *mask == EOS */
- if(*szMask != '?' && *szMask != *szName && szLast != NULL)
+ if (*szName == '\0') return ((BOOL)!*szMask); /* *mask == EOS */
+ if (*szMask != '?' && *szMask != *szName && szLast != NULL)
{
szName -= (size_t)(szMask - szLast) - 1;
szMask = szLast;
@@ -1028,21 +1028,21 @@ BOOL __inline WildCompareProcA(LPSTR szName, LPSTR szMask)
BOOL __inline WildCompareProcW(LPWSTR wszName, LPWSTR wszMask)
{
LPWSTR wszLast = NULL;
- for(;; wszMask++, wszName++)
+ for (;; wszMask++, wszName++)
{
- if(*wszMask != L'?' && *wszMask != *wszName) break;
- if(*wszName == L'\0') return ((BOOL)!*wszMask);
+ if (*wszMask != L'?' && *wszMask != *wszName) break;
+ if (*wszName == L'\0') return ((BOOL)!*wszMask);
}
- if(*wszMask != L'*') return FALSE;
- for(;; wszMask++, wszName++)
+ if (*wszMask != L'*') return FALSE;
+ for (;; wszMask++, wszName++)
{
while(*wszMask == L'*')
{
wszLast = wszMask++;
- if(*wszMask == L'\0') return ((BOOL)!*wszMask); /* true */
+ if (*wszMask == L'\0') return ((BOOL)!*wszMask); /* true */
}
- if(*wszName == L'\0') return ((BOOL)!*wszMask); /* *mask == EOS */
- if(*wszMask != L'?' && *wszMask != *wszName && wszLast != NULL)
+ if (*wszName == L'\0') return ((BOOL)!*wszMask); /* *mask == EOS */
+ if (*wszMask != L'?' && *wszMask != *wszName && wszLast != NULL)
{
wszName -= (size_t)(wszMask - wszLast) - 1;
wszMask = wszLast;
@@ -1098,7 +1098,7 @@ void FASTCALL GetIconsIndexesA(LPSTR szMirVer, short *base, short *overlay,short
}
i++;
}
- if(!def_kn_fp_mask[i].fNotUseOverlay && i < DEFAULT_KN_FP_MASK_COUNT)
+ if (!def_kn_fp_mask[i].fNotUseOverlay && i < DEFAULT_KN_FP_MASK_COUNT)
{
j = 0;
while(j < DEFAULT_KN_FP_OVERLAYS_COUNT)
@@ -1184,7 +1184,7 @@ void FASTCALL GetIconsIndexesW(LPWSTR wszMirVer, short *base, short *overlay,sho
}
i++;
}
- if(!def_kn_fp_mask[i].fNotUseOverlay && i < DEFAULT_KN_FP_MASK_COUNT)
+ if (!def_kn_fp_mask[i].fNotUseOverlay && i < DEFAULT_KN_FP_MASK_COUNT)
{
j = 0;
while(j < DEFAULT_KN_FP_OVERLAYS_COUNT)
@@ -1347,7 +1347,7 @@ INT_PTR ServiceSameClientsA(WPARAM wParam, LPARAM lParam)
BOOL Result = FALSE;
firstIndex = secondIndex = 0;
- if(!szMirVerFirst || !szMirVerSecond) return (INT_PTR)NULL; //one of its is not null
+ if (!szMirVerFirst || !szMirVerSecond) return (INT_PTR)NULL; //one of its is not null
{
LPTSTR tszMirVerFirstUp, tszMirVerSecondUp;
@@ -1467,7 +1467,7 @@ INT_PTR ServiceSameClientsW(WPARAM wParam, LPARAM lParam)
BOOL Result = FALSE;
firstIndex = secondIndex = 0;
- if(!wszMirVerFirst || !wszMirVerSecond) return (INT_PTR)NULL; //one of its is not null
+ if (!wszMirVerFirst || !wszMirVerSecond) return (INT_PTR)NULL; //one of its is not null
{
LPWSTR wszMirVerFirstUp, wszMirVerSecondUp;
@@ -1570,7 +1570,7 @@ BOOL FASTCALL checkHasAlfa(LPBYTE from, int width, int height)
LPDWORD lim = pt + width * height;
while(pt < lim)
{
- if(*pt & 0xFF000000)
+ if (*pt & 0xFF000000)
return TRUE;
pt++;
}
@@ -1737,7 +1737,7 @@ HICON FASTCALL CreateJoinedIcon(HICON hBottom, HICON hTop)
else
top_d |= 0xFF000000;
}
- else if(!topHasAlpha)
+ else if (!topHasAlpha)
top_d |= 0xFF000000;
if(bottomMaskUsed)
@@ -1747,7 +1747,7 @@ HICON FASTCALL CreateJoinedIcon(HICON hBottom, HICON hTop)
else
bottom_d |= 0xFF000000;
}
- else if(!bottomHasAlpha)
+ else if (!bottomHasAlpha)
bottom_d |= 0xFF000000;
((LPDWORD)db)[x] = blend(bottom_d, top_d);
@@ -1769,7 +1769,7 @@ HICON FASTCALL CreateJoinedIcon(HICON hBottom, HICON hTop)
DeleteObject(iciTop.hbmMask);
}
- if(!drawn)
+ if (!drawn)
{
DrawIconEx(tempDC, 0, 0, hBottom, 16, 16, 0, NULL, DI_NORMAL);
DrawIconEx(tempDC, 0, 0, hTop, 16, 16, 0, NULL, DI_NORMAL);
diff --git a/plugins/FingerPrintModPlus/src/utilities.cpp b/plugins/FingerPrintModPlus/src/utilities.cpp
index 9998d056d1..35a5bf0647 100644
--- a/plugins/FingerPrintModPlus/src/utilities.cpp
+++ b/plugins/FingerPrintModPlus/src/utilities.cpp
@@ -118,7 +118,7 @@ LPSTR make_utf8_string(LPCWSTR unicode)
LPSTR out;
WORD c;
- if(!unicode) return NULL;
+ if (!unicode) return NULL;
/* first calculate the size of the target string */
c = (WORD)unicode[index++];
@@ -151,11 +151,11 @@ LPWSTR make_unicode_string_static(LPCSTR utf8, LPWSTR unicode, size_t unicode_le
while(c)
{
if(out_index + 1 >= unicode_len) break;
- if((c & 0x80) == 0)
+ if ((c & 0x80) == 0)
{
unicode[out_index++] = c;
}
- else if((c & 0xe0) == 0xe0)
+ else if ((c & 0xe0) == 0xe0)
{
unicode[out_index] = (c & 0x1F) << 12;
c = (BYTE)utf8[index++];
@@ -182,17 +182,17 @@ LPWSTR make_unicode_string(LPCSTR utf8)
LPWSTR out;
BYTE c;
- if(!utf8) return NULL;
+ if (!utf8) return NULL;
/* first calculate the size of the target string */
c = (BYTE)utf8[index++];
while(c)
{
- if((c & 0x80) == 0)
+ if ((c & 0x80) == 0)
{
index += 0;
}
- else if((c & 0xe0) == 0xe0)
+ else if ((c & 0xe0) == 0xe0)
{
index += 2;
}
@@ -216,20 +216,20 @@ int UTF8_IsValid(LPCSTR pszInput)
int nb, i;
LPCSTR c = pszInput;
- if(!pszInput) return 0;
+ if (!pszInput) return 0;
for(c = pszInput; *c; c += (nb + 1))
{
- if(!(*c & 0x80)) nb = 0;
- else if((*c & 0xc0) == 0x80) return 0;
- else if((*c & 0xe0) == 0xc0) nb = 1;
- else if((*c & 0xf0) == 0xe0) nb = 2;
+ if (!(*c & 0x80)) nb = 0;
+ else if ((*c & 0xc0) == 0x80) return 0;
+ else if ((*c & 0xe0) == 0xc0) nb = 1;
+ else if ((*c & 0xf0) == 0xe0) nb = 2;
else if ((*c & 0xf8) == 0xf0) nb = 3;
else if ((*c & 0xfc) == 0xf8) nb = 4;
else if ((*c & 0xfe) == 0xfc) nb = 5;
for(i = 1; i <= nb; i++) // we this forward, do not cross end of string
- if((*(c + i) & 0xc0) != 0x80)
+ if ((*(c + i) & 0xc0) != 0x80)
return 0;
}
@@ -241,7 +241,7 @@ int utf8_decode_static(LPCSTR from, LPSTR to, int to_size)
{
int nResult = 0;
// Validate the string
- if(!UTF8_IsValid(from))
+ if (!UTF8_IsValid(from))
return 0;
// Use the native conversion routines when available
diff --git a/plugins/FlashAvatars/TigerHash.cpp b/plugins/FlashAvatars/TigerHash.cpp
index 5c680e5d8f..406676f0a5 100644
--- a/plugins/FlashAvatars/TigerHash.cpp
+++ b/plugins/FlashAvatars/TigerHash.cpp
@@ -166,7 +166,7 @@ void TigerHash::update(const void* data, size_t length) {
pos += n;
length -= n;
- if((tmppos + n) == BLOCK_SIZE) {
+ if ((tmppos + n) == BLOCK_SIZE) {
#ifdef TIGER_BIG_ENDIAN
for(j=0; j<BLOCK_SIZE; j++)
buf[j^7]=((uint8_t*)tmp)[j];
diff --git a/plugins/FlashAvatars/cflash.cpp b/plugins/FlashAvatars/cflash.cpp
index 5ab6e1379a..78eaf7912c 100644
--- a/plugins/FlashAvatars/cflash.cpp
+++ b/plugins/FlashAvatars/cflash.cpp
@@ -127,7 +127,7 @@ LPAtlAxAttachControl MyAtlAxAttachControl;
}
static bool DownloadFlashFile(char *url, const TCHAR* save_file, int recurse_count /*=0*/) {
- if(!url || recurse_count > 5) {
+ if (!url || recurse_count > 5) {
return false;
}
@@ -204,7 +204,7 @@ static void __cdecl loadFlash_Thread(void *p) {
fgd.cbSize = sizeof(FOLDERSGETDATA);
fgd.nMaxPathSize = MAX_PATH;
fgd.szPathT = path;
- if(!hAvatarsFolder || CallService(MS_FOLDERS_GET_PATH, (WPARAM)hAvatarsFolder, (LPARAM)&fgd)) {
+ if (!hAvatarsFolder || CallService(MS_FOLDERS_GET_PATH, (WPARAM)hAvatarsFolder, (LPARAM)&fgd)) {
if(ServiceExists(MS_UTILS_REPLACEVARS)) {
TCHAR *tmpPath = Utils_ReplaceVarsT(_T("%miranda_avatarcache%"));
mir_sntprintf(path, MAX_PATH, _T("%s\\%s"), tmpPath, _T("Flash"));
@@ -305,7 +305,7 @@ static void prepareFlash(char* pProto, const char* pUrl, FLASHAVATAR& fa, IShock
//loadFlash(new FlashPair(make_pair(fa, flash)));
}
-static int destroyAvatar(WPARAM wParam, LPARAM)
+static INT_PTR destroyAvatar(WPARAM wParam, LPARAM)
{
flash_avatar_item key(((FLASHAVATAR*)wParam)->hContact, *(FLASHAVATAR*)wParam, NULL);
@@ -324,7 +324,7 @@ static int destroyAvatar(WPARAM wParam, LPARAM)
return 0;
}
-static int makeAvatar(WPARAM wParam, LPARAM)
+static INT_PTR makeAvatar(WPARAM wParam, LPARAM)
{
debug("Searching for flash avatar...\n");
FLASHAVATAR* hFA = (FLASHAVATAR*)wParam;
@@ -348,7 +348,7 @@ static int makeAvatar(WPARAM wParam, LPARAM)
}
}
- if(!avatarOK) return 0;
+ if (!avatarOK) return 0;
debug("Avatar found...\n");
char* url = NULL;
@@ -411,7 +411,7 @@ static int makeAvatar(WPARAM wParam, LPARAM)
return 0;
}
-static int resizeAvatar(WPARAM wParam, LPARAM lParam)
+static INT_PTR resizeAvatar(WPARAM wParam, LPARAM lParam)
{
FLASHAVATAR* hFA = (FLASHAVATAR*)wParam;
RECT rc = *((LPRECT)lParam);
@@ -425,7 +425,7 @@ static int resizeAvatar(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int setPos(WPARAM wParam, LPARAM lParam)
+static INT_PTR setPos(WPARAM wParam, LPARAM lParam)
{
FLASHAVATAR* hFA = (FLASHAVATAR*)wParam;
RECT rc = *((LPRECT)lParam);
@@ -439,7 +439,7 @@ static int setPos(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int getInfo(WPARAM wParam, LPARAM)
+static INT_PTR getInfo(WPARAM wParam, LPARAM)
{
FLASHAVATAR* hFA = (FLASHAVATAR*)wParam;
flash_avatar_item key(hFA->hContact, *hFA, NULL);
@@ -455,7 +455,7 @@ static int getInfo(WPARAM wParam, LPARAM)
return 0;
}
-static int setEmoFace(WPARAM wParam, LPARAM lParam)
+static INT_PTR setEmoFace(WPARAM wParam, LPARAM lParam)
{
FLASHAVATAR* hFA = (FLASHAVATAR*)wParam;
flash_avatar_item key(hFA->hContact, *hFA, NULL);
@@ -469,7 +469,7 @@ static int setEmoFace(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int setBkColor(WPARAM wParam, LPARAM lParam)
+static INT_PTR setBkColor(WPARAM wParam, LPARAM lParam)
{
FLASHAVATAR* hFA = (FLASHAVATAR*)wParam;
COLORREF clr = (COLORREF)lParam;
@@ -543,7 +543,7 @@ static int eventAdded(WPARAM wParam, LPARAM lParam)
//size_t aLen = strlen((char *)dbei.pBlob)+1;
char* face = NULL;
- if( (strstr((char*)dbei.pBlob, (char*)":-)") != NULL) ||
+ if ( (strstr((char*)dbei.pBlob, (char*)":-)") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":)") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)";)") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)";-)") != NULL) ||
@@ -553,24 +553,24 @@ static int eventAdded(WPARAM wParam, LPARAM lParam)
(strstr((char*)dbei.pBlob, (char*)":-P") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)"*Drink*") != NULL)) { face = AV_SMILE; }
else
- if( (strstr((char*)dbei.pBlob, (char*)":-(") != NULL) ||
+ if ( (strstr((char*)dbei.pBlob, (char*)":-(") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":-$") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":-!") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":-X") != NULL)) { face = AV_SAD; }
else
- if( (strstr((char*)dbei.pBlob, (char*)"*JOKINGLY*") != NULL) ||
+ if ( (strstr((char*)dbei.pBlob, (char*)"*JOKINGLY*") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":-D") != NULL)) { face = AV_LAUGH; }
else
- if( (strstr((char*)dbei.pBlob, (char*)":'(") != NULL) ||
+ if ( (strstr((char*)dbei.pBlob, (char*)":'(") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":'-(") != NULL)) { face = AV_CRY; }
else
- if( (strstr((char*)dbei.pBlob, (char*)">:o") != NULL) ||
+ if ( (strstr((char*)dbei.pBlob, (char*)">:o") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":-@") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)"*STOP*") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)"]:->") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)"@=") != NULL)) { face = AV_MAD; }
else
- if( (strstr((char*)dbei.pBlob, (char*)":-*") != NULL) ||
+ if ( (strstr((char*)dbei.pBlob, (char*)":-*") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)":-[") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)"*KISSED*") != NULL) ||
(strstr((char*)dbei.pBlob, (char*)"*KISSING*") != NULL) ||
@@ -597,11 +597,14 @@ static int eventAdded(WPARAM wParam, LPARAM lParam)
return 0;
}
+typedef BOOL (__stdcall *pfnAtlAxWinInit)( void );
static int systemModulesLoaded(WPARAM /*wParam*/, LPARAM /*lParam*/)
{
HMODULE hAtl = LoadLibrary(_T("atl"));
- void* init = GetProcAddress(hAtl, "AtlAxWinInit"); _asm call init;
+ pfnAtlAxWinInit init = (pfnAtlAxWinInit)GetProcAddress(hAtl, "AtlAxWinInit");
+ if (init)
+ init();
MyAtlAxAttachControl = (LPAtlAxAttachControl)GetProcAddress(hAtl, "AtlAxAttachControl");
hServices[0] = CreateServiceFunction(MS_FAVATAR_DESTROY, destroyAvatar);
diff --git a/plugins/FlashAvatars/stdafx.h b/plugins/FlashAvatars/stdafx.h
index 693caae144..6113744e85 100644
--- a/plugins/FlashAvatars/stdafx.h
+++ b/plugins/FlashAvatars/stdafx.h
@@ -15,7 +15,10 @@
# define _STLP_DEBUG 1
#endif
-#define _USE_32BIT_TIME_T
+#ifndef _WIN64
+ #define _USE_32BIT_TIME_T
+#endif
+
#define _STLP_DONT_USE_SHORT_STRING_OPTIM 1 // Uses small string buffer, so it saves memory for a lot of strings
#define _STLP_USE_PTR_SPECIALIZATIONS 1 // Reduces some code bloat
#define _STLP_USE_TEMPLATE_EXPRESSION 1 // Speeds up string concatenation
diff --git a/plugins/FloatingContacts/bitmap_funcs.cpp b/plugins/FloatingContacts/bitmap_funcs.cpp
index 3d92e7a9d8..a99b5c4afe 100644
--- a/plugins/FloatingContacts/bitmap_funcs.cpp
+++ b/plugins/FloatingContacts/bitmap_funcs.cpp
@@ -97,16 +97,12 @@ void MyBitmap::setAlphaRect(int x1, int y1, int x2, int y2, BYTE level)
GdiFlush();
for (int i = y1; i < y2; i++)
- for (int j = x1; j < x2; j++)
- {
+ for (int j = x1; j < x2; j++) {
int idx = i * width + j;
if (bits[idx] & 0xff000000)
- {
bits[idx] = rgba(getr(bits[idx])*level/255, getg(bits[idx])*level/255, getb(bits[idx])*level/255, geta(bits[idx])*level/255);
- } else
- {
+ else
bits[idx] = rgba(getr(bits[idx])*level/255, getg(bits[idx])*level/255, getb(bits[idx])*level/255, level);
- }
}
}
@@ -125,8 +121,7 @@ void MyBitmap::makeOpaqueRect(int x1, int y1, int x2, int y2)
GdiFlush();
for (int i = y1; i < y2; i++)
- for (int j = x1; j < x2; j++)
- {
+ for (int j = x1; j < x2; j++) {
int idx = i * width + j;
bits[idx] |= 0xff000000;
}
@@ -155,7 +150,7 @@ void MyBitmap::saveAlpha(int x, int y, int w, int h)
{
if (j+x < 0) continue;
if (j+x >= width) break;
- *p1++ = *p2++;
+ *p1++=*p2++;
}
}
}
@@ -636,8 +631,8 @@ void MyBitmap::DrawNoAlpha(MyBitmap *bmp, int x, int y, int w, int h)
static __forceinline int ReadP(long *p, int w, int h, int x, int y, int k)
{
- if (x<0) x=0; else if (x>=w) x=w-1;
- if (y<0) y=0; else if (y>=h) y=h-1;
+ if (x<0) x = 0; else if (x>=w) x = w-1;
+ if (y<0) y = 0; else if (y>=h) y = h-1;
return p[(x+y*w)*4+k];
}
@@ -682,9 +677,9 @@ void MyBitmap::Blur(int w, int h)
dst = buf_dst;
float mul = 1.f/((w*2+1)*(h*2+1));
- for (y=0;y<height;y++)
+ for (y = 0;y<height;y++)
{
- for (int x=0;x<width;x++)
+ for (int x = 0;x<width;x++)
{
for (int k = 0; k < 4; ++k)
{
@@ -805,23 +800,23 @@ void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength)
sz.cx += (blur+2)*2; sz.cy += (blur+2)*2;
x -= blur+2; y -= blur+2;
- static BYTE pbGammaWeight[256]={0};
- static BOOL bGammaWeightFilled=FALSE;
+ static BYTE pbGammaWeight[256] = {0};
+ static BOOL bGammaWeightFilled = FALSE;
if (!bGammaWeightFilled)
{
int i;
- for(i=0;i<256;i++)
+ for(i = 0;i<256;i++)
{
double f;
- double gamma=(double)700/1000;
+ double gamma = (double)700/1000;
- f=(double)i/255;
- f=pow(f,(1/gamma));
+ f = (double)i/255;
+ f = pow(f,(1/gamma));
- pbGammaWeight[i]=(BYTE)(255*f);
+ pbGammaWeight[i] = (BYTE)(255*f);
}
- bGammaWeightFilled=1;
+ bGammaWeightFilled = 1;
}
MyBitmap tmp(sz.cx, sz.cy);
@@ -875,22 +870,22 @@ void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength)
{
COLOR32 bx,rx,gx,mx;
{
- bx=pbGammaWeight[getb(row_src[j])];
- gx=pbGammaWeight[getg(row_src[j])];
- rx=pbGammaWeight[getr(row_src[j])];
+ bx = pbGammaWeight[getb(row_src[j])];
+ gx = pbGammaWeight[getg(row_src[j])];
+ rx = pbGammaWeight[getr(row_src[j])];
}
- bx=(pbGammaWeight[bx]*(255-b)+bx*(b))/255;
- gx=(pbGammaWeight[gx]*(255-g)+gx*(g))/255;
- rx=(pbGammaWeight[rx]*(255-r)+rx*(r))/255;
+ bx = (pbGammaWeight[bx]*(255-b)+bx*(b))/255;
+ gx = (pbGammaWeight[gx]*(255-g)+gx*(g))/255;
+ rx = (pbGammaWeight[rx]*(255-r)+rx*(r))/255;
- mx=(BYTE)(max(max(bx,rx),gx));
+ mx = (BYTE)(max(max(bx,rx),gx));
if (1)
{
- bx=(bx<mx)?(BYTE)(((WORD)bx*7+(WORD)mx)>>3):bx;
- rx=(rx<mx)?(BYTE)(((WORD)rx*7+(WORD)mx)>>3):rx;
- gx=(gx<mx)?(BYTE)(((WORD)gx*7+(WORD)mx)>>3):gx;
+ bx = (bx<mx)?(BYTE)(((WORD)bx*7+(WORD)mx)>>3):bx;
+ rx = (rx<mx)?(BYTE)(((WORD)rx*7+(WORD)mx)>>3):rx;
+ gx = (gx<mx)?(BYTE)(((WORD)gx*7+(WORD)mx)>>3):gx;
// reduce boldeness at white fonts
}
COLOR32 cl = row_dst[j];
@@ -898,24 +893,24 @@ void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength)
{
COLOR32 rrx,grx,brx;
COLOR32 rlx,glx,blx;
- COLOR32 axx=geta(cl);
- COLOR32 mmx=(bx+gx+rx)/3;
- COLOR32 nx=mmx;;//pbGammaWeight[mx];//
+ COLOR32 axx = geta(cl);
+ COLOR32 mmx = (bx+gx+rx)/3;
+ COLOR32 nx = mmx;;//pbGammaWeight[mx];//
{
//Normalize components to alpha level
- bx=(nx*(255-axx)+bx*axx)/255;
- gx=(nx*(255-axx)+gx*axx)/255;
- rx=(nx*(255-axx)+rx*axx)/255;
- mx=(nx*(255-axx)+mmx*axx)/255;
+ bx = (nx*(255-axx)+bx*axx)/255;
+ gx = (nx*(255-axx)+gx*axx)/255;
+ rx = (nx*(255-axx)+rx*axx)/255;
+ mx = (nx*(255-axx)+mmx*axx)/255;
}
{
blx = getb(cl);
glx = getg(cl);
rlx = getr(cl);
- brx=(b-blx)*bx/255;
- grx=(g-glx)*gx/255;
- rrx=(r-rlx)*rx/255;
+ brx = (b-blx)*bx/255;
+ grx = (g-glx)*gx/255;
+ rrx = (r-rlx)*rx/255;
row_dst[j] = rgba(rlx+rrx, glx+grx, blx+brx, mx+(255-mx)*axx/255);
}
}
@@ -924,7 +919,7 @@ void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength)
}
// based on code by Yuriy Zaporozhets from:
-// http://www.codeproject.com/gdi/coolrgn.asp?df=100&forumid=739&exp=0&select=6341
+// http://www.codeproject.com/gdi/coolrgn.asp?df = 100&forumid = 739&exp = 0&select = 6341
// slightly modified to integrate with MyBitmap class.
HRGN MyBitmap::buildOpaqueRgn(int level, bool opaque)
{
@@ -1008,7 +1003,7 @@ static int hex2dec(char hex)
bool MyBitmap::loadFromFile_pixel(const char *fn, const char *fnAlpha)
{
allocate(1,1);
- int r, g, b, a=255;
+ int r, g, b, a = 255;
const char *p = fn + lstrlenA("pixel:");
r = (hex2dec(p[0]) << 4) + hex2dec(p[1]);
g = (hex2dec(p[2]) << 4) + hex2dec(p[3]);
@@ -1024,7 +1019,7 @@ bool MyBitmap::loadFromFile_gradient(const char *fn, const char *fnAlpha)
if (*p == 'h') allocate(256,1);
else allocate(1,256);
- int r, g, b, a=255;
+ int r, g, b, a = 255;
p += 2;
r = (hex2dec(p[0]) << 4) + hex2dec(p[1]);
@@ -1082,8 +1077,8 @@ bool MyBitmap::loadFromFile_png(const char *fn, const char *fnAlpha)
if (!cbFileSize) return false;
- BITMAPINFO *bi=(BITMAPINFO*)pDib;
- BYTE *pt=(BYTE*)bi;
+ BITMAPINFO *bi = (BITMAPINFO*)pDib;
+ BYTE *pt = (BYTE*)bi;
pt+=bi->bmiHeader.biSize;
if (bi->bmiHeader.biBitCount != 32)
@@ -1099,16 +1094,16 @@ bool MyBitmap::loadFromFile_png(const char *fn, const char *fnAlpha)
} else
{
allocate(abs(bi->bmiHeader.biWidth), abs(bi->bmiHeader.biHeight));
- BYTE *p2=(BYTE *)pt;
- for (int y=0; y<bi->bmiHeader.biHeight; ++y)
+ BYTE *p2 = (BYTE *)pt;
+ for (int y = 0; y<bi->bmiHeader.biHeight; ++y)
{
- BYTE *p1=(BYTE *)bits + (bi->bmiHeader.biHeight-y-1)*bi->bmiHeader.biWidth*4;
- for (int x=0; x<bi->bmiHeader.biWidth; ++x)
+ BYTE *p1 = (BYTE *)bits + (bi->bmiHeader.biHeight-y-1)*bi->bmiHeader.biWidth*4;
+ for (int x = 0; x<bi->bmiHeader.biWidth; ++x)
{
- p1[0]= p2[0];
- p1[1]= p2[1];
- p1[2]= p2[2];
- p1[3]= p2[3];
+ p1[0] = p2[0];
+ p1[1] = p2[1];
+ p1[2] = p2[2];
+ p1[3] = p2[3];
p1 += 4;
p2 += 4;
}
@@ -1138,7 +1133,7 @@ bool MyBitmap::loadFromFile_default(const char *fn, const char *fnAlpha)
HDC dcTmp = CreateCompatibleDC(0);
GetBitmapDimensionEx(hBmpLoaded, &sz);
- HBITMAP hBmpDcSave = (HBITMAP)SelectObject(dcTmp, hBmpLoaded);
+ HBITMAP hBmpDcSave = (HBITMAP)SelectObject(dcTmp, hBmpLoaded);
allocate(sz.cx, sz.cy);
BitBlt(dcBmp, 0, 0, width, height, dcTmp, 0, 0, SRCCOPY);
diff --git a/plugins/FloatingContacts/bitmap_funcs.h b/plugins/FloatingContacts/bitmap_funcs.h
index b7f55a43d7..85bbee2004 100644
--- a/plugins/FloatingContacts/bitmap_funcs.h
+++ b/plugins/FloatingContacts/bitmap_funcs.h
@@ -94,7 +94,7 @@ public:
void IncreaseAlpha(float q);
void DrawIcon(HICON hic, int x, int y, int w = 0, int h = 0);
- void DrawText(TCHAR *str, int x, int y, int blur=0, int strength = 0);
+ void DrawText(TCHAR *str, int x, int y, int blur = 0, int strength = 0);
__forceinline COLOR32 *getBits() { return bits; }
__forceinline COLOR32 *getRow(int row) { return bits + row * width; }
diff --git a/plugins/FloatingContacts/filedrop.cpp b/plugins/FloatingContacts/filedrop.cpp
index 09fe2dace2..caf87577c4 100644
--- a/plugins/FloatingContacts/filedrop.cpp
+++ b/plugins/FloatingContacts/filedrop.cpp
@@ -13,7 +13,7 @@ HRESULT STDMETHODCALLTYPE CDropTarget::QueryInterface(REFIID riid,LPVOID *ppvObj
return S_OK;
}
- *ppvObj=NULL;
+ *ppvObj = NULL;
return ( E_NOINTERFACE );
}
@@ -35,7 +35,7 @@ HRESULT STDMETHODCALLTYPE CDropTarget::DragOver( DWORD fKeyState, POINTL pt, DWO
{
*pdwEffect = 0;
- if( hwndCurDrag == NULL )
+ if ( hwndCurDrag == NULL )
{
*pdwEffect = DROPEFFECT_NONE;
}
@@ -49,17 +49,17 @@ HRESULT STDMETHODCALLTYPE CDropTarget::DragOver( DWORD fKeyState, POINTL pt, DWO
HRESULT STDMETHODCALLTYPE CDropTarget::DragEnter( IDataObject *pData, DWORD fKeyState, POINTL pt, DWORD *pdwEffect)
{
- HWND hwnd = NULL;
+ HWND hwnd = NULL;
POINT shortPt;
- FORMATETC feFile = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
- FORMATETC feText = { CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
+ FORMATETC feFile = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
+ FORMATETC feText = { CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
ThumbInfo *pThumb;
if ( S_OK == pData->QueryGetData( &feFile ) ||
S_OK == pData->QueryGetData( &feText ) )
{
- shortPt.x = pt.x;
- shortPt.y = pt.y;
+ shortPt.x = pt.x;
+ shortPt.y = pt.y;
hwnd = WindowFromPoint( shortPt );
@@ -91,19 +91,19 @@ HRESULT STDMETHODCALLTYPE CDropTarget::DragLeave( )
HRESULT STDMETHODCALLTYPE CDropTarget::Drop( IDataObject *pData,DWORD fKeyState,POINTL pt,DWORD *pdwEffect)
{
- FORMATETC fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
+ FORMATETC fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
STGMEDIUM stg;
- HDROP hDrop = NULL;
- ThumbInfo *pThumb = NULL;
- char *pText = NULL;
+ HDROP hDrop = NULL;
+ ThumbInfo *pThumb = NULL;
+ char *pText = NULL;
BOOL bFormatText = FALSE;
*pdwEffect = DROPEFFECT_NONE;
- if( hwndCurDrag == NULL ) return( S_OK );
+ if ( hwndCurDrag == NULL ) return( S_OK );
- pThumb = (ThumbInfo*)GetWindowLong( hwndCurDrag, GWL_USERDATA );
+ pThumb = (ThumbInfo*)GetWindowLong( hwndCurDrag, GWLP_USERDATA );
if ( pThumb == NULL ) return( S_OK );
if ( S_OK != pData->GetData( &fe,&stg ) )
@@ -124,7 +124,7 @@ HRESULT STDMETHODCALLTYPE CDropTarget::Drop( IDataObject *pData,DWORD fKeyState,
if ( !bFormatText )
{
- hDrop = (HDROP)stg.hGlobal;
+ hDrop = (HDROP)stg.hGlobal;
if ( hDrop != NULL )
{
@@ -142,7 +142,7 @@ HRESULT STDMETHODCALLTYPE CDropTarget::Drop( IDataObject *pData,DWORD fKeyState,
}
}
- if( stg.pUnkForRelease != NULL )
+ if ( stg.pUnkForRelease != NULL )
{
stg.pUnkForRelease->Release( );
}
@@ -161,12 +161,12 @@ HRESULT STDMETHODCALLTYPE CDropTarget::Drop( IDataObject *pData,DWORD fKeyState,
BOOL OnDropFiles( HDROP hDrop, ThumbInfo *pThumb )
{
- BOOL bSuccess = FALSE;
- UINT nFilesCount = 0;
- UINT iItem = 0;
- char **ppFiles = NULL;
- char **ppDroppedItems = NULL;
- UINT nDroppedItemsCount = 0;
+ BOOL bSuccess = FALSE;
+ UINT nFilesCount = 0;
+ UINT iItem = 0;
+ char **ppFiles = NULL;
+ char **ppDroppedItems = NULL;
+ UINT nDroppedItemsCount = 0;
char szFilename[ MAX_PATH ];
@@ -181,7 +181,7 @@ BOOL OnDropFiles( HDROP hDrop, ThumbInfo *pThumb )
ppDroppedItems[ nDroppedItemsCount ] = NULL;
- for( iItem = 0; iItem < nDroppedItemsCount; ++iItem )
+ for ( iItem = 0; iItem < nDroppedItemsCount; ++iItem )
{
DragQueryFileA( hDrop, iItem, szFilename, sizeof( szFilename ) );
ppDroppedItems[ iItem ] = _strdup( szFilename );
@@ -203,14 +203,14 @@ BOOL OnDropFiles( HDROP hDrop, ThumbInfo *pThumb )
bSuccess = (BOOL)CallService( MS_CLIST_CONTACTFILESDROPPED, (WPARAM)pThumb->hContact, (LPARAM)ppFiles );
// Cleanup
- for( iItem = 0; ppDroppedItems[ iItem ]; ++iItem )
+ for ( iItem = 0; ppDroppedItems[ iItem ]; ++iItem )
{
free( ppDroppedItems[ iItem ] );
}
free( ppDroppedItems );
- for( iItem = 0; iItem < nFilesCount ; ++iItem )
+ for ( iItem = 0; iItem < nFilesCount ; ++iItem )
{
free( ppFiles[ iItem ] );
}
@@ -324,7 +324,7 @@ static void ProcessDroppedItems( char **ppDroppedItems, int nCount, char **ppFil
int i;
int fileCount = 0;
- for( i = 0; i < nCount; ++i )
+ for ( i = 0; i < nCount; ++i )
{
SaveFiles( ppDroppedItems[ i ], ppFiles, &fileCount );
}
@@ -336,7 +336,7 @@ static int CountDroppedFiles( char **ppDroppedItems, int nCount )
int fileCount = 0;
int i;
- for( i = 0; i < nCount; ++i )
+ for ( i = 0; i < nCount; ++i )
{
fileCount += CountFiles( ppDroppedItems[ i ] );
}
diff --git a/plugins/FloatingContacts/filedrop.h b/plugins/FloatingContacts/filedrop.h
index ed03cdbf68..b5c7f803aa 100644
--- a/plugins/FloatingContacts/filedrop.h
+++ b/plugins/FloatingContacts/filedrop.h
@@ -1,7 +1,7 @@
/* This file is a modification of clcfiledrop.h originally
written by Richard Hughes*/
-static HWND hwndCurDrag = NULL;
+static HWND hwndCurDrag = NULL;
class CDropTarget: public IDropTarget
{
diff --git a/plugins/FloatingContacts/main.cpp b/plugins/FloatingContacts/main.cpp
index 3abca83658..8c572e210d 100644
--- a/plugins/FloatingContacts/main.cpp
+++ b/plugins/FloatingContacts/main.cpp
@@ -28,9 +28,9 @@ No warranty for any misbehaviour.
//#define DB_POS_GETY(pos) HIWORD(pos)
//#define DB_POS_MAKE_XY(x, y) MAKELONG(x, y)
-BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
+BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND, COLORREF, BYTE, DWORD);
BOOL (WINAPI *pUpdateLayeredWindow)
- (HWND hwnd, HDC hdcDST, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc,
+ (HWND hwnd, HDC hdcDST, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc,
COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags);
// Globals
@@ -58,7 +58,7 @@ static int ClcStatusToPf2 ( int status );
static LRESULT __stdcall CommWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
static LRESULT __stdcall newMirandaWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
-static int OnContactDeleted ( WPARAM wParam,LPARAM lParam );
+static int OnContactDeleted ( WPARAM wParam, LPARAM lParam );
static int OnContactIconChanged ( WPARAM wParam, LPARAM lParam );
static int OnContactDrag ( WPARAM wParam, LPARAM lParam );
static int OnContactDrop ( WPARAM wParam, LPARAM lParam );
@@ -69,94 +69,93 @@ static int OnStatusModeChange ( WPARAM wParam, LPARAM lParam );
static int OnModulesLoded ( WPARAM wParam, LPARAM lParam );
static int OnPrebuildContactMenu ( WPARAM wParam, LPARAM lParam );
-static int OnContactMenu_Remove ( WPARAM wParam,LPARAM lParam );
-//static int OnContactMenu_HideAll ( WPARAM wParam,LPARAM lParam );
-static int OnMainMenu_HideAll ( WPARAM wParam,LPARAM lParam );
-static int OnHotKey_HideWhenCListShow( WPARAM wParam,LPARAM lParam );
+static INT_PTR OnContactMenu_Remove ( WPARAM wParam, LPARAM lParam );
+static INT_PTR OnMainMenu_HideAll ( WPARAM wParam, LPARAM lParam );
+static INT_PTR OnHotKey_HideWhenCListShow( WPARAM wParam, LPARAM lParam );
static VOID CALLBACK ToTopTimerProc ( HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
WNDPROC oldMirandaWndProc;
-HINSTANCE hInst = NULL;
-HMODULE hUserDll = NULL;
-PLUGINLINK *pluginLink = NULL;
-LIST_INTERFACE li = {0};
-HFONT hFont[FLT_FONTIDS] = {NULL};
-COLORREF tColor[FLT_FONTIDS] = {0};
-HIMAGELIST himl = NULL;
-HANDLE hevContactIcon = NULL;
-HANDLE hevContactDrop = NULL;
-HANDLE hevContactDragStop = NULL;
-HANDLE hevSkinIcons = NULL;
-HANDLE hevContactDrag = NULL;
-HANDLE hevContactSetting = NULL;
-HANDLE hevContactDeleted = NULL;
-HANDLE hevOptionsInit = NULL;
-HANDLE hevStatusMode = NULL;
-HANDLE hevModules = NULL;
-HANDLE hevPrebuildMenu = NULL;
-HANDLE hNewContact = NULL;
-
-HPEN hLTEdgesPen = NULL;
-HPEN hRBEdgesPen = NULL;
-HBRUSH hBkBrush = NULL;
-DWORD bkColor = 0;
-HBITMAP hBmpBackground = NULL;
-WORD nBackgroundBmpUse = CLB_STRETCH;
-
-HWND hwndMiranda = NULL;
-BOOL bVersionOK = FALSE;
-BOOL bNT = FALSE;
-BOOL bDockHorz = TRUE;
-//UINT nStatus = 0;
-HMENU hContactMenu = NULL;
-HANDLE hMenuItemRemove = NULL;
-HANDLE hMenuItemHideAll = NULL;
-HANDLE hMainMenuItemHideAll = NULL;
+HINSTANCE hInst = NULL;
+HMODULE hUserDll = NULL;
+PLUGINLINK *pluginLink = NULL;
+LIST_INTERFACE li = {0};
+HFONT hFont[FLT_FONTIDS] = {NULL};
+COLORREF tColor[FLT_FONTIDS] = {0};
+HIMAGELIST himl = NULL;
+HANDLE hevContactIcon = NULL;
+HANDLE hevContactDrop = NULL;
+HANDLE hevContactDragStop = NULL;
+HANDLE hevSkinIcons = NULL;
+HANDLE hevContactDrag = NULL;
+HANDLE hevContactSetting = NULL;
+HANDLE hevContactDeleted = NULL;
+HANDLE hevOptionsInit = NULL;
+HANDLE hevStatusMode = NULL;
+HANDLE hevModules = NULL;
+HANDLE hevPrebuildMenu = NULL;
+HANDLE hNewContact = NULL;
+
+HPEN hLTEdgesPen = NULL;
+HPEN hRBEdgesPen = NULL;
+HBRUSH hBkBrush = NULL;
+DWORD bkColor = 0;
+HBITMAP hBmpBackground = NULL;
+WORD nBackgroundBmpUse = CLB_STRETCH;
+
+HWND hwndMiranda = NULL;
+BOOL bVersionOK = FALSE;
+BOOL bNT = FALSE;
+BOOL bDockHorz = TRUE;
+//UINT nStatus = 0;
+HMENU hContactMenu = NULL;
+HANDLE hMenuItemRemove = NULL;
+HANDLE hMenuItemHideAll = NULL;
+HANDLE hMainMenuItemHideAll = NULL;
RECT rcScreen;
-DWORD dwOfflineModes = 0;
-BOOL bEnableTip = FALSE;
-UINT_PTR ToTopTimerID = 0;
-BOOL bIsCListShow = TRUE;
-
-HANDLE hRemoveThumb = NULL;
-HANDLE hMainHideAllThumbs = NULL;
-HANDLE hHideWhenCListShow = NULL;
+DWORD dwOfflineModes = 0;
+BOOL bEnableTip = FALSE;
+UINT_PTR ToTopTimerID = 0;
+BOOL bIsCListShow = TRUE;
+
+HANDLE hRemoveThumb = NULL;
+HANDLE hMainHideAllThumbs = NULL;
+HANDLE hHideWhenCListShow = NULL;
int hLangpack;
//Options
FCOptions fcOpt = {0};
-static void InitOptions(){
- fcOpt.thumbAlpha = 255;
- fcOpt.bHideOffline = FALSE;
- fcOpt.bHideAll = FALSE;
- fcOpt.bHideWhenFullscreen = FALSE;
- fcOpt.bMoveTogether = FALSE;
- fcOpt.bFixedWidth = FALSE;
- fcOpt.nThumbWidth = 0;
- fcOpt.bShowTip = TRUE;
- fcOpt.TimeIn = 0;
- fcOpt.bToTop = TRUE;
- fcOpt.ToTopTime = TOTOPTIME_DEF;
- fcOpt.bHideWhenCListShow = FALSE;
- fcOpt.bUseSingleClick = FALSE;
- fcOpt.bShowIdle = TRUE;
+static void InitOptions() {
+ fcOpt.thumbAlpha = 255;
+ fcOpt.bHideOffline = FALSE;
+ fcOpt.bHideAll = FALSE;
+ fcOpt.bHideWhenFullscreen = FALSE;
+ fcOpt.bMoveTogether = FALSE;
+ fcOpt.bFixedWidth = FALSE;
+ fcOpt.nThumbWidth = 0;
+ fcOpt.bShowTip = TRUE;
+ fcOpt.TimeIn = 0;
+ fcOpt.bToTop = TRUE;
+ fcOpt.ToTopTime = TOTOPTIME_DEF;
+ fcOpt.bHideWhenCListShow = FALSE;
+ fcOpt.bUseSingleClick = FALSE;
+ fcOpt.bShowIdle = TRUE;
}
-PLUGININFO pluginInfo ={
- sizeof(PLUGININFO),
- __PLUGIN_NAME,
- 0,
- __DESC,
- __AUTHOR,
- __AUTHOREMAIL,
- __COPYRIGHT,
- __AUTHORWEB,
- UNICODE_AWARE,
+PLUGININFO pluginInfo = {
+ sizeof(PLUGININFO),
+ __PLUGIN_NAME,
+ 0,
+ __DESC,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
0
};
@@ -170,29 +169,29 @@ extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
return interfaces;
}
-PLUGININFOEX pluginInfoEx ={
- sizeof(PLUGININFOEX),
- __PLUGIN_NAME,
- 0,
- __DESC,
- __AUTHOR,
- __AUTHOREMAIL,
- __COPYRIGHT,
- __AUTHORWEB,
- UNICODE_AWARE,
- 0,
+PLUGININFOEX pluginInfoEx = {
+ sizeof(PLUGININFOEX),
+ __PLUGIN_NAME,
+ 0,
+ __DESC,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
+ 0,
MIID_FLTCONT
};
-_inline unsigned int MakeVer(int a,int b,int c,int d)
+_inline unsigned int MakeVer(int a, int b, int c, int d)
{
- return PLUGIN_MAKE_VERSION(a,b,c,d);
+ return PLUGIN_MAKE_VERSION(a, b, c, d);
}
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) {
- if( mirandaVersion < MakeVer(MINIMAL_COREVERSION) ) return NULL;
- pluginInfoEx.version=MakeVer(PRODUCT_VERSION);
+ if ( mirandaVersion < MakeVer(MINIMAL_COREVERSION) ) return NULL;
+ pluginInfoEx.version = MakeVer(PRODUCT_VERSION);
return &pluginInfoEx;
}
@@ -219,8 +218,8 @@ BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
extern "C" __declspec(dllexport) PLUGININFO* MirandaPluginInfo( DWORD mirandaVersion )
{
- if( mirandaVersion < MakeVer(MINIMAL_COREVERSION) ) return NULL;
- pluginInfo.version=MakeVer(PRODUCT_VERSION);
+ if ( mirandaVersion < MakeVer(MINIMAL_COREVERSION) ) return NULL;
+ pluginInfo.version = MakeVer(PRODUCT_VERSION);
return &pluginInfo;
}
@@ -230,24 +229,23 @@ extern "C" int __declspec(dllexport) Load( PLUGINLINK *link )
{
SetLastError( 0 );
InitOptions();
- pluginLink = link;
+ pluginLink = link;
mir_getLI(&li);
mir_getLP(&pluginInfoEx);
- hevModules = HookEvent( ME_SYSTEM_MODULESLOADED, OnModulesLoded );
- bNT = GetOSPlatform();
+ hevModules = HookEvent( ME_SYSTEM_MODULESLOADED, OnModulesLoded );
+ bNT = GetOSPlatform();
- if (hUserDll = LoadLibrary(_T("user32.dll")))
- {
- pSetLayeredWindowAttributes =
- (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))
+ if (hUserDll = LoadLibrary(_T("user32.dll"))) {
+ pSetLayeredWindowAttributes =
+ (BOOL (WINAPI *)(HWND, COLORREF, BYTE, DWORD))
GetProcAddress(hUserDll, "SetLayeredWindowAttributes");
- pUpdateLayeredWindow =
+ pUpdateLayeredWindow =
(BOOL (WINAPI *)(HWND, HDC, POINT *, SIZE *, HDC, POINT *, COLORREF, BLENDFUNCTION *, DWORD))
GetProcAddress(hUserDll, "UpdateLayeredWindow");
- } else
- {
+ }
+ else {
pSetLayeredWindowAttributes = NULL;
pUpdateLayeredWindow = NULL;
}
@@ -281,17 +279,14 @@ static void CleanUp()
UnhookEvent( hevModules );
UnhookEvent( hevPrebuildMenu );
- if(hRemoveThumb)
+ if (hRemoveThumb)
DestroyServiceFunction(hRemoveThumb);
- if(hMainHideAllThumbs)
+ if (hMainHideAllThumbs)
DestroyServiceFunction(hMainHideAllThumbs);
- if(hHideWhenCListShow)
+ if (hHideWhenCListShow)
DestroyServiceFunction(hHideWhenCListShow);
-// while( pThumbsList != NULL )
-// RemoveThumb( pThumbsList );
-
- if(ServiceExists(MS_HOTKEY_UNREGISTER)){
+ if (ServiceExists(MS_HOTKEY_UNREGISTER)) {
CallService(MS_HOTKEY_UNREGISTER, 0, (LPARAM)(sModule "/MainHideAllThumbs"));
CallService(MS_HOTKEY_UNREGISTER, 0, (LPARAM)(sModule "/HideWhenCListShow"));
}
@@ -302,11 +297,10 @@ static void CleanUp()
DeleteObject(hRBEdgesPen);
if (NULL != hBmpBackground)
DeleteObject(hBmpBackground);
- if (NULL != hBkBrush)
- {
- SetClassLong((HWND)WND_CLASS, GCL_HBRBACKGROUND, (LONG)NULL);
+ if (NULL != hBkBrush) {
+ SetClassLong((HWND)WND_CLASS, GCLP_HBRBACKGROUND, (LONG)NULL);
DeleteObject(hBkBrush);
- hBkBrush=NULL;
+ hBkBrush = NULL;
}
for (nFontId = 0; nFontId < FLT_FONTIDS; nFontId++)
@@ -318,9 +312,7 @@ static void CleanUp()
FreeFileDropping();
if ( hUserDll != NULL )
- {
FreeLibrary( hUserDll );
- }
}
@@ -329,24 +321,24 @@ static void CleanUp()
// Hooked events
static int OnModulesLoded( WPARAM wParam, LPARAM lParam )
{
- hevContactIcon = HookEvent( ME_CLIST_CONTACTICONCHANGED, OnContactIconChanged );
- hevSkinIcons = HookEvent( ME_SKIN_ICONSCHANGED, OnSkinIconsChanged );
- hevContactDrag = HookEvent( ME_CLUI_CONTACTDRAGGING, OnContactDrag );
- hevContactDrop = HookEvent( ME_CLUI_CONTACTDROPPED, OnContactDrop );
- hevContactDragStop = HookEvent( ME_CLUI_CONTACTDRAGSTOP, OnContactDragStop );
- hevContactSetting = HookEvent( ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged );
- hevContactDeleted = HookEvent( ME_DB_CONTACT_DELETED, OnContactDeleted );
- hevOptionsInit = HookEvent( ME_OPT_INITIALISE, OnOptionsInitialize );
- hevStatusMode = HookEvent( ME_CLIST_STATUSMODECHANGE, OnStatusModeChange );
- hevPrebuildMenu = HookEvent( ME_CLIST_PREBUILDCONTACTMENU, OnPrebuildContactMenu );
- hwndMiranda = (HWND)CallService( MS_CLUI_GETHWND, 0, 0 );
-
- oldMirandaWndProc = (WNDPROC)SetWindowLong( hwndMiranda, GWLP_WNDPROC, (LONG)newMirandaWndProc);
+ hevContactIcon = HookEvent( ME_CLIST_CONTACTICONCHANGED, OnContactIconChanged );
+ hevSkinIcons = HookEvent( ME_SKIN_ICONSCHANGED, OnSkinIconsChanged );
+ hevContactDrag = HookEvent( ME_CLUI_CONTACTDRAGGING, OnContactDrag );
+ hevContactDrop = HookEvent( ME_CLUI_CONTACTDROPPED, OnContactDrop );
+ hevContactDragStop = HookEvent( ME_CLUI_CONTACTDRAGSTOP, OnContactDragStop );
+ hevContactSetting = HookEvent( ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged );
+ hevContactDeleted = HookEvent( ME_DB_CONTACT_DELETED, OnContactDeleted );
+ hevOptionsInit = HookEvent( ME_OPT_INITIALISE, OnOptionsInitialize );
+ hevStatusMode = HookEvent( ME_CLIST_STATUSMODECHANGE, OnStatusModeChange );
+ hevPrebuildMenu = HookEvent( ME_CLIST_PREBUILDCONTACTMENU, OnPrebuildContactMenu );
+ hwndMiranda = (HWND)CallService( MS_CLUI_GETHWND, 0, 0 );
+
+ oldMirandaWndProc = (WNDPROC)SetWindowLong( hwndMiranda, GWLP_WNDPROC, (LONG)newMirandaWndProc);
// No thumbs yet
-// pThumbsList = NULL;
+// pThumbsList = NULL;
bEnableTip = ServiceExists("mToolTip/ShowTip");
RegisterWindowClass();
@@ -358,10 +350,10 @@ static int OnModulesLoded( WPARAM wParam, LPARAM lParam )
LoadContacts();
LoadMenus();
- if(fcOpt.bToTop){
+ if (fcOpt.bToTop){
fcOpt.ToTopTime = (fcOpt.ToTopTime<1)?1:fcOpt.ToTopTime;
fcOpt.ToTopTime = (fcOpt.ToTopTime>TOTOPTIME_MAX)?TOTOPTIME_MAX:fcOpt.ToTopTime;
- ToTopTimerID=SetTimer(NULL, 0, fcOpt.ToTopTime*TOTOPTIME_P, ToTopTimerProc);
+ ToTopTimerID = SetTimer(NULL, 0, fcOpt.ToTopTime*TOTOPTIME_P, ToTopTimerProc);
}
return( 0 );
}
@@ -369,8 +361,8 @@ static int OnModulesLoded( WPARAM wParam, LPARAM lParam )
static int OnContactDeleted( WPARAM wParam, LPARAM lParam )
{
- HANDLE hContact = ( HANDLE )wParam;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ HANDLE hContact = ( HANDLE )wParam;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
if (!pThumb) return 0;
pThumb->DeleteContactPos();
@@ -382,8 +374,8 @@ static int OnContactDeleted( WPARAM wParam, LPARAM lParam )
static int OnContactIconChanged( WPARAM wParam, LPARAM lParam )
{
- HANDLE hContact = ( HANDLE )wParam;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ HANDLE hContact = ( HANDLE )wParam;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
if ( pThumb )
{
@@ -398,21 +390,18 @@ static int OnContactIconChanged( WPARAM wParam, LPARAM lParam )
static int OnContactDrag( WPARAM wParam, LPARAM lParam )
{
- ThumbInfo *pNewThumb = NULL;
- HANDLE hContact = ( HANDLE )wParam;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
- TCHAR *ptName = (TCHAR*)CallService( MS_CLIST_GETCONTACTDISPLAYNAME, wParam, (LPARAM)GCDNF_TCHAR );
- int idStatus = ID_STATUS_OFFLINE;
+ ThumbInfo *pNewThumb = NULL;
+ HANDLE hContact = ( HANDLE )wParam;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ TCHAR *ptName = (TCHAR*)CallService( MS_CLIST_GETCONTACTDISPLAYNAME, wParam, (LPARAM)GCDNF_TCHAR );
+ int idStatus = ID_STATUS_OFFLINE;
POINT pt;
GetCursorPos(&pt);
- if ( pThumb == NULL )
- {
+ if ( pThumb == NULL ) {
idStatus = GetContactStatus( hContact );
- if ( !fcOpt.bHideAll && !HideOnFullScreen() && ( !fcOpt.bHideOffline || IsStatusVisible( idStatus ) ) && (!fcOpt.bHideWhenCListShow || !bIsCListShow) )
- {
-// CreateThumbWnd( pName, hContact, LOWORD( lParam ), HIWORD( lParam ) );
+ if ( !fcOpt.bHideAll && !HideOnFullScreen() && ( !fcOpt.bHideOffline || IsStatusVisible( idStatus ) ) && (!fcOpt.bHideWhenCListShow || !bIsCListShow)) {
CreateThumbWnd( ptName, hContact, pt.x, pt.y );
pNewThumb = thumbList.FindThumbByContact( hContact );
ShowWindow( pNewThumb->hwnd, SW_SHOWNA );
@@ -422,10 +411,7 @@ static int OnContactDrag( WPARAM wParam, LPARAM lParam )
}
}
else if ( hContact == hNewContact )
- {
-// PositionThumb( pThumb, (short)( LOWORD( lParam ) - 5 ), (short)( HIWORD( lParam ) - 5 ) );
pThumb->PositionThumb( (short)( pt.x - 5 ), (short)( pt.y - 5 ) );
- }
return( hNewContact != NULL ? 1 : 0 );
}
@@ -438,8 +424,8 @@ static int OnContactDrop( WPARAM wParam, LPARAM lParam )
RECT rcThumb;
// RECT rcOverlap;
- HANDLE hContact = ( HANDLE )wParam;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ HANDLE hContact = ( HANDLE )wParam;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
if ( ( hNewContact == hContact ) && ( pThumb != NULL ) )
{
@@ -491,16 +477,16 @@ static int OnSkinIconsChanged( WPARAM wParam, LPARAM lParam )
static int OnContactSettingChanged( WPARAM wParam, LPARAM lParam )
{
- HANDLE hContact = ( HANDLE )wParam;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
- int idStatus = ID_STATUS_OFFLINE;
- BOOL bRefresh = TRUE;
+ HANDLE hContact = ( HANDLE )wParam;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ int idStatus = ID_STATUS_OFFLINE;
+ BOOL bRefresh = TRUE;
DBCONTACTWRITESETTING* pdbcws = ( DBCONTACTWRITESETTING* )lParam;
if ( hContact == NULL )
{
- if(( 0 == stricmp( pdbcws->szModule, "CLC" ) ) || ( 0 == stricmp( pdbcws->szModule, sModule ) ) ){
+ if (( 0 == stricmp( pdbcws->szModule, "CLC" ) ) || ( 0 == stricmp( pdbcws->szModule, sModule ) ) ) {
LoadDBSettings();
ApplyOptionsChanges();
}
@@ -511,7 +497,7 @@ static int OnContactSettingChanged( WPARAM wParam, LPARAM lParam )
if ( pThumb == NULL ) return( 0 );
// Only on these 2 events we need to refresh
- if( 0 == stricmp( pdbcws->szSetting, "Status" ) )
+ if ( 0 == stricmp( pdbcws->szSetting, "Status" ) )
{
idStatus = pdbcws->value.wVal;
}
@@ -588,26 +574,26 @@ static int OnPrebuildContactMenu( WPARAM wParam, LPARAM lParam )
static void LoadDBSettings()
{
- fcOpt.thumbAlpha = (BYTE)((double)DBGetContactSettingByte( NULL, sModule, "Opacity", 100 ) * 2.55 );
- fcOpt.bHideOffline = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideOffline", 0 );
- fcOpt.bHideAll = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideAll", 0 );
- fcOpt.bHideWhenFullscreen = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideWhenFullscreen", 0 );
- fcOpt.bMoveTogether = (BOOL)DBGetContactSettingByte( NULL, sModule, "MoveTogether", 0 );
- fcOpt.bFixedWidth = (BOOL)DBGetContactSettingByte( NULL, sModule, "FixedWidth", 0 );
- fcOpt.nThumbWidth = (DWORD)DBGetContactSettingDword( NULL, sModule, "Width", 0 );
- dwOfflineModes = DBGetContactSettingDword( NULL, "CLC","OfflineModes", CLCDEFAULT_OFFLINEMODES );
- fcOpt.bShowTip = (BOOL)DBGetContactSettingByte( NULL, sModule, "ShowTip", 1 );
- fcOpt.TimeIn = (WORD)DBGetContactSettingWord( NULL, sModule, "TimeIn", 0 );
- fcOpt.bToTop = (BOOL)DBGetContactSettingByte( NULL, sModule, "ToTop", 0 );
- fcOpt.ToTopTime = (WORD)DBGetContactSettingWord( NULL, sModule, "ToTopTime", TOTOPTIME_DEF );
- fcOpt.bHideWhenCListShow = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideWhenCListShow", 0 );
- fcOpt.bUseSingleClick = (BOOL)DBGetContactSettingByte( NULL, sModule, "UseSingleClick", 0 );
- fcOpt.bShowIdle = (BOOL)DBGetContactSettingByte( NULL, sModule, "ShowIdle", 0 );
-
- if(DBGetContactSettingByte(NULL, "ModernData", "HideBehind", 0))
- bIsCListShow = (DBGetContactSettingByte(NULL, "ModernData", "BehindEdge", 0)==0);
+ fcOpt.thumbAlpha = (BYTE)((double)DBGetContactSettingByte( NULL, sModule, "Opacity", 100 ) * 2.55 );
+ fcOpt.bHideOffline = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideOffline", 0 );
+ fcOpt.bHideAll = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideAll", 0 );
+ fcOpt.bHideWhenFullscreen = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideWhenFullscreen", 0 );
+ fcOpt.bMoveTogether = (BOOL)DBGetContactSettingByte( NULL, sModule, "MoveTogether", 0 );
+ fcOpt.bFixedWidth = (BOOL)DBGetContactSettingByte( NULL, sModule, "FixedWidth", 0 );
+ fcOpt.nThumbWidth = (DWORD)DBGetContactSettingDword( NULL, sModule, "Width", 0 );
+ dwOfflineModes = DBGetContactSettingDword( NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES );
+ fcOpt.bShowTip = (BOOL)DBGetContactSettingByte( NULL, sModule, "ShowTip", 1 );
+ fcOpt.TimeIn = (WORD)DBGetContactSettingWord( NULL, sModule, "TimeIn", 0 );
+ fcOpt.bToTop = (BOOL)DBGetContactSettingByte( NULL, sModule, "ToTop", 0 );
+ fcOpt.ToTopTime = (WORD)DBGetContactSettingWord( NULL, sModule, "ToTopTime", TOTOPTIME_DEF );
+ fcOpt.bHideWhenCListShow = (BOOL)DBGetContactSettingByte( NULL, sModule, "HideWhenCListShow", 0 );
+ fcOpt.bUseSingleClick = (BOOL)DBGetContactSettingByte( NULL, sModule, "UseSingleClick", 0 );
+ fcOpt.bShowIdle = (BOOL)DBGetContactSettingByte( NULL, sModule, "ShowIdle", 0 );
+
+ if (DBGetContactSettingByte(NULL, "ModernData", "HideBehind", 0))
+ bIsCListShow = (DBGetContactSettingByte(NULL, "ModernData", "BehindEdge", 0) == 0);
else
- bIsCListShow = (DBGetContactSettingByte(NULL,"CList","State",0)==2);
+ bIsCListShow = (DBGetContactSettingByte(NULL, "CList", "State", 0) == 2);
}
void SendMsgDialog( HWND hwnd, char *pText )
@@ -621,8 +607,8 @@ void SendMsgDialog( HWND hwnd, char *pText )
static void ShowContactMenu( HWND hwnd, POINT pt )
{
- ThumbInfo *pThumb = thumbList.FindThumb( hwnd );
- int idCommand = 0;
+ ThumbInfo *pThumb = thumbList.FindThumb( hwnd );
+ int idCommand = 0;
if ( pThumb != NULL )
{
@@ -631,7 +617,7 @@ static void ShowContactMenu( HWND hwnd, POINT pt )
if ( hContactMenu == NULL ) return;
idCommand = TrackPopupMenu( hContactMenu, TPM_RIGHTALIGN | TPM_TOPALIGN | TPM_RETURNCMD, pt.x, pt.y, 0 , hwnd, NULL );
- CallService( MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM( idCommand ,MPCF_CONTACTMENU), (LPARAM)pThumb->hContact );
+ CallService( MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM( idCommand , MPCF_CONTACTMENU), (LPARAM)pThumb->hContact );
}
}
@@ -640,8 +626,8 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
WPARAM wParam,
LPARAM lParam )
{
- LRESULT lResult = 0;
- ThumbInfo *pThumb = thumbList.FindThumb( hwnd );
+ LRESULT lResult = 0;
+ ThumbInfo *pThumb = thumbList.FindThumb( hwnd );
switch( uMsg )
{
@@ -653,7 +639,7 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
if (pThumb) pThumb->ThumbDeselect( TRUE );
- ClientToScreen(hwnd,&pt);
+ ClientToScreen(hwnd, &pt);
ShowContactMenu( hwnd, pt );
}
@@ -661,7 +647,7 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
//#if 0
case WM_NCPAINT:
- if(pThumb){
+ if (pThumb){
HDC hdc = GetWindowDC( hwnd );
BitBlt(hdc, 0, 0, pThumb->bmpContent.getWidth(), pThumb->bmpContent.getHeight(), pThumb->bmpContent.getDC(), 0, 0, SRCCOPY);
//RepaintWindow( hwnd, hdc );
@@ -671,7 +657,7 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
}
case WM_PAINT:
- if(pThumb){
+ if (pThumb){
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
BitBlt(hdc, 0, 0, pThumb->bmpContent.getWidth(), pThumb->bmpContent.getHeight(), pThumb->bmpContent.getDC(), 0, 0, SRCCOPY);
@@ -682,7 +668,7 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
case WM_PRINT:
case WM_PRINTCLIENT:
- if(pThumb){
+ if (pThumb){
BitBlt((HDC)wParam, 0, 0, pThumb->bmpContent.getWidth(), pThumb->bmpContent.getHeight(), pThumb->bmpContent.getDC(), 0, 0, SRCCOPY);
//RepaintWindow(hwnd, (HDC)wParam);
break;
@@ -690,11 +676,11 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
//#endif
case WM_MEASUREITEM:
- lResult = CallService( MS_CLIST_MENUMEASUREITEM,wParam,lParam );
+ lResult = CallService( MS_CLIST_MENUMEASUREITEM, wParam, lParam );
break;
case WM_DRAWITEM:
- lResult = CallService( MS_CLIST_MENUDRAWITEM,wParam,lParam );
+ lResult = CallService( MS_CLIST_MENUDRAWITEM, wParam, lParam );
break;
case WM_LBUTTONDOWN:
@@ -714,12 +700,12 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
case WM_LBUTTONDBLCLK:
// Popup message dialog
//if (pThumb) pThumb->ThumbDeselect( TRUE );
- if(!fcOpt.bUseSingleClick && pThumb)
+ if (!fcOpt.bUseSingleClick && pThumb)
pThumb->PopUpMessageDialog();
break;
case WM_RBUTTONDOWN:
- if(bEnableTip && fcOpt.bShowTip && pThumb) pThumb->KillTip();
+ if (bEnableTip && fcOpt.bShowTip && pThumb) pThumb->KillTip();
break;
case WM_REFRESH_CONTACT:
if (pThumb)
@@ -731,7 +717,7 @@ static LRESULT __stdcall CommWndProc( HWND hwnd,
break;
case WM_TIMER:
- if(pThumb)pThumb->OnTimer(wParam);
+ if (pThumb)pThumb->OnTimer(wParam);
break;
case WM_HOTKEY:
@@ -762,17 +748,17 @@ extern void SetThumbsOpacity( BYTE btAlpha )
static void GetScreenRect()
{
- rcScreen.left = GetSystemMetrics( SM_XVIRTUALSCREEN );
- rcScreen.top = GetSystemMetrics( SM_YVIRTUALSCREEN );
- rcScreen.right = GetSystemMetrics( SM_CXVIRTUALSCREEN ) + rcScreen.left;
- rcScreen.bottom = GetSystemMetrics( SM_CYVIRTUALSCREEN ) + rcScreen.top;
+ rcScreen.left = GetSystemMetrics( SM_XVIRTUALSCREEN );
+ rcScreen.top = GetSystemMetrics( SM_YVIRTUALSCREEN );
+ rcScreen.right = GetSystemMetrics( SM_CXVIRTUALSCREEN ) + rcScreen.left;
+ rcScreen.bottom = GetSystemMetrics( SM_CYVIRTUALSCREEN ) + rcScreen.top;
}
void OnStatusChanged()
{
- int idStatus = ID_STATUS_OFFLINE;
+ int idStatus = ID_STATUS_OFFLINE;
for (int i = 0; i < thumbList.getCount(); ++i)
{
@@ -788,12 +774,12 @@ void ApplyOptionsChanges()
CreateThumbsFont();
CreateBackgroundBrush();
-// dwOfflineModes = DBGetContactSettingDword( NULL, "CLC","OfflineModes", CLCDEFAULT_OFFLINEMODES );
- if(!fcOpt.bToTop && ToTopTimerID){
+// dwOfflineModes = DBGetContactSettingDword( NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES );
+ if (!fcOpt.bToTop && ToTopTimerID){
KillTimer(NULL, ToTopTimerID);
ToTopTimerID = 0;
}
- if(fcOpt.bToTop){
+ if (fcOpt.bToTop){
if (ToTopTimerID) KillTimer(NULL, ToTopTimerID);
fcOpt.ToTopTime = (fcOpt.ToTopTime<1)?1:fcOpt.ToTopTime;
fcOpt.ToTopTime = (fcOpt.ToTopTime>TOTOPTIME_MAX)?TOTOPTIME_MAX:fcOpt.ToTopTime;
@@ -815,18 +801,18 @@ static void RegisterWindowClass()
WNDCLASSEX wcx;
ZeroMemory( &wcx, sizeof( wcx ) );
- wcx.cbSize = sizeof( WNDCLASSEX );
- wcx.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
- wcx.lpfnWndProc = CommWndProc;
- wcx.cbClsExtra = 0;
- wcx.cbWndExtra = 0;
- wcx.hInstance = hInst;
- wcx.hIcon = NULL;
- wcx.hCursor = NULL;
- wcx.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
- wcx.lpszMenuName = NULL;
- wcx.lpszClassName = WND_CLASS;
- wcx.hIconSm = NULL;
+ wcx.cbSize = sizeof( WNDCLASSEX );
+ wcx.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
+ wcx.lpfnWndProc = CommWndProc;
+ wcx.cbClsExtra = 0;
+ wcx.cbWndExtra = 0;
+ wcx.hInstance = hInst;
+ wcx.hIcon = NULL;
+ wcx.hCursor = NULL;
+ wcx.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
+ wcx.lpszMenuName = NULL;
+ wcx.lpszClassName = WND_CLASS;
+ wcx.hIconSm = NULL;
SetLastError( 0 );
@@ -844,30 +830,30 @@ static void UnregisterWindowClass()
static void CreateThumbWnd( TCHAR *ptszName, HANDLE hContact, int nX, int nY )
{
- HWND hwnd = NULL;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ HWND hwnd = NULL;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
// Prepare for window creation
if ( pThumb == NULL )
{
- hwnd = CreateWindowEx( WS_EX_TOOLWINDOW | WS_EX_TOPMOST,
- WND_CLASS,
- ptszName,
- WS_POPUP,
- nX,
- nY,
- 50,
- 20,
- NULL /*hwndMiranda*/,
- NULL,
- hInst,
+ hwnd = CreateWindowEx( WS_EX_TOOLWINDOW | WS_EX_TOPMOST,
+ WND_CLASS,
+ ptszName,
+ WS_POPUP,
+ nX,
+ nY,
+ 50,
+ 20,
+ NULL /*hwndMiranda*/,
+ NULL,
+ hInst,
NULL
);
if ( hwnd != NULL )
{
pThumb = thumbList.AddThumb( hwnd, ptszName, hContact );
- SetWindowLong( hwnd, GWL_USERDATA, (long)pThumb );
+ SetWindowLong( hwnd, GWLP_USERDATA, (long)pThumb );
pThumb->ResizeThumb();
pThumb->SetThumbOpacity( fcOpt.thumbAlpha );
@@ -911,14 +897,14 @@ static void CreateThumbsFont()
GetFontSetting(TRUE, nFontId, &lf, &tColor[nFontId]);
{
LONG height;
- HDC hdc=GetDC(NULL);
- height=lf.lfHeight;
- lf.lfHeight=-MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
- ReleaseDC(NULL,hdc);
+ HDC hdc = GetDC(NULL);
+ height = lf.lfHeight;
+ lf.lfHeight = -MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
+ ReleaseDC(NULL, hdc);
hFont[nFontId] = CreateFontIndirectA(&lf);
- lf.lfHeight=height;
+ lf.lfHeight = height;
}
}
}
@@ -948,7 +934,7 @@ static void CreateBackgroundBrush()
}
if (NULL != hBkBrush)
{
- SetClassLong((HWND)WND_CLASS, GCL_HBRBACKGROUND, (LONG)NULL);
+ SetClassLong((HWND)WND_CLASS, GCLP_HBRBACKGROUND, (LONG)NULL);
DeleteObject( hBkBrush );
hBkBrush = NULL;
}
@@ -975,17 +961,17 @@ static void CreateBackgroundBrush()
nBackgroundBmpUse = (WORD)DBGetContactSettingWord(NULL, sModule, "BkBitmapOpt", FLT_DEFAULT_BKGNDBITMAPOPT);
// Create brush
- hBkBrush = CreateSolidBrush(bkColor);
+ hBkBrush = CreateSolidBrush(bkColor);
// Attach brush to the window
- SetClassLong((HWND)WND_CLASS, GCL_HBRBACKGROUND, (LONG)hBkBrush);
+ SetClassLong((HWND)WND_CLASS, GCLP_HBRBACKGROUND, (LONG)hBkBrush);
}
static int GetContactStatus( HANDLE hContact )
{
- char *szProto = NULL;
- int idStatus = ID_STATUS_OFFLINE;
+ char *szProto = NULL;
+ int idStatus = ID_STATUS_OFFLINE;
if ( hContact == NULL )
{
@@ -993,11 +979,11 @@ static int GetContactStatus( HANDLE hContact )
return( 0 );
}
- szProto = ( char* )CallService( "Proto/GetContactBaseProto", (WPARAM)hContact, 0 );
+ szProto = ( char* )CallService( "Proto/GetContactBaseProto", (WPARAM)hContact, 0 );
if ( NULL != szProto )
{
- idStatus = DBGetContactSettingWord( hContact, szProto, "Status", ID_STATUS_OFFLINE );
+ idStatus = DBGetContactSettingWord( hContact, szProto, "Status", ID_STATUS_OFFLINE );
}
@@ -1031,39 +1017,39 @@ BOOL IsStatusVisible( int status )
void RegHotkey( HANDLE hContact, HWND hwnd )
{
- char szBuf[ MAX_PATH ]= {0};
-/* char szPath[ MAX_PATH ]= {0};
+ char szBuf[ MAX_PATH ] = {0};
+/* char szPath[ MAX_PATH ] = {0};
GetModuleFileName( NULL, szPath, MAX_PATH );
PathRemoveFileSpec( szPath );
strcat( szPath, "\\Thumbs.ini" );
GetPrivateProfileString( "Hotkeys", szName, "", szBuf, MAX_PATH - 1, szPath );*/
DBVARIANT dbv;
- if(DBGetContactSettingString ( hContact, sModule, "Hotkey", &dbv)) return;
+ if (DBGetContactSettingString ( hContact, sModule, "Hotkey", &dbv)) return;
strncpy(szBuf, dbv.pszVal, MAX_PATH - 1);
DBFreeVariant( &dbv );
if ( 0 != strlen( szBuf ) )
{
- UINT nModifiers = 0;
- char chKey = 0;
- char szMod[ 2 ][ 20 ] = {0};
- char szKey[ 20 ] = {0};
+ UINT nModifiers = 0;
+ char chKey = 0;
+ char szMod[ 2 ][ 20 ] = {0};
+ char szKey[ 20 ] = {0};
int i = 0;
sscanf( szBuf, "%[^'+']+%[^'+']+%[^'+']", szMod[ 0 ], szMod[ 1 ], szKey );
for ( i = 0; i < 2; ++i )
{
- if( 0 == strncmp( szMod[ i ], "ALT", 19 ) )
+ if ( 0 == strncmp( szMod[ i ], "ALT", 19 ) )
{
nModifiers = nModifiers | MOD_ALT;
}
- else if( 0 == strncmp( szMod[ i ], "CTRL", 19 ) )
+ else if ( 0 == strncmp( szMod[ i ], "CTRL", 19 ) )
{
nModifiers = nModifiers | MOD_CONTROL;
}
- else if( 0 == strncmp( szMod[ i ], "SHIFT", 19 ) )
+ else if ( 0 == strncmp( szMod[ i ], "SHIFT", 19 ) )
{
nModifiers = nModifiers | MOD_SHIFT;
}
@@ -1090,20 +1076,17 @@ void SaveContactsPos()
thumbList[i]->GetThumbRect( &rc );
- if( 0 == GetLastError() )
- DBWriteContactSettingDword( thumbList[i]->hContact, sModule, "ThumbsPos", DB_POS_MAKE_XY(rc.left,rc.top) );
+ if ( 0 == GetLastError() )
+ DBWriteContactSettingDword( thumbList[i]->hContact, sModule, "ThumbsPos", DB_POS_MAKE_XY(rc.left, rc.top) );
}
}
static void LoadContacts()
{
- HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0) ;
-
- while( hContact != NULL )
- {
+ HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0) ;
+ while( hContact != NULL ) {
LoadContact( hContact );
-
hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 );
}
}
@@ -1113,57 +1096,54 @@ static void LoadContacts()
static void LoadMenus()
{
- CLISTMENUITEM mi;
-
- // Remove thumb menu item
- hRemoveThumb = CreateServiceFunction( sModule "/RemoveThumb",OnContactMenu_Remove );
- ZeroMemory( &mi,sizeof( mi ) );
+ // Remove thumb menu item
+ hRemoveThumb = CreateServiceFunction( sModule "/RemoveThumb", OnContactMenu_Remove );
- mi.cbSize = sizeof( mi );
- mi.position = 0xFFFFF;
- mi.flags = CMIF_TCHAR;
- mi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( IDI_HIDE ) );
- mi.ptszName = _T("Remove thumb");
- mi.pszService = sModule "/RemoveThumb";
- hMenuItemRemove = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM,0, ( LPARAM )&mi );
-
- // Hide all thumbs main menu item
- hMainHideAllThumbs = CreateServiceFunction( sModule "/MainHideAllThumbs",OnMainMenu_HideAll );
- ZeroMemory( &mi,sizeof( mi ) );
+ CLISTMENUITEM mi = { 0 };
+ mi.cbSize = sizeof( mi );
+ mi.position = 0xFFFFF;
+ mi.flags = CMIF_TCHAR;
+ mi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( IDI_HIDE ) );
+ mi.ptszName = _T("Remove thumb");
+ mi.pszService = sModule "/RemoveThumb";
+ hMenuItemRemove = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+
+ // Hide all thumbs main menu item
+ hMainHideAllThumbs = CreateServiceFunction( sModule "/MainHideAllThumbs", OnMainMenu_HideAll );
+ ZeroMemory( &mi, sizeof( mi ) );
- mi.cbSize = sizeof( mi );
- mi.position = 0xFFFFF;
- mi.flags = CMIF_TCHAR;
- mi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( fcOpt.bHideAll ? IDI_SHOW : IDI_HIDE ) );
- mi.ptszName = fcOpt.bHideAll ? _T("Show all thumbs") : _T("Hide all thumbs");
- mi.pszService = sModule "/MainHideAllThumbs";
- hMainMenuItemHideAll = (HANDLE)CallService( MS_CLIST_ADDMAINMENUITEM,0, ( LPARAM )&mi );
-
- if(ServiceExists(MS_HOTKEY_REGISTER)){
- HOTKEYDESC hkd={0};
-
- hkd.cbSize = sizeof(hkd);
- hkd.pszSection = "Floating Contacts";
+ mi.cbSize = sizeof( mi );
+ mi.position = 0xFFFFF;
+ mi.flags = CMIF_TCHAR;
+ mi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( fcOpt.bHideAll ? IDI_SHOW : IDI_HIDE ) );
+ mi.ptszName = fcOpt.bHideAll ? _T("Show all thumbs") : _T("Hide all thumbs");
+ mi.pszService = sModule "/MainHideAllThumbs";
+ hMainMenuItemHideAll = (HANDLE)CallService( MS_CLIST_ADDMAINMENUITEM, 0, ( LPARAM )&mi );
+
+ if (ServiceExists(MS_HOTKEY_REGISTER)) {
+ HOTKEYDESC hkd = {0};
+ hkd.cbSize = sizeof(hkd);
+ hkd.pszSection = "Floating Contacts";
- hkd.pszName = sModule "/MainHideAllThumbs";
- hkd.pszDescription = "Show/Hide all thumbs";
- hkd.pszService = sModule "/MainHideAllThumbs";
- CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
-
- hHideWhenCListShow = CreateServiceFunction( sModule "/HideWhenCListShow",OnHotKey_HideWhenCListShow );
- hkd.pszName = sModule "/HideWhenCListShow";
- hkd.pszDescription = "Hide when contact list is shown";
- hkd.pszService = sModule "/HideWhenCListShow";
- CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
- }
+ hkd.pszName = sModule "/MainHideAllThumbs";
+ hkd.pszDescription = "Show/Hide all thumbs";
+ hkd.pszService = sModule "/MainHideAllThumbs";
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
+
+ hHideWhenCListShow = CreateServiceFunction( sModule "/HideWhenCListShow", OnHotKey_HideWhenCListShow );
+ hkd.pszName = sModule "/HideWhenCListShow";
+ hkd.pszDescription = "Hide when contact list is shown";
+ hkd.pszService = sModule "/HideWhenCListShow";
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd);
+ }
}
static void LoadContact( HANDLE hContact )
{
- DWORD dwPos = (DWORD)-1;
- TCHAR *ptName = NULL;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ DWORD dwPos = (DWORD)-1;
+ TCHAR *ptName = NULL;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
int nX, nY;
@@ -1219,32 +1199,30 @@ BOOL HideOnFullScreen()
}
-static int OnContactMenu_Remove( WPARAM wParam,LPARAM lParam )
+static INT_PTR OnContactMenu_Remove( WPARAM wParam, LPARAM lParam )
{
- HANDLE hContact = ( HANDLE )wParam;
- ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
+ HANDLE hContact = ( HANDLE )wParam;
+ ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
- if (pThumb)
- {
+ if (pThumb) {
pThumb->DeleteContactPos();
thumbList.RemoveThumb(pThumb);
}
DestroyMenu( hContactMenu );
-
return 0;
}
-static int OnHotKey_HideWhenCListShow( WPARAM wParam,LPARAM lParam )
+static INT_PTR OnHotKey_HideWhenCListShow( WPARAM wParam, LPARAM lParam )
{
- fcOpt.bHideWhenCListShow=!fcOpt.bHideWhenCListShow;
+ fcOpt.bHideWhenCListShow = !fcOpt.bHideWhenCListShow;
DBWriteContactSettingByte(NULL, sModule, "HideWhenCListShow", (BYTE)fcOpt.bHideWhenCListShow);
OnStatusChanged();
return 0;
}
-static int OnMainMenu_HideAll( WPARAM wParam,LPARAM lParam )
+static INT_PTR OnMainMenu_HideAll( WPARAM wParam, LPARAM lParam )
{
CLISTMENUITEM clmi = {0};
int b;
@@ -1253,10 +1231,10 @@ static int OnMainMenu_HideAll( WPARAM wParam,LPARAM lParam )
DBWriteContactSettingByte(NULL, sModule, "HideAll", (BYTE)fcOpt.bHideAll);
OnStatusChanged();
- clmi.cbSize = sizeof( clmi );
- clmi.flags = CMIM_NAME | CMIM_ICON|CMIF_TCHAR;
- clmi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( fcOpt.bHideAll ? IDI_SHOW : IDI_HIDE ) );
- clmi.ptszName = fcOpt.bHideAll ? _T("Show all thumbs") : _T("Hide all thumbs");
+ clmi.cbSize = sizeof( clmi );
+ clmi.flags = CMIM_NAME | CMIM_ICON|CMIF_TCHAR;
+ clmi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( fcOpt.bHideAll ? IDI_SHOW : IDI_HIDE ) );
+ clmi.ptszName = fcOpt.bHideAll ? _T("Show all thumbs") : _T("Hide all thumbs");
b = CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMainMenuItemHideAll, ( LPARAM )&clmi );
return 0;
}
@@ -1270,59 +1248,56 @@ static VOID CALLBACK ToTopTimerProc ( HWND hwnd, UINT uMsg, UINT_PTR idEvent, DW
0,
0,
0,
- 0,
+ 0,
SWP_NOSIZE | SWP_NOMOVE | /*SWP_NOZORDER |*/ SWP_NOACTIVATE);
}
}
void ShowThumbsOnHideCList()
{
- if(!fcOpt.bHideWhenCListShow || fcOpt.bHideAll || HideOnFullScreen())return;
+ if (!fcOpt.bHideWhenCListShow || fcOpt.bHideAll || HideOnFullScreen())
+ return;
+
for (int i = 0; i < thumbList.getCount(); ++i)
- {
- if ( !fcOpt.bHideOffline || IsStatusVisible( GetContactStatus(thumbList[i]->hContact) ) )
- {
+ if ( !fcOpt.bHideOffline || IsStatusVisible( GetContactStatus(thumbList[i]->hContact) ))
ShowWindow( thumbList[i]->hwnd, SW_SHOWNA );
- }
- }
}
void HideThumbsOnShowCList()
{
- if(!fcOpt.bHideWhenCListShow || fcOpt.bHideAll || HideOnFullScreen())return;
+ if (!fcOpt.bHideWhenCListShow || fcOpt.bHideAll || HideOnFullScreen())return;
for (int i = 0; i < thumbList.getCount(); ++i)
ShowWindow( thumbList[i]->hwnd, SW_HIDE );
}
static LRESULT __stdcall newMirandaWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
- if( uMsg == WM_WINDOWPOSCHANGED)
- {
+ if ( uMsg == WM_WINDOWPOSCHANGED) {
WINDOWPOS *wp = (WINDOWPOS *)lParam;
- if(wp->flags&SWP_HIDEWINDOW) {
+ if (wp->flags&SWP_HIDEWINDOW) {
bIsCListShow = FALSE;
ShowThumbsOnHideCList();
}
- else if(wp->flags&SWP_SHOWWINDOW){
+ else if (wp->flags&SWP_SHOWWINDOW){
bIsCListShow = TRUE;
HideThumbsOnShowCList();
}
- else if(!(wp->flags&SWP_NOMOVE)){
- BYTE method=DBGetContactSettingByte(NULL, "ModernData", "HideBehind", 0);
- if(method) {
- WORD wBehindEdgeBorderSize=DBGetContactSettingWord(NULL, "ModernData", "HideBehindBorderSize", 0);
+ else if (!(wp->flags&SWP_NOMOVE)) {
+ BYTE method = DBGetContactSettingByte(NULL, "ModernData", "HideBehind", 0);
+ if (method) {
+ WORD wBehindEdgeBorderSize = DBGetContactSettingWord(NULL, "ModernData", "HideBehindBorderSize", 0);
RECT rc = {wp->x, wp->y, wp->x+wp->cx, wp->y+wp->cy};
RECT rcScreen = {wBehindEdgeBorderSize*(2-method), 0, GetSystemMetrics(SM_CXSCREEN)-wBehindEdgeBorderSize*(method-1), GetSystemMetrics(SM_CYSCREEN)};
RECT rcOverlap;
BOOL isIntersect;
isIntersect = IntersectRect( &rcOverlap, &rc, &rcScreen );
- if ( !isIntersect && bIsCListShow ){
+ if ( !isIntersect && bIsCListShow ) {
bIsCListShow = FALSE;
ShowThumbsOnHideCList();
}
- else if ( isIntersect && !bIsCListShow ){
+ else if ( isIntersect && !bIsCListShow ) {
bIsCListShow = TRUE;
HideThumbsOnShowCList();
}
diff --git a/plugins/FloatingContacts/options.cpp b/plugins/FloatingContacts/options.cpp
index be257e7456..f4c2c6371c 100644
--- a/plugins/FloatingContacts/options.cpp
+++ b/plugins/FloatingContacts/options.cpp
@@ -28,9 +28,9 @@ static SFontSettings s_rgFontSettingsMiranda[FLT_FONTIDS];
#define FLT_SAME_AS_NONE ((BYTE)0xFF)
#define FLT_SAME_AS_MIRANDA ((BYTE)0xFE)
-static char* s_rgszFontSizes[]={"8","10","14","16","18","20","24","28"};
+static char* s_rgszFontSizes[] = {"8","10","14","16","18","20","24","28"};
-static const TCHAR* s_rgszFontIdDescr[FLT_FONTIDS] =
+static const TCHAR* s_rgszFontIdDescr[FLT_FONTIDS] =
{
_T("Standard contacts"),
_T("Online contacts to whom you have a different visibility"),
@@ -39,7 +39,7 @@ static const TCHAR* s_rgszFontIdDescr[FLT_FONTIDS] =
_T("Contacts which are 'not on list'"),
};
-static WORD s_rgwFontSameAsDefault[FLT_FONTIDS] =
+static WORD s_rgwFontSameAsDefault[FLT_FONTIDS] =
{
MAKEWORD(FLT_SAME_AS_MIRANDA, 0x0F),
MAKEWORD(FLT_SAME_AS_MIRANDA, 0x0F),
@@ -48,7 +48,7 @@ static WORD s_rgwFontSameAsDefault[FLT_FONTIDS] =
MAKEWORD(FLT_SAME_AS_MIRANDA, 0x0F),
};
-static int s_rgnMirandaFontId[FLT_FONTIDS] =
+static int s_rgnMirandaFontId[FLT_FONTIDS] =
{
FONTID_CONTACTS,
FONTID_INVIS,
@@ -106,25 +106,25 @@ OnOptionsInitialize
OPTIONSDIALOGPAGE odp;
ZeroMemory(&odp, sizeof(odp));
- odp.cbSize = sizeof(odp);
- odp.hInstance = hInst;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FLTCONT);
- odp.ptszTitle = _T("Floating Contacts");
- odp.ptszGroup = _T("Plugins");
- odp.ptszTab = _T("Main Features");
- odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
- odp.pfnDlgProc = (DLGPROC)OptWndProc;
+ odp.cbSize = sizeof(odp);
+ odp.hInstance = hInst;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FLTCONT);
+ odp.ptszTitle = _T("Floating Contacts");
+ odp.ptszGroup = _T("Plugins");
+ odp.ptszTab = _T("Main Features");
+ odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
+ odp.pfnDlgProc = (DLGPROC)OptWndProc;
CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
ZeroMemory(&odp, sizeof(odp));
- odp.cbSize = sizeof(odp);
- odp.hInstance = hInst;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SKIN);
- odp.ptszTitle = _T("Floating Contacts");
- odp.ptszGroup = _T("Plugins");
- odp.ptszTab = _T("Appearance");
- odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
- odp.pfnDlgProc = (DLGPROC)OptSknWndProc;
+ odp.cbSize = sizeof(odp);
+ odp.hInstance = hInst;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SKIN);
+ odp.ptszTitle = _T("Floating Contacts");
+ odp.ptszGroup = _T("Plugins");
+ odp.ptszTab = _T("Appearance");
+ odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
+ odp.pfnDlgProc = (DLGPROC)OptSknWndProc;
CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
return 0;
@@ -157,9 +157,9 @@ FillFontListThread
LOGFONTA lf = {0};
HDC hdc = GetDC(hwndDlg);
- lf.lfCharSet = DEFAULT_CHARSET;
- lf.lfFaceName[0] = 0;
- lf.lfPitchAndFamily = 0;
+ lf.lfCharSet = DEFAULT_CHARSET;
+ lf.lfFaceName[0] = 0;
+ lf.lfPitchAndFamily = 0;
EnumFontFamiliesExA(hdc, &lf, (FONTENUMPROCA)EnumFontsProc, (LPARAM)GetDlgItem(hwndDlg,IDC_TYPEFACE), 0);
ReleaseDC(hwndDlg, hdc);
return;
@@ -280,8 +280,8 @@ GetFontSetting
wsprintfA(idstr, "Font%dAs", nFontId);
wSameAs = (WORD)DBGetContactSettingWord(NULL, sModule, idstr, s_rgwFontSameAsDefault[nFontId]);
- bySameAs=LOBYTE(wSameAs);
- bySameAsFlags=HIBYTE(wSameAs);
+ bySameAs = LOBYTE(wSameAs);
+ bySameAsFlags = HIBYTE(wSameAs);
if (FLT_SAME_AS_MIRANDA == bySameAs)
{
@@ -454,20 +454,20 @@ OptWndProc
fcOpt.bFixedWidth = (BOOL)IsDlgButtonChecked(hwndDlg, IDC_CHK_WIDTH);
DBWriteContactSettingByte(NULL, sModule, "FixedWidth", (BYTE)fcOpt.bFixedWidth);
- fcOpt.nThumbWidth = GetDlgItemInt(hwndDlg, IDC_TXT_WIDTH, &bSuccess, FALSE);
+ fcOpt.nThumbWidth = GetDlgItemInt(hwndDlg, IDC_TXT_WIDTH, &bSuccess, FALSE);
DBWriteContactSettingDword(NULL, sModule, "Width", fcOpt.nThumbWidth );
- if(bEnableTip)
+ if (bEnableTip)
{
fcOpt.bShowTip = (BOOL)IsDlgButtonChecked(hwndDlg, IDC_CHK_TIP);
DBWriteContactSettingByte(NULL, sModule, "ShowTip", (BYTE)fcOpt.bShowTip);
- fcOpt.TimeIn = GetDlgItemInt(hwndDlg, IDC_TXT_TIMEIN, &bSuccess, FALSE);
+ fcOpt.TimeIn = GetDlgItemInt(hwndDlg, IDC_TXT_TIMEIN, &bSuccess, FALSE);
DBWriteContactSettingWord(NULL, sModule, "TimeIn", fcOpt.TimeIn );
}
fcOpt.bToTop = (BOOL)IsDlgButtonChecked(hwndDlg, IDC_CHK_TOTOP);
DBWriteContactSettingByte(NULL, sModule, "ToTop", (BYTE)fcOpt.bToTop);
- fcOpt.ToTopTime = GetDlgItemInt(hwndDlg, IDC_TXT_TOTOPTIME, &bSuccess, FALSE);
+ fcOpt.ToTopTime = GetDlgItemInt(hwndDlg, IDC_TXT_TOTOPTIME, &bSuccess, FALSE);
DBWriteContactSettingWord(NULL, sModule, "ToTopTime", fcOpt.ToTopTime );
fcOpt.bHideWhenCListShow = (BOOL)IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDE_WHEN_CLISTSHOW);
@@ -605,7 +605,7 @@ OptSknWndProc
SIZE size;
HFONT hFont = CreateFontIndirectA(&lf);
- hdc=GetDC(hwndDlg);
+ hdc = GetDC(hwndDlg);
SelectObject(hdc, hFont);
GetTextExtentPoint32A(hdc, "x", 1, &size);
ReleaseDC(hwndDlg, hdc);
@@ -790,8 +790,8 @@ OptSknWndProc
}
lf.lfHeight = GetDlgItemInt(hwndDlg, IDC_FONTSIZE, NULL, FALSE);
{
- HDC hdc=GetDC(NULL);
- lf.lfHeight=-MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
+ HDC hdc = GetDC(NULL);
+ lf.lfHeight = -MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
ReleaseDC(NULL,hdc);
}
lf.lfWidth = 0;
@@ -895,7 +895,7 @@ OptSknWndProc
, 0
);
s_rgFontSettings[wParam].size = (char)GetDlgItemInt(hwndDlg, IDC_FONTSIZE, NULL, FALSE);
- s_rgFontSettings[wParam].style= (IsDlgButtonChecked(hwndDlg, IDC_BOLD) ? DBFONTF_BOLD : 0)
+ s_rgFontSettings[wParam].style = (IsDlgButtonChecked(hwndDlg, IDC_BOLD) ? DBFONTF_BOLD : 0)
| (IsDlgButtonChecked(hwndDlg, IDC_ITALIC) ? DBFONTF_ITALIC : 0)
| (IsDlgButtonChecked(hwndDlg, IDC_UNDERLINE) ? DBFONTF_UNDERLINE : 0);
s_rgFontSettings[wParam].colour = SendDlgItemMessage(hwndDlg, IDC_COLOUR, CPM_GETCOLOUR, 0, 0);
@@ -959,7 +959,7 @@ OptSknWndProc
char szPercent[20];
nPos = (BYTE)SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_GETPOS, 0, 0);
- fcOpt.thumbAlpha = (BYTE)(( nPos * 255 ) / 100 );
+ fcOpt.thumbAlpha = (BYTE)(( nPos * 255 ) / 100 );
SetThumbsOpacity(fcOpt.thumbAlpha);
wsprintfA(szPercent, "%d%%", nPos);
@@ -985,7 +985,7 @@ OptSknWndProc
case IDC_BROWSE:
{
char str[MAX_PATH];
- OPENFILENAMEA ofn={0};
+ OPENFILENAMEA ofn = {0};
char filter[512];
GetDlgItemTextA(hwndDlg, IDC_FILENAME, str, sizeof(str));
diff --git a/plugins/FloatingContacts/thumbs.cpp b/plugins/FloatingContacts/thumbs.cpp
index ad08865f01..34501bfd57 100644
--- a/plugins/FloatingContacts/thumbs.cpp
+++ b/plugins/FloatingContacts/thumbs.cpp
@@ -6,13 +6,13 @@ ThumbList thumbList;
/////////////////////////////////////////////////////////////////////////////
// ThumbInfo
static POINT ptOld;
-static BOOL bMouseDown = FALSE;
-static BOOL bMouseIn = FALSE;
-static BOOL bMouseMoved = FALSE;
-static short nLeft = 0;
-static short nTop = 0;
-static int nOffs = 5;
-static ThumbInfo *pThumbMouseIn = NULL;
+static BOOL bMouseDown = FALSE;
+static BOOL bMouseIn = FALSE;
+static BOOL bMouseMoved = FALSE;
+static short nLeft = 0;
+static short nTop = 0;
+static int nOffs = 5;
+static ThumbInfo *pThumbMouseIn = NULL;
static void SnapToScreen( RECT rcThumb, int nX, int nY, int *pX, int *pY )
{
@@ -22,7 +22,7 @@ static void SnapToScreen( RECT rcThumb, int nX, int nY, int *pX, int *pY )
assert( NULL != pX );
assert( NULL != pY );
- nWidth = rcThumb.right - rcThumb.left;
+ nWidth = rcThumb.right - rcThumb.left;
nHeight = rcThumb.bottom - rcThumb.top;
*pX = nX < ( nOffs + rcScreen.left ) ? rcScreen.left : nX;
@@ -40,8 +40,8 @@ ThumbInfo::ThumbInfo()
ThumbInfo::~ThumbInfo()
{
- if(pThumbMouseIn==this){
- pThumbMouseIn=NULL;
+ if (pThumbMouseIn == this){
+ pThumbMouseIn = NULL;
KillTimer(hwnd, TIMERID_LEAVE_T);
}
dropTarget->Release();
@@ -105,7 +105,7 @@ void ThumbInfo::PositionThumbWorker(short nX, short nY, POINT *newPos)
// Get thumb dimnsions
GetThumbRect( &rcThumb );
- nWidth = rcThumb.right - rcThumb.left;
+ nWidth = rcThumb.right - rcThumb.left;
nHeight = rcThumb.bottom - rcThumb.top;
// Docking and screen boundaries check
@@ -121,7 +121,7 @@ void ThumbInfo::PositionThumbWorker(short nX, short nY, POINT *newPos)
for (int i = 0; i < thumbList.getCount(); ++i)
{
- ThumbInfo *pCurThumb = thumbList[i];
+ ThumbInfo *pCurThumb = thumbList[i];
if ( pCurThumb != this )
{
@@ -132,38 +132,38 @@ void ThumbInfo::PositionThumbWorker(short nX, short nY, POINT *newPos)
// These are rects we will dock into
- rcLeft.left = rc.left - nOffs;
- rcLeft.top = rc.top - nOffs;
- rcLeft.right = rc.left + nOffs;
- rcLeft.bottom = rc.bottom + nOffs;
+ rcLeft.left = rc.left - nOffs;
+ rcLeft.top = rc.top - nOffs;
+ rcLeft.right = rc.left + nOffs;
+ rcLeft.bottom = rc.bottom + nOffs;
- rcTop.left = rc.left - nOffs;
- rcTop.top = rc.top - nOffs;
- rcTop.right = rc.right + nOffs;
- rcTop.bottom = rc.top + nOffs;
-
- rcRight.left = rc.right - nOffs;
- rcRight.top = rc.top - nOffs;
- rcRight.right = rc.right + nOffs;
- rcRight.bottom = rc.bottom + nOffs;
-
- rcBottom.left = rc.left - nOffs;
- rcBottom.top = rc.bottom - nOffs;
- rcBottom.right = rc.right + nOffs;
+ rcTop.left = rc.left - nOffs;
+ rcTop.top = rc.top - nOffs;
+ rcTop.right = rc.right + nOffs;
+ rcTop.bottom = rc.top + nOffs;
+
+ rcRight.left = rc.right - nOffs;
+ rcRight.top = rc.top - nOffs;
+ rcRight.right = rc.right + nOffs;
+ rcRight.bottom = rc.bottom + nOffs;
+
+ rcBottom.left = rc.left - nOffs;
+ rcBottom.top = rc.bottom - nOffs;
+ rcBottom.right = rc.right + nOffs;
rcBottom.bottom = rc.bottom + nOffs;
- bDockedLeft = FALSE;
- bDockedRight = FALSE;
+ bDockedLeft = FALSE;
+ bDockedRight = FALSE;
// Upper-left
- pt.x = rcThumb.left;
- pt.y = rcThumb.top;
- bDocked = FALSE;
+ pt.x = rcThumb.left;
+ pt.y = rcThumb.top;
+ bDocked = FALSE;
if ( PtInRect( &rcRight, pt ) )
{
- nNewX = rc.right;
+ nNewX = rc.right;
bDocked = TRUE;
}
@@ -179,21 +179,21 @@ void ThumbInfo::PositionThumbWorker(short nX, short nY, POINT *newPos)
if ( PtInRect( &rcTop, pt ) )
{
- nNewY = rc.top;
- bDockedLeft = bDocked;
+ nNewY = rc.top;
+ bDockedLeft = bDocked;
}
// Upper-right
- pt.x = rcThumb.right;
- pt.y = rcThumb.top;
- bDocked = FALSE;
+ pt.x = rcThumb.right;
+ pt.y = rcThumb.top;
+ bDocked = FALSE;
if ( !bLeading && PtInRect( &rcLeft, pt ) )
{
if ( !bDockedLeft )
{
- nNewX = rc.left - nWidth;
- bDocked = TRUE;
+ nNewX = rc.left - nWidth;
+ bDocked = TRUE;
}
else if ( rc.right == rcThumb.left )
{
@@ -214,8 +214,8 @@ void ThumbInfo::PositionThumbWorker(short nX, short nY, POINT *newPos)
if ( !bLeading && PtInRect( &rcTop, pt ) )
{
- nNewY = rc.top;
- bDockedRight = bDocked;
+ nNewY = rc.top;
+ bDockedRight = bDocked;
}
if ( fcOpt.bMoveTogether )
@@ -281,13 +281,13 @@ void ThumbInfo::PositionThumbWorker(short nX, short nY, POINT *newPos)
void ThumbInfo::ResizeThumb()
{
- HDC hdc = NULL;
- HFONT hOldFont = NULL;
+ HDC hdc = NULL;
+ HFONT hOldFont = NULL;
POINT ptText;
SIZEL sizeIcon;
SIZEL sizeText;
RECT rcThumb;
- int index = FLT_FONTID_NOTONLIST;
+ int index = FLT_FONTID_NOTONLIST;
ThumbInfo *pNextThumb = NULL;
@@ -324,7 +324,7 @@ void ThumbInfo::ResizeThumb()
}
else
{
- index = FLT_FONTID_INVIS;
+ index = FLT_FONTID_INVIS;
}
}
else if (ID_STATUS_OFFLINE == nContactStatus)
@@ -416,7 +416,7 @@ void ThumbInfo::OnLButtonDown(short nX, short nY)
{
RECT rc;
- if(bEnableTip && fcOpt.bShowTip) KillTip();
+ if (bEnableTip && fcOpt.bShowTip) KillTip();
// ptOld.x = nX;
// ptOld.y = nY;
@@ -426,12 +426,12 @@ void ThumbInfo::OnLButtonDown(short nX, short nY)
GetCursorPos(&ptOld);
GetThumbRect(&rc);
- nLeft = (short)rc.left;
- nTop = (short)rc.top;
+ nLeft = (short)rc.left;
+ nTop = (short)rc.top;
- //bMouseIn = FALSE;
- bMouseDown = TRUE;
- bMouseMoved = FALSE;
+ //bMouseIn = FALSE;
+ bMouseDown = TRUE;
+ bMouseMoved = FALSE;
// SetCapture(hwnd);
}
@@ -459,7 +459,7 @@ void ThumbInfo::OnLButtonUp()
if ( IntersectRect( &rcOverlap, &rcMiranda, &rcThumb ) )
{
- if( IsWindowVisible( hwndMiranda ) )
+ if ( IsWindowVisible( hwndMiranda ) )
{
DeleteContactPos( );
thumbList.RemoveThumb( this );
@@ -480,7 +480,7 @@ void ThumbInfo::OnMouseMove(short nX, short nY, WPARAM wParam)
// Position thumb
- if( bMouseDown )
+ if ( bMouseDown )
{
ptNew.x = nX;
@@ -491,8 +491,8 @@ void ThumbInfo::OnMouseMove(short nX, short nY, WPARAM wParam)
dX = ptNew.x - ptOld.x;
dY = ptNew.y - ptOld.y;
- if(dX || dY){
- bMouseMoved = TRUE;
+ if (dX || dY){
+ bMouseMoved = TRUE;
nLeft += (short)dX;
nTop += (short)dY;
@@ -511,25 +511,25 @@ void ThumbInfo::OnMouseMove(short nX, short nY, WPARAM wParam)
if ( !pThumbMouseIn )//
{
SetTimer( hwnd, TIMERID_LEAVE_T, 10, NULL );
- pThumbMouseIn=this;
+ pThumbMouseIn = this;
ThumbSelect( TRUE );
}
- if(bEnableTip && fcOpt.bShowTip && !bMouseDown){
+ if (bEnableTip && fcOpt.bShowTip && !bMouseDown){
WORD tmpTimeIn;
POINT pt;
RECT rc;
GetCursorPos(&pt);
GetThumbRect(&rc);
- if(!PtInRect(&rc,pt)){
+ if (!PtInRect(&rc,pt)) {
KillTip();
return;
}
- if(fTipTimerActive && abs(pt.x-ptTipSt.x)<5 && abs(pt.y-ptTipSt.x)<5){
+ if (fTipTimerActive && abs(pt.x-ptTipSt.x)<5 && abs(pt.y-ptTipSt.x)<5){
return;
}
- ptTipSt=pt;
+ ptTipSt = pt;
if (fTipTimerActive) {
KillTimer(hwnd, TIMERID_HOVER_T);
@@ -602,7 +602,7 @@ void ThumbInfo::UpdateContent()
int oldBkMode, index = 0;// nStatus;
UINT fStyle = ILD_NORMAL;
- HDC hdcDraw = bmpContent.getDC();
+ HDC hdcDraw = bmpContent.getDC();
SetRect(&rc, 0, 0, szSize.cx, szSize.cy);
if ( NULL != hBmpBackground )
@@ -624,7 +624,7 @@ void ThumbInfo::UpdateContent()
height = rcBkgnd.bottom - rcBkgnd.top;
GetObject(hBmpBackground, sizeof(bmp), &bmp);
- hdcBmp = CreateCompatibleDC( hdcDraw );
+ hdcBmp = CreateCompatibleDC( hdcDraw );
hbmTmp = (HBITMAP)SelectObject( hdcBmp, hBmpBackground );
maxx = (0 != (nBackgroundBmpUse & CLBF_TILEH) ? rcBkgnd.right : rcBkgnd.left + 1);
@@ -715,7 +715,7 @@ void ThumbInfo::UpdateContent()
ImageList_GetIconSize_my( himl, size );
- oldBkMode = SetBkMode( hdcDraw, TRANSPARENT );
+ oldBkMode = SetBkMode( hdcDraw, TRANSPARENT );
if (!DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
{
@@ -729,9 +729,9 @@ void ThumbInfo::UpdateContent()
if ( NULL != szProto )
{
- nStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
- nContactStatus = DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
- nApparentMode = DBGetContactSettingWord(hContact, szProto, "ApparentMode", 0);
+ nStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ nContactStatus = DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ nApparentMode = DBGetContactSettingWord(hContact, szProto, "ApparentMode", 0);
if ( (nStatus == ID_STATUS_INVISIBLE && nApparentMode == ID_STATUS_ONLINE) ||
(nStatus != ID_STATUS_INVISIBLE && nApparentMode == ID_STATUS_OFFLINE) )
@@ -742,8 +742,8 @@ void ThumbInfo::UpdateContent()
}
else
{
- index = FLT_FONTID_INVIS;
- if(fcOpt.bShowIdle && DBGetContactSettingDword(hContact, szProto, "IdleTS", 0)){
+ index = FLT_FONTID_INVIS;
+ if (fcOpt.bShowIdle && DBGetContactSettingDword(hContact, szProto, "IdleTS", 0)) {
fStyle|=ILD_BLEND50;
}
}
@@ -755,7 +755,7 @@ void ThumbInfo::UpdateContent()
else
{
index = FLT_FONTID_CONTACTS;
- if(fcOpt.bShowIdle && DBGetContactSettingDword(hContact, szProto, "IdleTS", 0)){
+ if (fcOpt.bShowIdle && DBGetContactSettingDword(hContact, szProto, "IdleTS", 0)) {
fStyle|=ILD_BLEND50;
}
}
@@ -849,23 +849,23 @@ void ThumbInfo::PopUpMessageDialog( )
void ThumbInfo::OnTimer(BYTE idTimer)
{
- if(idTimer == TIMERID_SELECT_T){
+ if (idTimer == TIMERID_SELECT_T){
KillTimer( hwnd, TIMERID_SELECT_T );
ThumbDeselect( FALSE );
}
- if(idTimer == TIMERID_LEAVE_T && !bMouseDown){
+ if (idTimer == TIMERID_LEAVE_T && !bMouseDown){
POINT pt;
RECT rc;
GetCursorPos(&pt);
GetThumbRect(&rc);
- if(!PtInRect(&rc, pt)){
+ if (!PtInRect(&rc, pt)) {
KillTimer( hwnd, TIMERID_LEAVE_T );
- pThumbMouseIn = NULL;
+ pThumbMouseIn = NULL;
ThumbDeselect( TRUE );
}
}
- if(bEnableTip && fcOpt.bShowTip && idTimer == TIMERID_HOVER_T){
+ if (bEnableTip && fcOpt.bShowTip && idTimer == TIMERID_HOVER_T){
POINT pt;
CLCINFOTIP ti = {0};
ti.cbSize = sizeof(ti);
@@ -873,7 +873,7 @@ void ThumbInfo::OnTimer(BYTE idTimer)
KillTimer(hwnd, TIMERID_HOVER_T);
fTipTimerActive = FALSE;
GetCursorPos(&pt);
- if(abs(pt.x-ptTipSt.x)<5 && abs(pt.y-ptTipSt.y)<5){
+ if (abs(pt.x-ptTipSt.x)<5 && abs(pt.y-ptTipSt.y)<5){
ti.ptCursor = pt;
fTipActive = TRUE;
@@ -889,8 +889,8 @@ void DockThumbs( ThumbInfo *pThumbLeft, ThumbInfo *pThumbRight, BOOL bMoveLeft )
{
if ( ( pThumbRight->dockOpt.hwndLeft == NULL ) && ( pThumbLeft->dockOpt.hwndRight == NULL ) )
{
- pThumbRight->dockOpt.hwndLeft = pThumbLeft->hwnd;
- pThumbLeft->dockOpt.hwndRight = pThumbRight->hwnd;
+ pThumbRight->dockOpt.hwndLeft = pThumbLeft->hwnd;
+ pThumbLeft->dockOpt.hwndRight = pThumbRight->hwnd;
}
}
@@ -938,7 +938,7 @@ ThumbList::~ThumbList()
ThumbInfo *ThumbList::AddThumb(HWND hwnd, TCHAR *ptszName, HANDLE hContact)
{
- ThumbInfo *pThumb = NULL;
+ ThumbInfo *pThumb = NULL;
if ( ptszName == NULL ) return( NULL );
if ( hContact == NULL ) return( NULL );
@@ -949,11 +949,11 @@ ThumbInfo *ThumbList::AddThumb(HWND hwnd, TCHAR *ptszName, HANDLE hContact)
if ( pThumb != NULL )
{
_tcsncpy( pThumb->ptszName, ptszName, USERNAME_LEN - 1 );
- pThumb->hContact = hContact;
- pThumb->hwnd = hwnd;
+ pThumb->hContact = hContact;
+ pThumb->hwnd = hwnd;
- pThumb->dockOpt.hwndLeft = NULL;
- pThumb->dockOpt.hwndRight = NULL;
+ pThumb->dockOpt.hwndLeft = NULL;
+ pThumb->dockOpt.hwndRight = NULL;
pThumb->fTipActive = FALSE;
diff --git a/plugins/FreeImage/Miranda/main.cpp b/plugins/FreeImage/Miranda/main.cpp
index 804e349d7e..8a3d538d4b 100644
--- a/plugins/FreeImage/Miranda/main.cpp
+++ b/plugins/FreeImage/Miranda/main.cpp
@@ -406,9 +406,9 @@ SetMemIO(FreeImageIO *io) {
unsigned __stdcall fiio_mem_ReadProc(void *buffer, unsigned size, unsigned count, fi_handle handle) {
unsigned x;
- for( x=0; x<count; x++ ) {
+ for ( x=0; x<count; x++ ) {
//if there isnt size bytes left to read, set pos to eof and return a short count
- if( FIIOMEM(filelen)-FIIOMEM(curpos) < (long)size ) {
+ if ( FIIOMEM(filelen)-FIIOMEM(curpos) < (long)size ) {
FIIOMEM(curpos) = FIIOMEM(filelen);
break;
}
@@ -426,13 +426,13 @@ unsigned __stdcall fiio_mem_WriteProc(void *buffer, unsigned size, unsigned coun
//double the data block size if we need to
while( FIIOMEM(curpos)+(long)(size*count) >= FIIOMEM(datalen) ) {
//if we are at or above 1G, we cant double without going negative
- if( FIIOMEM(datalen) & 0x40000000 ) {
+ if ( FIIOMEM(datalen) & 0x40000000 ) {
//max 2G
- if( FIIOMEM(datalen) == 0x7FFFFFFF ) {
+ if ( FIIOMEM(datalen) == 0x7FFFFFFF ) {
return 0;
}
newdatalen = 0x7FFFFFFF;
- } else if( FIIOMEM(datalen) == 0 ) {
+ } else if ( FIIOMEM(datalen) == 0 ) {
//default to 4K if nothing yet
newdatalen = 4096;
} else {
@@ -440,7 +440,7 @@ unsigned __stdcall fiio_mem_WriteProc(void *buffer, unsigned size, unsigned coun
newdatalen = FIIOMEM(datalen) << 1;
}
newdata = realloc( FIIOMEM(data), newdatalen );
- if( !newdata ) {
+ if ( !newdata ) {
return 0;
}
FIIOMEM(data) = newdata;
@@ -448,7 +448,7 @@ unsigned __stdcall fiio_mem_WriteProc(void *buffer, unsigned size, unsigned coun
}
memcpy( (char *)FIIOMEM(data) + FIIOMEM(curpos), buffer, size*count );
FIIOMEM(curpos) += size*count;
- if( FIIOMEM(curpos) > FIIOMEM(filelen) ) {
+ if ( FIIOMEM(curpos) > FIIOMEM(filelen) ) {
FIIOMEM(filelen) = FIIOMEM(curpos);
}
return count;
@@ -458,21 +458,21 @@ int __stdcall fiio_mem_SeekProc(fi_handle handle, long offset, int origin) {
switch(origin) { //0 to filelen-1 are 'inside' the file
default:
case SEEK_SET: //can fseek() to 0-7FFFFFFF always
- if( offset >= 0 ) {
+ if ( offset >= 0 ) {
FIIOMEM(curpos) = offset;
return 0;
}
break;
case SEEK_CUR:
- if( FIIOMEM(curpos)+offset >= 0 ) {
+ if ( FIIOMEM(curpos)+offset >= 0 ) {
FIIOMEM(curpos) += offset;
return 0;
}
break;
case SEEK_END:
- if( FIIOMEM(filelen)+offset >= 0 ) {
+ if ( FIIOMEM(filelen)+offset >= 0 ) {
FIIOMEM(curpos) = FIIOMEM(filelen)+offset;
return 0;
}
@@ -847,7 +847,7 @@ static INT_PTR serviceGetInterface(WPARAM wParam, LPARAM lParam)
{
FI_INTERFACE **ppfe = (FI_INTERFACE **)lParam;
- if((DWORD)wParam != FI_IF_VERSION)
+ if ((DWORD)wParam != FI_IF_VERSION)
return CALLSERVICE_NOTFOUND;
if(ppfe) {
@@ -877,7 +877,7 @@ static INT_PTR serviceLoad(WPARAM wParam, LPARAM lParam)
}
// check that the plugin has reading capabilities ...
- if((fif != FIF_UNKNOWN) && FreeImage_FIFSupportsReading(fif)) {
+ if ((fif != FIF_UNKNOWN) && FreeImage_FIFSupportsReading(fif)) {
// ok, let's load the file
FIBITMAP *dib;
diff --git a/plugins/FreeImage/Source/FreeImage/BitmapAccess.cpp b/plugins/FreeImage/Source/FreeImage/BitmapAccess.cpp
index 6355c3c293..d87658c24f 100644
--- a/plugins/FreeImage/Source/FreeImage/BitmapAccess.cpp
+++ b/plugins/FreeImage/Source/FreeImage/BitmapAccess.cpp
@@ -130,7 +130,7 @@ void* FreeImage_Aligned_Malloc(size_t amount, size_t alignment) {
That's why the code below allocates *two* alignments instead of one.
*/
void* mem_real = malloc(amount + 2 * alignment);
- if(!mem_real) return NULL;
+ if (!mem_real) return NULL;
char* mem_align = (char*)((unsigned long)(2 * alignment - (unsigned long)mem_real % (unsigned long)alignment) + (unsigned long)mem_real);
*((long*)mem_align - 1) = (long)mem_real;
return mem_align;
@@ -165,7 +165,7 @@ FreeImage_GetImageSizeHeader(BOOL header_only, unsigned width, unsigned height,
// palette is aligned on a 16 bytes boundary
dib_size += sizeof(RGBQUAD) * CalculateUsedPaletteEntries(bpp);
dib_size += (dib_size % FIBITMAP_ALIGNMENT ? FIBITMAP_ALIGNMENT - dib_size % FIBITMAP_ALIGNMENT : 0);
- if(!header_only) {
+ if (!header_only) {
const size_t header_size = dib_size;
// pixels are aligned on a 16 bytes boundary
@@ -396,7 +396,7 @@ FreeImage_Unload(FIBITMAP *dib) {
FIBITMAP * DLL_CALLCONV
FreeImage_Clone(FIBITMAP *dib) {
- if(!dib) return NULL;
+ if (!dib) return NULL;
unsigned width = FreeImage_GetWidth(dib);
unsigned height = FreeImage_GetHeight(dib);
@@ -915,7 +915,7 @@ FreeImage_SetDotsPerMeterY(FIBITMAP *dib, unsigned res) {
BITMAPINFOHEADER * DLL_CALLCONV
FreeImage_GetInfoHeader(FIBITMAP *dib) {
- if(!dib) return NULL;
+ if (!dib) return NULL;
size_t lp = (size_t)dib->data + sizeof(FREEIMAGEHEADER);
lp += (lp % FIBITMAP_ALIGNMENT ? FIBITMAP_ALIGNMENT - lp % FIBITMAP_ALIGNMENT : 0);
lp += FIBITMAP_ALIGNMENT - sizeof(BITMAPINFOHEADER) % FIBITMAP_ALIGNMENT;
@@ -933,13 +933,13 @@ FreeImage_GetInfo(FIBITMAP *dib) {
FIMETADATA * DLL_CALLCONV
FreeImage_FindFirstMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, FITAG **tag) {
- if(!dib)
+ if (!dib)
return NULL;
// get the metadata model
METADATAMAP *metadata = ((FREEIMAGEHEADER *)dib->data)->metadata;
TAGMAP *tagmap = NULL;
- if( (*metadata).find(model) != (*metadata).end() ) {
+ if ( (*metadata).find(model) != (*metadata).end() ) {
tagmap = (*metadata)[model];
}
if(tagmap) {
@@ -976,7 +976,7 @@ FreeImage_FindFirstMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, FITAG **tag
BOOL DLL_CALLCONV
FreeImage_FindNextMetadata(FIMETADATA *mdhandle, FITAG **tag) {
- if(!mdhandle)
+ if (!mdhandle)
return FALSE;
METADATAHEADER *mdh = (METADATAHEADER *)mdhandle->data;
@@ -1019,7 +1019,7 @@ FreeImage_FindCloseMetadata(FIMETADATA *mdhandle) {
BOOL DLL_CALLCONV
FreeImage_CloneMetadata(FIBITMAP *dst, FIBITMAP *src) {
- if(!src || !dst) return FALSE;
+ if (!src || !dst) return FALSE;
// get metadata links
METADATAMAP *src_metadata = ((FREEIMAGEHEADER *)src->data)->metadata;
@@ -1034,7 +1034,7 @@ FreeImage_CloneMetadata(FIBITMAP *dst, FIBITMAP *src) {
TAGMAP *src_tagmap = (*i).second;
if(src_tagmap) {
- if( dst_metadata->find(model) != dst_metadata->end() ) {
+ if ( dst_metadata->find(model) != dst_metadata->end() ) {
// destroy dst model
FreeImage_SetMetadata((FREE_IMAGE_MDMODEL)model, dst, NULL, NULL);
}
@@ -1069,7 +1069,7 @@ FreeImage_CloneMetadata(FIBITMAP *dst, FIBITMAP *src) {
BOOL DLL_CALLCONV
FreeImage_SetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG *tag) {
- if(!dib)
+ if (!dib)
return FALSE;
TAGMAP *tagmap = NULL;
@@ -1083,7 +1083,7 @@ FreeImage_SetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key,
if(key != NULL) {
- if(!tagmap) {
+ if (!tagmap) {
// this model, doesn't exist: create it
tagmap = new(std::nothrow) TAGMAP();
(*metadata)[model] = tagmap;
@@ -1158,7 +1158,7 @@ FreeImage_SetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key,
BOOL DLL_CALLCONV
FreeImage_GetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG **tag) {
- if(!dib || !key || !tag)
+ if (!dib || !key || !tag)
return FALSE;
TAGMAP *tagmap = NULL;
@@ -1166,7 +1166,7 @@ FreeImage_GetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key,
// get the metadata model
METADATAMAP *metadata = ((FREEIMAGEHEADER *)dib->data)->metadata;
- if(!(*metadata).empty()) {
+ if (!(*metadata).empty()) {
METADATAMAP::iterator model_iterator = metadata->find(model);
if (model_iterator != metadata->end() ) {
// this model exists : try to get the requested tag
@@ -1186,17 +1186,17 @@ FreeImage_GetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key,
unsigned DLL_CALLCONV
FreeImage_GetMetadataCount(FREE_IMAGE_MDMODEL model, FIBITMAP *dib) {
- if(!dib)
+ if (!dib)
return FALSE;
TAGMAP *tagmap = NULL;
// get the metadata model
METADATAMAP *metadata = ((FREEIMAGEHEADER *)dib->data)->metadata;
- if( (*metadata).find(model) != (*metadata).end() ) {
+ if ( (*metadata).find(model) != (*metadata).end() ) {
tagmap = (*metadata)[model];
}
- if(!tagmap) {
+ if (!tagmap) {
// this model, doesn't exist: return
return 0;
}
diff --git a/plugins/FreeImage/Source/FreeImage/Conversion.cpp b/plugins/FreeImage/Source/FreeImage/Conversion.cpp
index 04cec65ab5..3c14bab9dd 100644
--- a/plugins/FreeImage/Source/FreeImage/Conversion.cpp
+++ b/plugins/FreeImage/Source/FreeImage/Conversion.cpp
@@ -145,7 +145,7 @@ _convertCMYKtoRGBA(unsigned width, unsigned height, BYTE* line_start, unsigned p
BOOL
ConvertCMYKtoRGBA(FIBITMAP* dib) {
- if(!FreeImage_HasPixels(dib)) {
+ if (!FreeImage_HasPixels(dib)) {
return FALSE;
}
@@ -294,7 +294,7 @@ _convertLABtoRGB(unsigned width, unsigned height, BYTE* line_start, unsigned pit
BOOL
ConvertLABtoRGB(FIBITMAP* dib) {
- if(!FreeImage_HasPixels(dib)) {
+ if (!FreeImage_HasPixels(dib)) {
return FALSE;
}
@@ -330,7 +330,7 @@ ConvertLABtoRGB(FIBITMAP* dib) {
FIBITMAP*
RemoveAlphaChannel(FIBITMAP* src) {
- if(!FreeImage_HasPixels(src)) {
+ if (!FreeImage_HasPixels(src)) {
return NULL;
}
@@ -367,10 +367,10 @@ FreeImage_ColorQuantize(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize) {
FIBITMAP * DLL_CALLCONV
FreeImage_ColorQuantizeEx(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize, int PaletteSize, int ReserveSize, RGBQUAD *ReservePalette) {
- if( PaletteSize < 2 ) PaletteSize = 2;
- if( PaletteSize > 256 ) PaletteSize = 256;
- if( ReserveSize < 0 ) ReserveSize = 0;
- if( ReserveSize > PaletteSize ) ReserveSize = PaletteSize;
+ if ( PaletteSize < 2 ) PaletteSize = 2;
+ if ( PaletteSize > 256 ) PaletteSize = 256;
+ if ( ReserveSize < 0 ) ReserveSize = 0;
+ if ( ReserveSize > PaletteSize ) ReserveSize = PaletteSize;
if (FreeImage_HasPixels(dib)) {
if (FreeImage_GetBPP(dib) == 24) {
switch(quantize) {
diff --git a/plugins/FreeImage/Source/FreeImage/Conversion16_555.cpp b/plugins/FreeImage/Source/FreeImage/Conversion16_555.cpp
index abaf2f1824..c0c4785704 100644
--- a/plugins/FreeImage/Source/FreeImage/Conversion16_555.cpp
+++ b/plugins/FreeImage/Source/FreeImage/Conversion16_555.cpp
@@ -115,7 +115,7 @@ FreeImage_ConvertLine32To16_555(BYTE *target, BYTE *source, int width_in_pixels)
FIBITMAP * DLL_CALLCONV
FreeImage_ConvertTo16Bits555(FIBITMAP *dib) {
- if(!FreeImage_HasPixels(dib) || (FreeImage_GetImageType(dib) != FIT_BITMAP)) return NULL;
+ if (!FreeImage_HasPixels(dib) || (FreeImage_GetImageType(dib) != FIT_BITMAP)) return NULL;
const int width = FreeImage_GetWidth(dib);
const int height = FreeImage_GetHeight(dib);
diff --git a/plugins/FreeImage/Source/FreeImage/Conversion16_565.cpp b/plugins/FreeImage/Source/FreeImage/Conversion16_565.cpp
index eb3dd9de3f..28e8255b4e 100644
--- a/plugins/FreeImage/Source/FreeImage/Conversion16_565.cpp
+++ b/plugins/FreeImage/Source/FreeImage/Conversion16_565.cpp
@@ -111,7 +111,7 @@ FreeImage_ConvertLine32To16_565(BYTE *target, BYTE *source, int width_in_pixels)
FIBITMAP * DLL_CALLCONV
FreeImage_ConvertTo16Bits565(FIBITMAP *dib) {
- if(!FreeImage_HasPixels(dib) || (FreeImage_GetImageType(dib) != FIT_BITMAP)) return NULL;
+ if (!FreeImage_HasPixels(dib) || (FreeImage_GetImageType(dib) != FIT_BITMAP)) return NULL;
const int width = FreeImage_GetWidth(dib);
const int height = FreeImage_GetHeight(dib);
diff --git a/plugins/FreeImage/Source/FreeImage/Conversion24.cpp b/plugins/FreeImage/Source/FreeImage/Conversion24.cpp
index e99eb5d4df..f04b946ef0 100644
--- a/plugins/FreeImage/Source/FreeImage/Conversion24.cpp
+++ b/plugins/FreeImage/Source/FreeImage/Conversion24.cpp
@@ -121,12 +121,12 @@ FreeImage_ConvertLine32To24(BYTE *target, BYTE *source, int width_in_pixels) {
FIBITMAP * DLL_CALLCONV
FreeImage_ConvertTo24Bits(FIBITMAP *dib) {
- if(!FreeImage_HasPixels(dib)) return NULL;
+ if (!FreeImage_HasPixels(dib)) return NULL;
const unsigned bpp = FreeImage_GetBPP(dib);
const FREE_IMAGE_TYPE image_type = FreeImage_GetImageType(dib);
- if((image_type != FIT_BITMAP) && (image_type != FIT_RGB16)) {
+ if ((image_type != FIT_BITMAP) && (image_type != FIT_RGB16)) {
return NULL;
}
diff --git a/plugins/FreeImage/Source/FreeImage/Conversion32.cpp b/plugins/FreeImage/Source/FreeImage/Conversion32.cpp
index b8bd518471..fad74671cd 100644
--- a/plugins/FreeImage/Source/FreeImage/Conversion32.cpp
+++ b/plugins/FreeImage/Source/FreeImage/Conversion32.cpp
@@ -186,12 +186,12 @@ FreeImage_ConvertLine8To32MapTransparency(BYTE *target, BYTE *source, int width_
FIBITMAP * DLL_CALLCONV
FreeImage_ConvertTo32Bits(FIBITMAP *dib) {
- if(!FreeImage_HasPixels(dib)) return NULL;
+ if (!FreeImage_HasPixels(dib)) return NULL;
const int bpp = FreeImage_GetBPP(dib);
const FREE_IMAGE_TYPE image_type = FreeImage_GetImageType(dib);
- if((image_type != FIT_BITMAP) && (image_type != FIT_RGB16) && (image_type != FIT_RGBA16)) {
+ if ((image_type != FIT_BITMAP) && (image_type != FIT_RGB16) && (image_type != FIT_RGBA16)) {
return NULL;
}
diff --git a/plugins/FreeImage/Source/FreeImage/Conversion4.cpp b/plugins/FreeImage/Source/FreeImage/Conversion4.cpp
index 13048b6d3f..7c09ac824a 100644
--- a/plugins/FreeImage/Source/FreeImage/Conversion4.cpp
+++ b/plugins/FreeImage/Source/FreeImage/Conversion4.cpp
@@ -29,7 +29,7 @@
void DLL_CALLCONV
FreeImage_ConvertLine1To4(BYTE *target, BYTE *source, int width_in_pixels) {
BOOL hinibble = TRUE;
- for (int cols = 0; cols < width_in_pixels; cols++){
+ for (int cols = 0; cols < width_in_pixels; cols++) {
if (hinibble == TRUE){
target[cols >> 1] = ((source[cols >> 3] & (0x80 >> (cols & 0x07))) != 0 ? 15 : 0) << 4;
}
@@ -46,7 +46,7 @@ FreeImage_ConvertLine8To4(BYTE *target, BYTE *source, int width_in_pixels, RGBQU
BOOL hinibble = TRUE;
BYTE index;
- for (int cols = 0; cols < width_in_pixels; cols++){
+ for (int cols = 0; cols < width_in_pixels; cols++) {
index = GREY(palette[source[cols]].rgbRed, palette[source[cols]].rgbGreen, palette[source[cols]].rgbBlue);
if (hinibble) {
target[cols >> 1] = (index & 0xF0);
@@ -140,7 +140,7 @@ FreeImage_ConvertLine32To4(BYTE *target, BYTE *source, int width_in_pixels) {
FIBITMAP * DLL_CALLCONV
FreeImage_ConvertTo4Bits(FIBITMAP *dib) {
- if(!FreeImage_HasPixels(dib)) return NULL;
+ if (!FreeImage_HasPixels(dib)) return NULL;
const int bpp = FreeImage_GetBPP(dib);
diff --git a/plugins/FreeImage/Source/FreeImage/Conversion8.cpp b/plugins/FreeImage/Source/FreeImage/Conversion8.cpp
index 05e3944394..2eaeb94671 100644
--- a/plugins/FreeImage/Source/FreeImage/Conversion8.cpp
+++ b/plugins/FreeImage/Source/FreeImage/Conversion8.cpp
@@ -101,12 +101,12 @@ FreeImage_ConvertLine32To8(BYTE *target, BYTE *source, int width_in_pixels) {
FIBITMAP * DLL_CALLCONV
FreeImage_ConvertTo8Bits(FIBITMAP *dib) {
- if(!FreeImage_HasPixels(dib)) return NULL;
+ if (!FreeImage_HasPixels(dib)) return NULL;
const int bpp = FreeImage_GetBPP(dib);
const FREE_IMAGE_TYPE image_type = FreeImage_GetImageType(dib);
- if((image_type != FIT_BITMAP) && (image_type != FIT_UINT16)) {
+ if ((image_type != FIT_BITMAP) && (image_type != FIT_UINT16)) {
return NULL;
}
@@ -250,12 +250,12 @@ FreeImage_ConvertTo8Bits(FIBITMAP *dib) {
FIBITMAP * DLL_CALLCONV
FreeImage_ConvertToGreyscale(FIBITMAP *dib) {
- if(!FreeImage_HasPixels(dib)) return NULL;
+ if (!FreeImage_HasPixels(dib)) return NULL;
const FREE_IMAGE_COLOR_TYPE color_type = FreeImage_GetColorType(dib);
const int bpp = FreeImage_GetBPP(dib);
- if((color_type == FIC_PALETTE) || (color_type == FIC_MINISWHITE)) {
+ if ((color_type == FIC_PALETTE) || (color_type == FIC_MINISWHITE)) {
const int width = FreeImage_GetWidth(dib);
const int height = FreeImage_GetHeight(dib);
FIBITMAP *new_dib = FreeImage_Allocate(width, height, 8);
diff --git a/plugins/FreeImage/Source/FreeImage/ConversionFloat.cpp b/plugins/FreeImage/Source/FreeImage/ConversionFloat.cpp
index e72d14cb83..181ff396e1 100644
--- a/plugins/FreeImage/Source/FreeImage/ConversionFloat.cpp
+++ b/plugins/FreeImage/Source/FreeImage/ConversionFloat.cpp
@@ -31,7 +31,7 @@ FreeImage_ConvertToFloat(FIBITMAP *dib) {
FIBITMAP *src = NULL;
FIBITMAP *dst = NULL;
- if(!FreeImage_HasPixels(dib)) return NULL;
+ if (!FreeImage_HasPixels(dib)) return NULL;
FREE_IMAGE_TYPE src_type = FreeImage_GetImageType(dib);
@@ -40,11 +40,11 @@ FreeImage_ConvertToFloat(FIBITMAP *dib) {
case FIT_BITMAP:
{
// allow conversion from 8-bit
- if((FreeImage_GetBPP(dib) == 8) && (FreeImage_GetColorType(dib) == FIC_MINISBLACK)) {
+ if ((FreeImage_GetBPP(dib) == 8) && (FreeImage_GetColorType(dib) == FIC_MINISBLACK)) {
src = dib;
} else {
src = FreeImage_ConvertToGreyscale(dib);
- if(!src) return NULL;
+ if (!src) return NULL;
}
break;
}
@@ -68,7 +68,7 @@ FreeImage_ConvertToFloat(FIBITMAP *dib) {
const unsigned height = FreeImage_GetHeight(src);
dst = FreeImage_AllocateT(FIT_FLOAT, width, height);
- if(!dst) {
+ if (!dst) {
if(src != dib) {
FreeImage_Unload(src);
}
diff --git a/plugins/FreeImage/Source/FreeImage/ConversionRGB16.cpp b/plugins/FreeImage/Source/FreeImage/ConversionRGB16.cpp
index bd38504a1e..6b9d17fbed 100644
--- a/plugins/FreeImage/Source/FreeImage/ConversionRGB16.cpp
+++ b/plugins/FreeImage/Source/FreeImage/ConversionRGB16.cpp
@@ -31,7 +31,7 @@ FreeImage_ConvertToRGB16(FIBITMAP *dib) {
FIBITMAP *src = NULL;
FIBITMAP *dst = NULL;
- if(!FreeImage_HasPixels(dib)) return NULL;
+ if (!FreeImage_HasPixels(dib)) return NULL;
const FREE_IMAGE_TYPE src_type = FreeImage_GetImageType(dib);
@@ -40,11 +40,11 @@ FreeImage_ConvertToRGB16(FIBITMAP *dib) {
case FIT_BITMAP:
{
// convert to 24-bit if needed
- if((FreeImage_GetBPP(dib) == 24) || (FreeImage_GetBPP(dib) == 32)) {
+ if ((FreeImage_GetBPP(dib) == 24) || (FreeImage_GetBPP(dib) == 32)) {
src = dib;
} else {
src = FreeImage_ConvertTo24Bits(dib);
- if(!src) return NULL;
+ if (!src) return NULL;
}
break;
}
@@ -70,7 +70,7 @@ FreeImage_ConvertToRGB16(FIBITMAP *dib) {
const unsigned height = FreeImage_GetHeight(src);
dst = FreeImage_AllocateT(FIT_RGB16, width, height);
- if(!dst) {
+ if (!dst) {
if(src != dib) {
FreeImage_Unload(src);
}
diff --git a/plugins/FreeImage/Source/FreeImage/ConversionRGBF.cpp b/plugins/FreeImage/Source/FreeImage/ConversionRGBF.cpp
index b5161d566d..6b8739532f 100644
--- a/plugins/FreeImage/Source/FreeImage/ConversionRGBF.cpp
+++ b/plugins/FreeImage/Source/FreeImage/ConversionRGBF.cpp
@@ -31,7 +31,7 @@ FreeImage_ConvertToRGBF(FIBITMAP *dib) {
FIBITMAP *src = NULL;
FIBITMAP *dst = NULL;
- if(!FreeImage_HasPixels(dib)) return NULL;
+ if (!FreeImage_HasPixels(dib)) return NULL;
const FREE_IMAGE_TYPE src_type = FreeImage_GetImageType(dib);
@@ -41,9 +41,9 @@ FreeImage_ConvertToRGBF(FIBITMAP *dib) {
{
// allow conversion from 24- and 32-bit
const FREE_IMAGE_COLOR_TYPE color_type = FreeImage_GetColorType(dib);
- if((color_type != FIC_RGB) && (color_type != FIC_RGBALPHA)) {
+ if ((color_type != FIC_RGB) && (color_type != FIC_RGBALPHA)) {
src = FreeImage_ConvertTo24Bits(dib);
- if(!src) return NULL;
+ if (!src) return NULL;
} else {
src = dib;
}
@@ -83,7 +83,7 @@ FreeImage_ConvertToRGBF(FIBITMAP *dib) {
const unsigned height = FreeImage_GetHeight(src);
dst = FreeImage_AllocateT(FIT_RGBF, width, height);
- if(!dst) {
+ if (!dst) {
if(src != dib) {
FreeImage_Unload(src);
}
diff --git a/plugins/FreeImage/Source/FreeImage/ConversionType.cpp b/plugins/FreeImage/Source/FreeImage/ConversionType.cpp
index b537f72814..23528b60fe 100644
--- a/plugins/FreeImage/Source/FreeImage/ConversionType.cpp
+++ b/plugins/FreeImage/Source/FreeImage/ConversionType.cpp
@@ -47,7 +47,7 @@ CONVERT_TYPE<Tdst, Tsrc>::convert(FIBITMAP *src, FREE_IMAGE_TYPE dst_type) {
dst = FreeImage_AllocateT(dst_type, width, height, bpp,
FreeImage_GetRedMask(src), FreeImage_GetGreenMask(src), FreeImage_GetBlueMask(src));
- if(!dst) return NULL;
+ if (!dst) return NULL;
// convert from src_type to dst_type
@@ -86,7 +86,7 @@ CONVERT_TO_BYTE<Tsrc>::convert(FIBITMAP *src, BOOL scale_linear) {
// allocate a 8-bit dib
dst = FreeImage_AllocateT(FIT_BITMAP, width, height, 8, 0, 0, 0);
- if(!dst) return NULL;
+ if (!dst) return NULL;
// build a greyscale palette
RGBQUAD *pal = FreeImage_GetPalette(dst);
@@ -160,7 +160,7 @@ CONVERT_TO_COMPLEX<Tsrc>::convert(FIBITMAP *src) {
// allocate dst image
dst = FreeImage_AllocateT(FIT_COMPLEX, width, height);
- if(!dst) return NULL;
+ if (!dst) return NULL;
// convert from src_type to FIT_COMPLEX
@@ -236,7 +236,7 @@ FIBITMAP* DLL_CALLCONV
FreeImage_ConvertToStandardType(FIBITMAP *src, BOOL scale_linear) {
FIBITMAP *dst = NULL;
- if(!src) return NULL;
+ if (!src) return NULL;
// convert from src_type to FIT_BITMAP
@@ -306,7 +306,7 @@ FIBITMAP* DLL_CALLCONV
FreeImage_ConvertToType(FIBITMAP *src, FREE_IMAGE_TYPE dst_type, BOOL scale_linear) {
FIBITMAP *dst = NULL;
- if(!FreeImage_HasPixels(src)) return NULL;
+ if (!FreeImage_HasPixels(src)) return NULL;
// convert from src_type to dst_type
diff --git a/plugins/FreeImage/Source/FreeImage/ConversionUINT16.cpp b/plugins/FreeImage/Source/FreeImage/ConversionUINT16.cpp
index ed4691f3a2..3744cfe3b4 100644
--- a/plugins/FreeImage/Source/FreeImage/ConversionUINT16.cpp
+++ b/plugins/FreeImage/Source/FreeImage/ConversionUINT16.cpp
@@ -31,7 +31,7 @@ FreeImage_ConvertToUINT16(FIBITMAP *dib) {
FIBITMAP *src = NULL;
FIBITMAP *dst = NULL;
- if(!FreeImage_HasPixels(dib)) return NULL;
+ if (!FreeImage_HasPixels(dib)) return NULL;
const FREE_IMAGE_TYPE src_type = FreeImage_GetImageType(dib);
@@ -40,11 +40,11 @@ FreeImage_ConvertToUINT16(FIBITMAP *dib) {
case FIT_BITMAP:
{
// convert to greyscale if needed
- if((FreeImage_GetBPP(dib) == 8) && (FreeImage_GetColorType(dib) == FIC_MINISBLACK)) {
+ if ((FreeImage_GetBPP(dib) == 8) && (FreeImage_GetColorType(dib) == FIC_MINISBLACK)) {
src = dib;
} else {
src = FreeImage_ConvertToGreyscale(dib);
- if(!src) return NULL;
+ if (!src) return NULL;
}
break;
}
@@ -70,7 +70,7 @@ FreeImage_ConvertToUINT16(FIBITMAP *dib) {
const unsigned height = FreeImage_GetHeight(src);
dst = FreeImage_AllocateT(FIT_UINT16, width, height);
- if(!dst) {
+ if (!dst) {
if(src != dib) {
FreeImage_Unload(src);
}
diff --git a/plugins/FreeImage/Source/FreeImage/FreeImageIO.cpp b/plugins/FreeImage/Source/FreeImage/FreeImageIO.cpp
index f8cf7604eb..b289530be7 100644
--- a/plugins/FreeImage/Source/FreeImage/FreeImageIO.cpp
+++ b/plugins/FreeImage/Source/FreeImage/FreeImageIO.cpp
@@ -69,7 +69,7 @@ _MemoryReadProc(void *buffer, unsigned size, unsigned count, fi_handle handle) {
for(x = 0; x < count; x++) {
//if there isnt size bytes left to read, set pos to eof and return a short count
- if( (mem_header->filelen - mem_header->curpos) < (long)size ) {
+ if ( (mem_header->filelen - mem_header->curpos) < (long)size ) {
mem_header->curpos = mem_header->filelen;
break;
}
@@ -91,13 +91,13 @@ _MemoryWriteProc(void *buffer, unsigned size, unsigned count, fi_handle handle)
//double the data block size if we need to
while( (mem_header->curpos + (long)(size*count)) >= mem_header->datalen ) {
//if we are at or above 1G, we cant double without going negative
- if( mem_header->datalen & 0x40000000 ) {
+ if ( mem_header->datalen & 0x40000000 ) {
//max 2G
- if( mem_header->datalen == 0x7FFFFFFF ) {
+ if ( mem_header->datalen == 0x7FFFFFFF ) {
return 0;
}
newdatalen = 0x7FFFFFFF;
- } else if( mem_header->datalen == 0 ) {
+ } else if ( mem_header->datalen == 0 ) {
//default to 4K if nothing yet
newdatalen = 4096;
} else {
@@ -105,7 +105,7 @@ _MemoryWriteProc(void *buffer, unsigned size, unsigned count, fi_handle handle)
newdatalen = mem_header->datalen << 1;
}
newdata = realloc( mem_header->data, newdatalen );
- if( !newdata ) {
+ if ( !newdata ) {
return 0;
}
mem_header->data = newdata;
@@ -113,7 +113,7 @@ _MemoryWriteProc(void *buffer, unsigned size, unsigned count, fi_handle handle)
}
memcpy( (char *)mem_header->data + mem_header->curpos, buffer, size*count );
mem_header->curpos += size*count;
- if( mem_header->curpos > mem_header->filelen ) {
+ if ( mem_header->curpos > mem_header->filelen ) {
mem_header->filelen = mem_header->curpos;
}
return count;
@@ -126,21 +126,21 @@ _MemorySeekProc(fi_handle handle, long offset, int origin) {
switch(origin) { //0 to filelen-1 are 'inside' the file
default:
case SEEK_SET: //can fseek() to 0-7FFFFFFF always
- if( offset >= 0 ) {
+ if ( offset >= 0 ) {
mem_header->curpos = offset;
return 0;
}
break;
case SEEK_CUR:
- if( mem_header->curpos + offset >= 0 ) {
+ if ( mem_header->curpos + offset >= 0 ) {
mem_header->curpos += offset;
return 0;
}
break;
case SEEK_END:
- if( mem_header->filelen + offset >= 0 ) {
+ if ( mem_header->filelen + offset >= 0 ) {
mem_header->curpos = mem_header->filelen + offset;
return 0;
}
diff --git a/plugins/FreeImage/Source/FreeImage/Halftoning.cpp b/plugins/FreeImage/Source/FreeImage/Halftoning.cpp
index 313cc26e15..82df9b607b 100644
--- a/plugins/FreeImage/Source/FreeImage/Halftoning.cpp
+++ b/plugins/FreeImage/Source/FreeImage/Halftoning.cpp
@@ -312,7 +312,7 @@ FIBITMAP * DLL_CALLCONV
FreeImage_Dither(FIBITMAP *dib, FREE_IMAGE_DITHER algorithm) {
FIBITMAP *input = NULL, *dib8 = NULL;
- if(!FreeImage_HasPixels(dib)) return NULL;
+ if (!FreeImage_HasPixels(dib)) return NULL;
const unsigned bpp = FreeImage_GetBPP(dib);
@@ -401,7 +401,7 @@ FIBITMAP * DLL_CALLCONV
FreeImage_Threshold(FIBITMAP *dib, BYTE T) {
FIBITMAP *dib8 = NULL;
- if(!FreeImage_HasPixels(dib)) return NULL;
+ if (!FreeImage_HasPixels(dib)) return NULL;
const unsigned bpp = FreeImage_GetBPP(dib);
diff --git a/plugins/FreeImage/Source/FreeImage/J2KHelper.cpp b/plugins/FreeImage/Source/FreeImage/J2KHelper.cpp
index d0abd793eb..44b210aca0 100644
--- a/plugins/FreeImage/Source/FreeImage/J2KHelper.cpp
+++ b/plugins/FreeImage/Source/FreeImage/J2KHelper.cpp
@@ -57,7 +57,7 @@ FIBITMAP* J2KImageToFIBITMAP(int format_id, const opj_image_t *image) {
BOOL bIsValid = TRUE;
for(int c = 0; c < numcomps - 1; c++) {
- if( (image->comps[c].dx == image->comps[c+1].dx) &&
+ if ( (image->comps[c].dx == image->comps[c+1].dx) &&
(image->comps[c].dy == image->comps[c+1].dy) &&
(image->comps[c].prec == image->comps[c+1].prec) ) {
continue;
@@ -67,7 +67,7 @@ FIBITMAP* J2KImageToFIBITMAP(int format_id, const opj_image_t *image) {
}
}
bIsValid &= ((numcomps == 1) || (numcomps == 3) || (numcomps == 4));
- if(!bIsValid) {
+ if (!bIsValid) {
if(numcomps) {
FreeImage_OutputMessageProc(format_id, "Warning: image contains %d greyscale components. Only the first will be loaded.\n", numcomps);
numcomps = 1;
@@ -106,7 +106,7 @@ FIBITMAP* J2KImageToFIBITMAP(int format_id, const opj_image_t *image) {
} else {
throw FI_MSG_ERROR_UNSUPPORTED_FORMAT;
}
- if(!dib) {
+ if (!dib) {
throw FI_MSG_ERROR_DIB_MEMORY;
}
@@ -398,7 +398,7 @@ opj_image_t* FIBITMAPToJ2KImage(int format_id, FIBITMAP *dib, const opj_cparamet
}
// create the image
image = opj_image_create(numcomps, &cmptparm[0], color_space);
- if(!image) {
+ if (!image) {
throw FI_MSG_ERROR_DIB_MEMORY;
}
diff --git a/plugins/FreeImage/Source/FreeImage/MultiPage.cpp b/plugins/FreeImage/Source/FreeImage/MultiPage.cpp
index 8eaa0aa1f4..e5bcee3ded 100644
--- a/plugins/FreeImage/Source/FreeImage/MultiPage.cpp
+++ b/plugins/FreeImage/Source/FreeImage/MultiPage.cpp
@@ -328,7 +328,7 @@ FreeImage_OpenMultiBitmapU(FREE_IMAGE_FORMAT fif, const wchar_t *filename, BOOL
// convert to single character - no national chars in extensions
char *extension = (char *)malloc(wcslen(filename)+1);
unsigned int i=0;
- for(; i < wcslen(filename); i++) // convert 16-bit to 8-bit
+ for (; i < wcslen(filename); i++) // convert 16-bit to 8-bit
extension[i] = (char)(filename[i] & 0x00FF);
// set terminating 0
extension[i]=0;
@@ -400,7 +400,7 @@ FreeImage_OpenMultiBitmapFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_h
BOOL DLL_CALLCONV
FreeImage_SaveMultiBitmapToHandle(FREE_IMAGE_FORMAT fif, FIMULTIBITMAP *bitmap, FreeImageIO *io, fi_handle handle, int flags) {
- if(!bitmap || !bitmap->data || !io || !handle) {
+ if (!bitmap || !bitmap->data || !io || !handle) {
return FALSE;
}
@@ -546,7 +546,7 @@ FreeImage_CloseMultiBitmap(FIMULTIBITMAP *bitmap, int flags) {
if (success) {
remove(header->m_filename);
success = (rename(spool_name.c_str(), header->m_filename) == 0) ? TRUE:FALSE;
- if(!success) {
+ if (!success) {
FreeImage_OutputMessageProc(header->fif, "Failed to rename %s to %s", spool_name.c_str(), header->m_filename);
}
} else {
@@ -647,12 +647,12 @@ FreeImage_SavePageToBlock(MULTIBITMAPHEADER *header, FIBITMAP *data) {
FIMEMORY *hmem = FreeImage_OpenMemory();
if(hmem==NULL) return NULL;
// save the file to memory
- if(!FreeImage_SaveToMemory(header->cache_fif, data, hmem, 0)) {
+ if (!FreeImage_SaveToMemory(header->cache_fif, data, hmem, 0)) {
FreeImage_CloseMemory(hmem);
return NULL;
}
// get the buffer from the memory stream
- if(!FreeImage_AcquireMemory(hmem, &compressed_data, &compressed_size)) {
+ if (!FreeImage_AcquireMemory(hmem, &compressed_data, &compressed_size)) {
FreeImage_CloseMemory(hmem);
return NULL;
}
diff --git a/plugins/FreeImage/Source/FreeImage/NNQuantizer.cpp b/plugins/FreeImage/Source/FreeImage/NNQuantizer.cpp
index f907c41d55..6eb9aeaf48 100644
--- a/plugins/FreeImage/Source/FreeImage/NNQuantizer.cpp
+++ b/plugins/FreeImage/Source/FreeImage/NNQuantizer.cpp
@@ -60,7 +60,7 @@ NNQuantizer::NNQuantizer(int PaletteSize)
freq = (int *)malloc(netsize * sizeof(int));
radpower = (int *)malloc(initrad * sizeof(int));
- if( !network || !bias || !freq || !radpower ) {
+ if ( !network || !bias || !freq || !radpower ) {
if(network) free(network);
if(bias) free(bias);
if(freq) free(freq);
@@ -455,7 +455,7 @@ FIBITMAP* NNQuantizer::Quantize(FIBITMAP *dib, int ReserveSize, RGBQUAD *Reserve
// 3) Initialize the network and apply the learning algorithm
- if( netsize > ReserveSize ) {
+ if ( netsize > ReserveSize ) {
netsize -= ReserveSize;
initnet();
learn(sampling);
diff --git a/plugins/FreeImage/Source/FreeImage/PSDParser.cpp b/plugins/FreeImage/Source/FreeImage/PSDParser.cpp
index 57c703a06f..93573d01c0 100644
--- a/plugins/FreeImage/Source/FreeImage/PSDParser.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PSDParser.cpp
@@ -72,7 +72,7 @@ bool psdHeaderInfo::Read(FreeImageIO *io, fi_handle handle) {
psdHeader header;
const int n = (int)io->read_proc(&header, sizeof(header), 1, handle);
- if(!n) {
+ if (!n) {
return false;
}
@@ -282,7 +282,7 @@ int psdDisplayInfo::Read(FreeImageIO *io, fi_handle handle) {
n = (int)io->read_proc(&ShortValue, sizeof(ShortValue), 1, handle);
nBytes += n * sizeof(ShortValue);
_Opacity = (short)psdGetValue(ShortValue, sizeof(_Opacity) );
- if((_Opacity < 0) || (_Opacity > 100)) {
+ if ((_Opacity < 0) || (_Opacity > 100)) {
throw "Invalid DisplayInfo::Opacity value";
}
@@ -418,7 +418,7 @@ BOOL invertColor(FIBITMAP* dib) {
FREE_IMAGE_TYPE type = FreeImage_GetImageType(dib);
const unsigned Bpp = FreeImage_GetBPP(dib)/8;
- if((type == FIT_BITMAP && Bpp == 4) || type == FIT_RGBA16) {
+ if ((type == FIT_BITMAP && Bpp == 4) || type == FIT_RGBA16) {
const unsigned width = FreeImage_GetWidth(dib);
const unsigned height = FreeImage_GetHeight(dib);
BYTE *line_start = FreeImage_GetScanLine(dib, 0);
@@ -508,7 +508,7 @@ bool psdParser::ReadImageResources(FreeImageIO *io, fi_handle handle, LONG lengt
n = (int)io->read_proc(&oResource._OSType, sizeof(oResource._OSType), 1, handle);
nBytes += n * sizeof(oResource._OSType);
- if( (nBytes % 2) != 0 ) {
+ if ( (nBytes % 2) != 0 ) {
return false;
}
@@ -653,7 +653,7 @@ FIBITMAP* psdParser::ReadImageData(FreeImageIO *io, fi_handle handle) {
SwapShort(&nCompression);
#endif
- if((nCompression != PSDP_COMPRESSION_NONE && nCompression != PSDP_COMPRESSION_RLE)) {
+ if ((nCompression != PSDP_COMPRESSION_NONE && nCompression != PSDP_COMPRESSION_RLE)) {
FreeImage_OutputMessageProc(_fi_format_id, "Unsupported compression %d", nCompression);
return NULL;
}
@@ -730,7 +730,7 @@ FIBITMAP* psdParser::ReadImageData(FreeImageIO *io, fi_handle handle) {
throw "Unsupported color mode";
break;
}
- if(!bitmap) {
+ if (!bitmap) {
throw FI_MSG_ERROR_DIB_MEMORY;
}
@@ -797,7 +797,7 @@ FIBITMAP* psdParser::ReadImageData(FreeImageIO *io, fi_handle handle) {
// later use this array as WORD rleLineSizeList[nChannels][nHeight];
WORD *rleLineSizeList = new (std::nothrow) WORD[nChannels*nHeight];
- if(!rleLineSizeList) {
+ if (!rleLineSizeList) {
FreeImage_Unload(bitmap);
SAFE_DELETE_ARRAY(line_start);
throw std::bad_alloc();
@@ -820,7 +820,7 @@ FIBITMAP* psdParser::ReadImageData(FreeImageIO *io, fi_handle handle) {
}
BYTE* rle_line_start = new (std::nothrow) BYTE[largestRLELine];
- if(!rle_line_start) {
+ if (!rle_line_start) {
FreeImage_Unload(bitmap);
SAFE_DELETE_ARRAY(line_start);
SAFE_DELETE_ARRAY(rleLineSizeList);
@@ -924,7 +924,7 @@ FIBITMAP* psdParser::ReadImageData(FreeImageIO *io, fi_handle handle) {
// --- Further process the bitmap ---
- if((mode == PSDP_CMYK || mode == PSDP_MULTICHANNEL)) {
+ if ((mode == PSDP_CMYK || mode == PSDP_MULTICHANNEL)) {
// CMYK values are "inverted", invert them back
if(mode == PSDP_MULTICHANNEL) {
@@ -933,7 +933,7 @@ FIBITMAP* psdParser::ReadImageData(FreeImageIO *io, fi_handle handle) {
FreeImage_Invert(bitmap);
}
- if((_fi_flags & PSD_CMYK) == PSD_CMYK) {
+ if ((_fi_flags & PSD_CMYK) == PSD_CMYK) {
// keep as CMYK
if(mode == PSDP_MULTICHANNEL) {
@@ -971,7 +971,7 @@ FIBITMAP* psdParser::ReadImageData(FreeImageIO *io, fi_handle handle) {
CREATE_GREYSCALE_PALETTE_REVERSE(FreeImage_GetPalette(bitmap), 2);
}
else if(mode == PSDP_INDEXED) {
- if(!_colourModeData._plColourData || _colourModeData._Length != 768 || _ColourCount < 0) {
+ if (!_colourModeData._plColourData || _colourModeData._Length != 768 || _ColourCount < 0) {
FreeImage_OutputMessageProc(_fi_format_id, "Indexed image has no palette. Using the default grayscale one.");
} else {
_colourModeData.FillPalette(bitmap);
@@ -1037,7 +1037,7 @@ FIBITMAP* psdParser::Load(FreeImageIO *io, fi_handle handle, int s_format_id, in
FreeImage_CreateICCProfile(Bitmap, _iccProfile._ProfileData, _iccProfile._ProfileSize);
if ((flags & PSD_CMYK) == PSD_CMYK) {
short mode = _headerInfo._ColourMode;
- if((mode == PSDP_CMYK) || (mode == PSDP_MULTICHANNEL)) {
+ if ((mode == PSDP_CMYK) || (mode == PSDP_MULTICHANNEL)) {
FreeImage_GetICCProfile(Bitmap)->flags |= FIICC_COLOR_IS_CMYK;
}
}
diff --git a/plugins/FreeImage/Source/FreeImage/PixelAccess.cpp b/plugins/FreeImage/Source/FreeImage/PixelAccess.cpp
index edee36584a..158f9997b2 100644
--- a/plugins/FreeImage/Source/FreeImage/PixelAccess.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PixelAccess.cpp
@@ -29,7 +29,7 @@
BYTE * DLL_CALLCONV
FreeImage_GetBits(FIBITMAP *dib) {
- if(!FreeImage_HasPixels(dib)) {
+ if (!FreeImage_HasPixels(dib)) {
return NULL;
}
// returns the pixels aligned on a FIBITMAP_ALIGNMENT bytes alignment boundary
@@ -41,7 +41,7 @@ FreeImage_GetBits(FIBITMAP *dib) {
BYTE * DLL_CALLCONV
FreeImage_GetScanLine(FIBITMAP *dib, int scanline) {
- if(!FreeImage_HasPixels(dib)) {
+ if (!FreeImage_HasPixels(dib)) {
return NULL;
}
return CalculateScanLine(FreeImage_GetBits(dib), FreeImage_GetPitch(dib), scanline);
@@ -51,10 +51,10 @@ BOOL DLL_CALLCONV
FreeImage_GetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value) {
BYTE shift;
- if(!FreeImage_HasPixels(dib) || (FreeImage_GetImageType(dib) != FIT_BITMAP))
+ if (!FreeImage_HasPixels(dib) || (FreeImage_GetImageType(dib) != FIT_BITMAP))
return FALSE;
- if((x < FreeImage_GetWidth(dib)) && (y < FreeImage_GetHeight(dib))) {
+ if ((x < FreeImage_GetWidth(dib)) && (y < FreeImage_GetHeight(dib))) {
BYTE *bits = FreeImage_GetScanLine(dib, y);
switch(FreeImage_GetBPP(dib)) {
@@ -80,10 +80,10 @@ FreeImage_GetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value) {
BOOL DLL_CALLCONV
FreeImage_GetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value) {
- if(!FreeImage_HasPixels(dib) || (FreeImage_GetImageType(dib) != FIT_BITMAP))
+ if (!FreeImage_HasPixels(dib) || (FreeImage_GetImageType(dib) != FIT_BITMAP))
return FALSE;
- if((x < FreeImage_GetWidth(dib)) && (y < FreeImage_GetHeight(dib))) {
+ if ((x < FreeImage_GetWidth(dib)) && (y < FreeImage_GetHeight(dib))) {
BYTE *bits = FreeImage_GetScanLine(dib, y);
switch(FreeImage_GetBPP(dib)) {
@@ -91,7 +91,7 @@ FreeImage_GetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value) {
{
bits += 2*x;
WORD *pixel = (WORD *)bits;
- if((FreeImage_GetRedMask(dib) == FI16_565_RED_MASK) && (FreeImage_GetGreenMask(dib) == FI16_565_GREEN_MASK) && (FreeImage_GetBlueMask(dib) == FI16_565_BLUE_MASK)) {
+ if ((FreeImage_GetRedMask(dib) == FI16_565_RED_MASK) && (FreeImage_GetGreenMask(dib) == FI16_565_GREEN_MASK) && (FreeImage_GetBlueMask(dib) == FI16_565_BLUE_MASK)) {
value->rgbBlue = (BYTE)((((*pixel & FI16_565_BLUE_MASK) >> FI16_565_BLUE_SHIFT) * 0xFF) / 0x1F);
value->rgbGreen = (BYTE)((((*pixel & FI16_565_GREEN_MASK) >> FI16_565_GREEN_SHIFT) * 0xFF) / 0x3F);
value->rgbRed = (BYTE)((((*pixel & FI16_565_RED_MASK) >> FI16_565_RED_SHIFT) * 0xFF) / 0x1F);
@@ -132,10 +132,10 @@ BOOL DLL_CALLCONV
FreeImage_SetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value) {
BYTE shift;
- if(!FreeImage_HasPixels(dib) || (FreeImage_GetImageType(dib) != FIT_BITMAP))
+ if (!FreeImage_HasPixels(dib) || (FreeImage_GetImageType(dib) != FIT_BITMAP))
return FALSE;
- if((x < FreeImage_GetWidth(dib)) && (y < FreeImage_GetHeight(dib))) {
+ if ((x < FreeImage_GetWidth(dib)) && (y < FreeImage_GetHeight(dib))) {
BYTE *bits = FreeImage_GetScanLine(dib, y);
switch(FreeImage_GetBPP(dib)) {
@@ -162,10 +162,10 @@ FreeImage_SetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value) {
BOOL DLL_CALLCONV
FreeImage_SetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value) {
- if(!FreeImage_HasPixels(dib) || (FreeImage_GetImageType(dib) != FIT_BITMAP))
+ if (!FreeImage_HasPixels(dib) || (FreeImage_GetImageType(dib) != FIT_BITMAP))
return FALSE;
- if((x < FreeImage_GetWidth(dib)) && (y < FreeImage_GetHeight(dib))) {
+ if ((x < FreeImage_GetWidth(dib)) && (y < FreeImage_GetHeight(dib))) {
BYTE *bits = FreeImage_GetScanLine(dib, y);
switch(FreeImage_GetBPP(dib)) {
@@ -173,7 +173,7 @@ FreeImage_SetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value) {
{
bits += 2*x;
WORD *pixel = (WORD *)bits;
- if((FreeImage_GetRedMask(dib) == FI16_565_RED_MASK) && (FreeImage_GetGreenMask(dib) == FI16_565_GREEN_MASK) && (FreeImage_GetBlueMask(dib) == FI16_565_BLUE_MASK)) {
+ if ((FreeImage_GetRedMask(dib) == FI16_565_RED_MASK) && (FreeImage_GetGreenMask(dib) == FI16_565_GREEN_MASK) && (FreeImage_GetBlueMask(dib) == FI16_565_BLUE_MASK)) {
*pixel = ((value->rgbBlue >> 3) << FI16_565_BLUE_SHIFT) |
((value->rgbGreen >> 2) << FI16_565_GREEN_SHIFT) |
((value->rgbRed >> 3) << FI16_565_RED_SHIFT);
diff --git a/plugins/FreeImage/Source/FreeImage/Plugin.cpp b/plugins/FreeImage/Source/FreeImage/Plugin.cpp
index bdc0e0f8a2..ce2863a72e 100644
--- a/plugins/FreeImage/Source/FreeImage/Plugin.cpp
+++ b/plugins/FreeImage/Source/FreeImage/Plugin.cpp
@@ -712,7 +712,7 @@ FreeImage_GetFIFFromFilenameU(const wchar_t *filename) {
// convert to single character - no national chars in extensions
char *extension = (char *)malloc(wcslen(place)+1);
unsigned int i=0;
- for(; i < wcslen(place); i++) // convert 16-bit to 8-bit
+ for (; i < wcslen(place); i++) // convert 16-bit to 8-bit
extension[i] = (char)(place[i] & 0x00FF);
// set terminating 0
extension[i]=0;
diff --git a/plugins/FreeImage/Source/FreeImage/PluginBMP.cpp b/plugins/FreeImage/Source/FreeImage/PluginBMP.cpp
index 4041d859fa..2d8d6e0b4a 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginBMP.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginBMP.cpp
@@ -213,7 +213,7 @@ LoadPixelDataRLE4(FreeImageIO *io, fi_handle handle, int width, int height, FIBI
height = abs(height);
pixels = (BYTE*)malloc(width * height * sizeof(BYTE));
- if(!pixels) throw(1);
+ if (!pixels) throw(1);
memset(pixels, 0, width * height * sizeof(BYTE));
BYTE *q = pixels;
@@ -313,7 +313,7 @@ LoadPixelDataRLE4(FreeImageIO *io, fi_handle handle, int width, int height, FIBI
BOOL hinibble = TRUE;
- for (int cols = 0; cols < width; cols++){
+ for (int cols = 0; cols < width; cols++) {
if (hinibble) {
dst[cols >> 1] = (src[cols] << 4);
} else {
@@ -352,7 +352,7 @@ LoadPixelDataRLE8(FreeImageIO *io, fi_handle handle, int width, int height, FIBI
int bits = 0;
for (;;) {
- if( io->read_proc(&status_byte, sizeof(BYTE), 1, handle) != 1) {
+ if ( io->read_proc(&status_byte, sizeof(BYTE), 1, handle) != 1) {
return FALSE;
}
@@ -520,7 +520,7 @@ LoadWindowsBMP(FreeImageIO *io, fi_handle handle, int flags, unsigned bitmap_bit
switch (compression) {
case BI_RGB :
- if( LoadPixelData(io, handle, dib, height, pitch, bit_count) ) {
+ if ( LoadPixelData(io, handle, dib, height, pitch, bit_count) ) {
return dib;
} else {
throw "Error encountered while decoding BMP data";
@@ -528,7 +528,7 @@ LoadWindowsBMP(FreeImageIO *io, fi_handle handle, int flags, unsigned bitmap_bit
break;
case BI_RLE4 :
- if( LoadPixelDataRLE4(io, handle, width, height, dib) ) {
+ if ( LoadPixelDataRLE4(io, handle, width, height, dib) ) {
return dib;
} else {
throw "Error encountered while decoding RLE4 BMP data";
@@ -536,7 +536,7 @@ LoadWindowsBMP(FreeImageIO *io, fi_handle handle, int flags, unsigned bitmap_bit
break;
case BI_RLE8 :
- if( LoadPixelDataRLE8(io, handle, width, height, dib) ) {
+ if ( LoadPixelDataRLE8(io, handle, width, height, dib) ) {
return dib;
} else {
throw "Error encountered while decoding RLE8 BMP data";
@@ -597,7 +597,7 @@ LoadWindowsBMP(FreeImageIO *io, fi_handle handle, int flags, unsigned bitmap_bit
dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, bitfields[0], bitfields[1], bitfields[2]);
} else {
- if( bit_count == 32 ) {
+ if ( bit_count == 32 ) {
dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
} else {
dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
@@ -747,7 +747,7 @@ LoadOS22XBMP(FreeImageIO *io, fi_handle handle, int flags, unsigned bitmap_bits_
return dib;
case BI_RLE4 :
- if( LoadPixelDataRLE4(io, handle, width, height, dib) ) {
+ if ( LoadPixelDataRLE4(io, handle, width, height, dib) ) {
return dib;
} else {
throw "Error encountered while decoding RLE4 BMP data";
@@ -755,7 +755,7 @@ LoadOS22XBMP(FreeImageIO *io, fi_handle handle, int flags, unsigned bitmap_bits_
break;
case BI_RLE8 :
- if( LoadPixelDataRLE8(io, handle, width, height, dib) ) {
+ if ( LoadPixelDataRLE8(io, handle, width, height, dib) ) {
return dib;
} else {
throw "Error encountered while decoding RLE8 BMP data";
@@ -805,7 +805,7 @@ LoadOS22XBMP(FreeImageIO *io, fi_handle handle, int flags, unsigned bitmap_bits_
case 24 :
case 32 :
{
- if( bit_count == 32 ) {
+ if ( bit_count == 32 ) {
dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
} else {
dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
@@ -951,7 +951,7 @@ LoadOS21XBMP(FreeImageIO *io, fi_handle handle, int flags, unsigned bitmap_bits_
case 24 :
case 32 :
{
- if( bit_count == 32 ) {
+ if ( bit_count == 32 ) {
dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
} else {
dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
@@ -1082,7 +1082,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// check the signature
- if((bitmapfileheader.bfType != 0x4D42) && (bitmapfileheader.bfType != 0x4142)) {
+ if ((bitmapfileheader.bfType != 0x4D42) && (bitmapfileheader.bfType != 0x4142)) {
FreeImage_OutputMessageProc(s_format_id, FI_MSG_ERROR_MAGIC_NUMBER);
return NULL;
}
diff --git a/plugins/FreeImage/Source/FreeImage/PluginCUT.cpp b/plugins/FreeImage/Source/FreeImage/PluginCUT.cpp
index 5dcd16b84f..746fa034a6 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginCUT.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginCUT.cpp
@@ -105,7 +105,7 @@ static FIBITMAP * DLL_CALLCONV
Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
FIBITMAP *dib = NULL;
- if(!handle) {
+ if (!handle) {
return NULL;
}
diff --git a/plugins/FreeImage/Source/FreeImage/PluginDDS.cpp b/plugins/FreeImage/Source/FreeImage/PluginDDS.cpp
index 4e2d1d8fa2..0a1667d7f1 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginDDS.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginDDS.cpp
@@ -444,7 +444,7 @@ LoadDXT_Helper (FreeImageIO *io, fi_handle handle, int page, int flags, void *da
typedef typename INFO::Block Block;
Block *input_buffer = new(std::nothrow) Block[(width + 3) / 4];
- if(!input_buffer) return;
+ if (!input_buffer) return;
int widthRest = (int) width & 3;
int heightRest = (int) height & 3;
diff --git a/plugins/FreeImage/Source/FreeImage/PluginEXR.cpp b/plugins/FreeImage/Source/FreeImage/PluginEXR.cpp
index 4a19b8b56f..b9963a11b2 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginEXR.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginEXR.cpp
@@ -96,7 +96,7 @@ C_IStream::seekg (Imf::Int64 pos) {
void
C_OStream::write (const char c[/*n*/], int n) {
- if((unsigned)n != _io->write_proc((void*)&c[0], 1, n, _handle)) {
+ if ((unsigned)n != _io->write_proc((void*)&c[0], 1, n, _handle)) {
Iex::throwErrnoExc();
}
}
@@ -178,7 +178,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
bool bUseRgbaInterface = false;
FIBITMAP *dib = NULL;
- if(!handle) {
+ if (!handle) {
return NULL;
}
@@ -242,7 +242,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
bHandled = true;
}
}
- if(!bHandled) {
+ if (!bHandled) {
THROW (Iex::InputExc, "Unable to handle mixed component types (color model = " << exr_color_model << ")");
}
}
@@ -260,9 +260,9 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// check for supported image color models
// --------------------------------------------------------------
- if((components == 1) || (components == 2)) {
+ if ((components == 1) || (components == 2)) {
// if the image is gray-alpha (YA), ignore the alpha channel
- if((components == 1) && channels.findChannel("Y")) {
+ if ((components == 1) && channels.findChannel("Y")) {
image_type = FIT_FLOAT;
components = 1;
} else {
@@ -307,7 +307,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// allocate a new dib
dib = FreeImage_AllocateHeaderT(header_only, image_type, width, height, 0);
- if(!dib) THROW (Iex::NullExc, FI_MSG_ERROR_MEMORY);
+ if (!dib) THROW (Iex::NullExc, FI_MSG_ERROR_MEMORY);
// try to load the preview image
// --------------------------------------------------------------
@@ -410,7 +410,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
pitch, // yStride
1, 1, // x/y sampling
0.0)); // fillValue
- } else if((components == 3) || (components == 4)) {
+ } else if ((components == 3) || (components == 4)) {
const char *channel_name[4] = { "R", "G", "B", "A" };
for(int c = 0; c < components; c++) {
@@ -450,12 +450,12 @@ Set the preview image using the dib embedded thumbnail
*/
static BOOL
SetPreviewImage(FIBITMAP *dib, Imf::Header& header) {
- if(!FreeImage_GetThumbnail(dib)) {
+ if (!FreeImage_GetThumbnail(dib)) {
return FALSE;
}
FIBITMAP* thumbnail = FreeImage_GetThumbnail(dib);
- if((FreeImage_GetImageType(thumbnail) != FIT_BITMAP) || (FreeImage_GetBPP(thumbnail) != 32)) {
+ if ((FreeImage_GetImageType(thumbnail) != FIT_BITMAP) || (FreeImage_GetBPP(thumbnail) != 32)) {
// invalid thumbnail - ignore it
FreeImage_OutputMessageProc(s_format_id, FI_MSG_WARNING_INVALID_THUMBNAIL);
} else {
@@ -560,16 +560,16 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
BOOL bIsFlipped = FALSE;
half *halfData = NULL;
- if(!dib || !handle) return FALSE;
+ if (!dib || !handle) return FALSE;
try {
// check for EXR_LC compression and verify that the format is RGB
- if((flags & EXR_LC) == EXR_LC) {
+ if ((flags & EXR_LC) == EXR_LC) {
FREE_IMAGE_TYPE image_type = FreeImage_GetImageType(dib);
- if(((image_type != FIT_RGBF) && (image_type != FIT_RGBAF)) || ((flags & EXR_FLOAT) == EXR_FLOAT)) {
+ if (((image_type != FIT_RGBF) && (image_type != FIT_RGBAF)) || ((flags & EXR_FLOAT) == EXR_FLOAT)) {
THROW (Iex::IoExc, "EXR_LC compression is only available with RGB[A]F images");
}
- if((FreeImage_GetWidth(dib) % 2) || (FreeImage_GetHeight(dib) % 2)) {
+ if ((FreeImage_GetWidth(dib) % 2) || (FreeImage_GetHeight(dib) % 2)) {
THROW (Iex::IoExc, "EXR_LC compression only works when the width and height are a multiple of 2");
}
}
@@ -579,19 +579,19 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
// compression
Imf::Compression compress;
- if((flags & EXR_NONE) == EXR_NONE) {
+ if ((flags & EXR_NONE) == EXR_NONE) {
// no compression
compress = Imf::NO_COMPRESSION;
- } else if((flags & EXR_ZIP) == EXR_ZIP) {
+ } else if ((flags & EXR_ZIP) == EXR_ZIP) {
// zlib compression, in blocks of 16 scan lines
compress = Imf::ZIP_COMPRESSION;
- } else if((flags & EXR_PIZ) == EXR_PIZ) {
+ } else if ((flags & EXR_PIZ) == EXR_PIZ) {
// piz-based wavelet compression
compress = Imf::PIZ_COMPRESSION;
- } else if((flags & EXR_PXR24) == EXR_PXR24) {
+ } else if ((flags & EXR_PXR24) == EXR_PXR24) {
// lossy 24-bit float compression
compress = Imf::PXR24_COMPRESSION;
- } else if((flags & EXR_B44) == EXR_B44) {
+ } else if ((flags & EXR_B44) == EXR_B44) {
// lossy 44% float compression
compress = Imf::B44_COMPRESSION;
} else {
@@ -615,13 +615,13 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
SetPreviewImage(dib, header);
// check for EXR_LC compression
- if((flags & EXR_LC) == EXR_LC) {
+ if ((flags & EXR_LC) == EXR_LC) {
return SaveAsEXR_LC(ostream, dib, header, width, height);
}
// output pixel type
Imf::PixelType pixelType;
- if((flags & EXR_FLOAT) == EXR_FLOAT) {
+ if ((flags & EXR_FLOAT) == EXR_FLOAT) {
pixelType = Imf::FLOAT; // save as float data type
} else {
// default value
@@ -667,7 +667,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
if(pixelType == Imf::HALF) {
// convert from float to half
halfData = new(std::nothrow) half[width * height * components];
- if(!halfData) THROW (Iex::NullExc, FI_MSG_ERROR_MEMORY);
+ if (!halfData) THROW (Iex::NullExc, FI_MSG_ERROR_MEMORY);
for(int y = 0; y < height; y++) {
float *src_bits = (float*)FreeImage_GetScanLine(dib, height - 1 - y);
@@ -700,7 +700,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
(char*)(bits), // base
bytespp, // xStride
pitch)); // yStride
- } else if((image_type == FIT_RGBF) || (image_type == FIT_RGBAF)) {
+ } else if ((image_type == FIT_RGBF) || (image_type == FIT_RGBAF)) {
for(int c = 0; c < components; c++) {
char *channel_base = (char*)(bits) + c*bytespc;
frameBuffer.insert (channel_name[c],// name
diff --git a/plugins/FreeImage/Source/FreeImage/PluginG3.cpp b/plugins/FreeImage/Source/FreeImage/PluginG3.cpp
index d5c08b36e6..c383a455b7 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginG3.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginG3.cpp
@@ -124,7 +124,7 @@ copyFaxFile(FreeImageIO *io, fi_handle handle, TIFF* tifin, uint32 xsize, int st
throw FI_MSG_ERROR_MEMORY;
}
- if(!G3ReadFile(io, handle, tifin->tif_rawdata, tifin->tif_rawdatasize)) {
+ if (!G3ReadFile(io, handle, tifin->tif_rawdata, tifin->tif_rawdatasize)) {
throw "Read error at scanline 0";
}
tifin->tif_rawcp = tifin->tif_rawdata;
@@ -319,7 +319,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// open a temporary memory buffer to save decoded scanlines
memory = FreeImage_OpenMemory();
- if(!memory) throw FI_MSG_ERROR_MEMORY;
+ if (!memory) throw FI_MSG_ERROR_MEMORY;
// wrap the raw fax file
faxTIFF = TIFFClientOpen("(FakeInput)", "w",
diff --git a/plugins/FreeImage/Source/FreeImage/PluginGIF.cpp b/plugins/FreeImage/Source/FreeImage/PluginGIF.cpp
index e8d84afac4..bf7c2550ae 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginGIF.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginGIF.cpp
@@ -167,8 +167,8 @@ FreeImage_SetMetadataEx(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key
static BOOL
FreeImage_GetMetadataEx(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FREE_IMAGE_MDTYPE type, FITAG **tag)
{
- if( FreeImage_GetMetadata(model, dib, key, tag) ) {
- if( FreeImage_GetTagType(*tag) == type ) {
+ if ( FreeImage_GetMetadata(model, dib, key, tag) ) {
+ if ( FreeImage_GetTagType(*tag) == type ) {
return TRUE;
}
}
@@ -187,10 +187,10 @@ StringTable::StringTable()
StringTable::~StringTable()
{
- if( m_buffer != NULL ) {
+ if ( m_buffer != NULL ) {
delete [] m_buffer;
}
- if( m_strmap != NULL ) {
+ if ( m_strmap != NULL ) {
delete [] m_strmap;
m_strmap = NULL;
}
@@ -218,10 +218,10 @@ void StringTable::Initialize(int minCodeSize)
BYTE *StringTable::FillInputBuffer(int len)
{
- if( m_buffer == NULL ) {
+ if ( m_buffer == NULL ) {
m_buffer = new(std::nothrow) BYTE[len];
m_bufferRealSize = len;
- } else if( len > m_bufferRealSize ) {
+ } else if ( len > m_bufferRealSize ) {
delete [] m_buffer;
m_buffer = new(std::nothrow) BYTE[len];
m_bufferRealSize = len;
@@ -273,7 +273,7 @@ int StringTable::CompressEnd(BYTE *buf)
bool StringTable::Compress(BYTE *buf, int *len)
{
- if( m_bufferSize == 0 || m_done ) {
+ if ( m_bufferSize == 0 || m_done ) {
return false;
}
@@ -288,7 +288,7 @@ bool StringTable::Compress(BYTE *buf, int *len)
int nextprefix = (((m_prefix)<<8)&0xFFF00) + (ch & 0x000FF);
if(firstPixelPassed) {
- if( m_strmap[nextprefix] > 0) {
+ if ( m_strmap[nextprefix] > 0) {
m_prefix = m_strmap[nextprefix];
} else {
m_partial |= m_prefix << m_partialSize;
@@ -304,13 +304,13 @@ bool StringTable::Compress(BYTE *buf, int *len)
m_strmap[nextprefix] = m_nextCode;
//increment the next highest valid code, increase the code size
- if( m_nextCode == (1 << m_codeSize) ) {
+ if ( m_nextCode == (1 << m_codeSize) ) {
m_codeSize++;
}
m_nextCode++;
//if we're out of codes, restart the string table
- if( m_nextCode == MAX_LZW_CODE ) {
+ if ( m_nextCode == MAX_LZW_CODE ) {
m_partial |= m_clearCode << m_partialSize;
m_partialSize += m_codeSize;
ClearCompressorTable();
@@ -321,7 +321,7 @@ bool StringTable::Compress(BYTE *buf, int *len)
}
//increment to the next pixel
- if( m_bufferShift > 0 && !(m_bufferPos + 1 == m_bufferSize && m_bufferShift <= m_slack) ) {
+ if ( m_bufferShift > 0 && !(m_bufferPos + 1 == m_bufferSize && m_bufferShift <= m_slack) ) {
m_bufferShift -= m_bpp;
} else {
m_bufferPos++;
@@ -329,7 +329,7 @@ bool StringTable::Compress(BYTE *buf, int *len)
}
//jump out here if the output buffer is full
- if( bufpos - buf == *len ) {
+ if ( bufpos - buf == *len ) {
return true;
}
@@ -341,7 +341,7 @@ bool StringTable::Compress(BYTE *buf, int *len)
m_prefix = ch & 0x000FF;
//increment to the next pixel
- if( m_bufferShift > 0 && !(m_bufferPos + 1 == m_bufferSize && m_bufferShift <= m_slack) ) {
+ if ( m_bufferShift > 0 && !(m_bufferPos + 1 == m_bufferSize && m_bufferShift <= m_slack) ) {
m_bufferShift -= m_bpp;
} else {
m_bufferPos++;
@@ -349,7 +349,7 @@ bool StringTable::Compress(BYTE *buf, int *len)
}
//jump out here if the output buffer is full
- if( bufpos - buf == *len ) {
+ if ( bufpos - buf == *len ) {
return true;
}
}
@@ -363,12 +363,12 @@ bool StringTable::Compress(BYTE *buf, int *len)
bool StringTable::Decompress(BYTE *buf, int *len)
{
- if( m_bufferSize == 0 || m_done ) {
+ if ( m_bufferSize == 0 || m_done ) {
return false;
}
BYTE *bufpos = buf;
- for( ; m_bufferPos < m_bufferSize; m_bufferPos++ ) {
+ for ( ; m_bufferPos < m_bufferSize; m_bufferPos++ ) {
m_partial |= (int)m_buffer[m_bufferPos] << m_partialSize;
m_partialSize += 8;
while( m_partialSize >= m_codeSize ) {
@@ -376,22 +376,22 @@ bool StringTable::Decompress(BYTE *buf, int *len)
m_partial >>= m_codeSize;
m_partialSize -= m_codeSize;
- if( code > m_nextCode || (m_nextCode == MAX_LZW_CODE && code != m_clearCode) || code == m_endCode ) {
+ if ( code > m_nextCode || (m_nextCode == MAX_LZW_CODE && code != m_clearCode) || code == m_endCode ) {
m_done = true;
*len = (int)(bufpos - buf);
return true;
}
- if( code == m_clearCode ) {
+ if ( code == m_clearCode ) {
ClearDecompressorTable();
continue;
}
//add new string to string table, if not the first pass since a clear code
- if( m_oldCode != MAX_LZW_CODE ) {
+ if ( m_oldCode != MAX_LZW_CODE ) {
m_strings[m_nextCode] = m_strings[m_oldCode] + m_strings[code == m_nextCode ? m_oldCode : code][0];
}
- if( (int)m_strings[code].size() > *len - (bufpos - buf) ) {
+ if ( (int)m_strings[code].size() > *len - (bufpos - buf) ) {
//out of space, stuff the code back in for next time
m_partial <<= m_codeSize;
m_partialSize += m_codeSize;
@@ -406,9 +406,9 @@ bool StringTable::Decompress(BYTE *buf, int *len)
bufpos += m_strings[code].size();
//increment the next highest valid code, add a bit to the mask if we need to increase the code size
- if( m_oldCode != MAX_LZW_CODE && m_nextCode < MAX_LZW_CODE ) {
- if( ++m_nextCode < MAX_LZW_CODE ) {
- if( (m_nextCode & m_codeMask) == 0 ) {
+ if ( m_oldCode != MAX_LZW_CODE && m_nextCode < MAX_LZW_CODE ) {
+ if ( ++m_nextCode < MAX_LZW_CODE ) {
+ if ( (m_nextCode & m_codeMask) == 0 ) {
m_codeSize++;
m_codeMask |= m_nextCode;
}
@@ -443,7 +443,7 @@ void StringTable::ClearCompressorTable(void)
void StringTable::ClearDecompressorTable(void)
{
- for( int i = 0; i < m_clearCode; i++ ) {
+ for ( int i = 0; i < m_clearCode; i++ ) {
m_strings[i].resize(1);
m_strings[i][0] = (char)i;
}
@@ -492,13 +492,13 @@ MimeType() {
static BOOL DLL_CALLCONV
Validate(FreeImageIO *io, fi_handle handle) {
char buf[6];
- if( io->read_proc(buf, 6, 1, handle) < 1 ) {
+ if ( io->read_proc(buf, 6, 1, handle) < 1 ) {
return FALSE;
}
BOOL bResult = FALSE;
- if( !strncmp(buf, "GIF", 3) ) {
- if( buf[3] >= '0' && buf[3] <= '9' && buf[4] >= '0' && buf[4] <= '9' && buf[5] >= 'a' && buf[5] <= 'z' ) {
+ if ( !strncmp(buf, "GIF", 3) ) {
+ if ( buf[3] >= '0' && buf[3] <= '9' && buf[4] >= '0' && buf[4] <= '9' && buf[5] >= 'a' && buf[5] <= 'z' ) {
bResult = TRUE;
}
}
@@ -525,7 +525,7 @@ SupportsExportType(FREE_IMAGE_TYPE type) {
static void *DLL_CALLCONV
Open(FreeImageIO *io, fi_handle handle, BOOL read) {
GIFinfo *info = new(std::nothrow) GIFinfo;
- if( info == NULL ) {
+ if ( info == NULL ) {
return NULL;
}
@@ -534,10 +534,10 @@ Open(FreeImageIO *io, fi_handle handle, BOOL read) {
// memset(info, 0, sizeof(GIFinfo));
info->read = read;
- if( read ) {
+ if ( read ) {
try {
//Header
- if( !Validate(io, handle) ) {
+ if ( !Validate(io, handle) ) {
throw FI_MSG_ERROR_MAGIC_NUMBER;
}
io->seek_proc(handle, 6, SEEK_CUR);
@@ -545,16 +545,16 @@ Open(FreeImageIO *io, fi_handle handle, BOOL read) {
//Logical Screen Descriptor
io->seek_proc(handle, 4, SEEK_CUR);
BYTE packed;
- if( io->read_proc(&packed, 1, 1, handle) < 1 ) {
+ if ( io->read_proc(&packed, 1, 1, handle) < 1 ) {
throw "EOF reading Logical Screen Descriptor";
}
- if( io->read_proc(&info->background_color, 1, 1, handle) < 1 ) {
+ if ( io->read_proc(&info->background_color, 1, 1, handle) < 1 ) {
throw "EOF reading Logical Screen Descriptor";
}
io->seek_proc(handle, 1, SEEK_CUR);
//Global Color Table
- if( packed & GIF_PACKED_LSD_HAVEGCT ) {
+ if ( packed & GIF_PACKED_LSD_HAVEGCT ) {
info->global_color_table_offset = io->tell_proc(handle);
info->global_color_table_size = 2 << (packed & GIF_PACKED_LSD_GCTSIZE);
io->seek_proc(handle, 3 * info->global_color_table_size, SEEK_CUR);
@@ -564,42 +564,42 @@ Open(FreeImageIO *io, fi_handle handle, BOOL read) {
size_t gce_offset = 0;
BYTE block = 0;
while( block != GIF_BLOCK_TRAILER ) {
- if( io->read_proc(&block, 1, 1, handle) < 1 ) {
+ if ( io->read_proc(&block, 1, 1, handle) < 1 ) {
throw "EOF reading blocks";
}
- if( block == GIF_BLOCK_IMAGE_DESCRIPTOR ) {
+ if ( block == GIF_BLOCK_IMAGE_DESCRIPTOR ) {
info->image_descriptor_offsets.push_back(io->tell_proc(handle));
//GCE may be 0, meaning no GCE preceded this ID
info->graphic_control_extension_offsets.push_back(gce_offset);
gce_offset = 0;
io->seek_proc(handle, 8, SEEK_CUR);
- if( io->read_proc(&packed, 1, 1, handle) < 1 ) {
+ if ( io->read_proc(&packed, 1, 1, handle) < 1 ) {
throw "EOF reading Image Descriptor";
}
//Local Color Table
- if( packed & GIF_PACKED_ID_HAVELCT ) {
+ if ( packed & GIF_PACKED_ID_HAVELCT ) {
io->seek_proc(handle, 3 * (2 << (packed & GIF_PACKED_ID_LCTSIZE)), SEEK_CUR);
}
//LZW Minimum Code Size
io->seek_proc(handle, 1, SEEK_CUR);
- } else if( block == GIF_BLOCK_EXTENSION ) {
+ } else if ( block == GIF_BLOCK_EXTENSION ) {
BYTE ext;
- if( io->read_proc(&ext, 1, 1, handle) < 1 ) {
+ if ( io->read_proc(&ext, 1, 1, handle) < 1 ) {
throw "EOF reading extension";
}
- if( ext == GIF_EXT_GRAPHIC_CONTROL ) {
+ if ( ext == GIF_EXT_GRAPHIC_CONTROL ) {
//overwrite previous offset if more than one GCE found before an ID
gce_offset = io->tell_proc(handle);
- } else if( ext == GIF_EXT_COMMENT ) {
+ } else if ( ext == GIF_EXT_COMMENT ) {
info->comment_extension_offsets.push_back(io->tell_proc(handle));
- } else if( ext == GIF_EXT_APPLICATION ) {
+ } else if ( ext == GIF_EXT_APPLICATION ) {
info->application_extension_offsets.push_back(io->tell_proc(handle));
}
- } else if( block == GIF_BLOCK_TRAILER ) {
+ } else if ( block == GIF_BLOCK_TRAILER ) {
continue;
} else {
throw "Invalid GIF block found";
@@ -607,12 +607,12 @@ Open(FreeImageIO *io, fi_handle handle, BOOL read) {
//Data Sub-blocks
BYTE len;
- if( io->read_proc(&len, 1, 1, handle) < 1 ) {
+ if ( io->read_proc(&len, 1, 1, handle) < 1 ) {
throw "EOF reading sub-block";
}
while( len != 0 ) {
io->seek_proc(handle, len, SEEK_CUR);
- if( io->read_proc(&len, 1, 1, handle) < 1 ) {
+ if ( io->read_proc(&len, 1, 1, handle) < 1 ) {
throw "EOF reading sub-block";
}
}
@@ -632,12 +632,12 @@ Open(FreeImageIO *io, fi_handle handle, BOOL read) {
static void DLL_CALLCONV
Close(FreeImageIO *io, fi_handle handle, void *data) {
- if( data == NULL ) {
+ if ( data == NULL ) {
return;
}
GIFinfo *info = (GIFinfo *)data;
- if( !info->read ) {
+ if ( !info->read ) {
//Trailer
BYTE b = GIF_BLOCK_TRAILER;
io->write_proc(&b, 1, 1, handle);
@@ -648,7 +648,7 @@ Close(FreeImageIO *io, fi_handle handle, void *data) {
static int DLL_CALLCONV
PageCount(FreeImageIO *io, fi_handle handle, void *data) {
- if( data == NULL ) {
+ if ( data == NULL ) {
return 0;
}
GIFinfo *info = (GIFinfo *)data;
@@ -658,15 +658,15 @@ PageCount(FreeImageIO *io, fi_handle handle, void *data) {
static FIBITMAP * DLL_CALLCONV
Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
- if( data == NULL ) {
+ if ( data == NULL ) {
return NULL;
}
GIFinfo *info = (GIFinfo *)data;
- if( page == -1 ) {
+ if ( page == -1 ) {
page = 0;
}
- if( page < 0 || page >= (int)info->image_descriptor_offsets.size() ) {
+ if ( page < 0 || page >= (int)info->image_descriptor_offsets.size() ) {
return NULL;
}
@@ -679,7 +679,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
WORD w;
//playback pages to generate what the user would see for this frame
- if( (flags & GIF_PLAYBACK) == GIF_PLAYBACK ) {
+ if ( (flags & GIF_PLAYBACK) == GIF_PLAYBACK ) {
//Logical Screen Descriptor
io->seek_proc(handle, 6, SEEK_SET);
WORD logicalwidth, logicalheight;
@@ -691,7 +691,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
#endif
//set the background color with 0 alpha
RGBQUAD background;
- if( info->global_color_table_offset != 0 && info->background_color < info->global_color_table_size ) {
+ if ( info->global_color_table_offset != 0 && info->background_color < info->global_color_table_size ) {
io->seek_proc(handle, (long)(info->global_color_table_offset + (info->background_color * 3)), SEEK_SET);
io->read_proc(&background.rgbRed, 1, 1, handle);
io->read_proc(&background.rgbGreen, 1, 1, handle);
@@ -705,16 +705,16 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
//allocate entire logical area
dib = FreeImage_Allocate(logicalwidth, logicalheight, 32);
- if( dib == NULL ) {
+ if ( dib == NULL ) {
throw FI_MSG_ERROR_DIB_MEMORY;
}
//fill with background color to start
int x, y;
RGBQUAD *scanline;
- for( y = 0; y < logicalheight; y++ ) {
+ for ( y = 0; y < logicalheight; y++ ) {
scanline = (RGBQUAD *)FreeImage_GetScanLine(dib, y);
- for( x = 0; x < logicalwidth; x++ ) {
+ for ( x = 0; x < logicalwidth; x++ ) {
*scanline++ = background;
}
}
@@ -743,14 +743,14 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
pageinfo.push_back(PageInfo(disposal_method, left, top, width, height));
- if( start != end ) {
- if( left == 0 && top == 0 && width == logicalwidth && height == logicalheight ) {
- if( disposal_method == GIF_DISPOSAL_BACKGROUND ) {
+ if ( start != end ) {
+ if ( left == 0 && top == 0 && width == logicalwidth && height == logicalheight ) {
+ if ( disposal_method == GIF_DISPOSAL_BACKGROUND ) {
pageinfo.pop_back();
start++;
break;
- } else if( disposal_method != GIF_DISPOSAL_PREVIOUS ) {
- if( !have_transparent ) {
+ } else if ( disposal_method != GIF_DISPOSAL_PREVIOUS ) {
+ if ( !have_transparent ) {
break;
}
}
@@ -758,23 +758,23 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
}
start--;
}
- if( start < 0 ) {
+ if ( start < 0 ) {
start = 0;
}
//draw each page into the logical area
delay_time = 0;
- for( page = start; page <= end; page++ ) {
+ for ( page = start; page <= end; page++ ) {
PageInfo &info = pageinfo[end - page];
//things we can skip having to decode
- if( page != end ) {
- if( info.disposal_method == GIF_DISPOSAL_PREVIOUS ) {
+ if ( page != end ) {
+ if ( info.disposal_method == GIF_DISPOSAL_PREVIOUS ) {
continue;
}
- if( info.disposal_method == GIF_DISPOSAL_BACKGROUND ) {
- for( y = 0; y < info.height; y++ ) {
+ if ( info.disposal_method == GIF_DISPOSAL_BACKGROUND ) {
+ for ( y = 0; y < info.height; y++ ) {
scanline = (RGBQUAD *)FreeImage_GetScanLine(dib, logicalheight - (y + info.top) - 1) + info.left;
- for( x = 0; x < info.width; x++ ) {
+ for ( x = 0; x < info.width; x++ ) {
*scanline++ = background;
}
}
@@ -784,14 +784,14 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
//decode page
FIBITMAP *pagedib = Load(io, handle, page, GIF_LOAD256, data);
- if( pagedib != NULL ) {
+ if ( pagedib != NULL ) {
RGBQUAD *pal = FreeImage_GetPalette(pagedib);
have_transparent = false;
- if( FreeImage_IsTransparent(pagedib) ) {
+ if ( FreeImage_IsTransparent(pagedib) ) {
int count = FreeImage_GetTransparencyCount(pagedib);
BYTE *table = FreeImage_GetTransparencyTable(pagedib);
- for( int i = 0; i < count; i++ ) {
- if( table[i] == 0 ) {
+ for ( int i = 0; i < count; i++ ) {
+ if ( table[i] == 0 ) {
have_transparent = true;
transparent_color = i;
break;
@@ -799,11 +799,11 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
}
}
//copy page data into logical buffer, with full alpha opaqueness
- for( y = 0; y < info.height; y++ ) {
+ for ( y = 0; y < info.height; y++ ) {
scanline = (RGBQUAD *)FreeImage_GetScanLine(dib, logicalheight - (y + info.top) - 1) + info.left;
BYTE *pageline = FreeImage_GetScanLine(pagedib, info.height - y - 1);
- for( x = 0; x < info.width; x++ ) {
- if( !have_transparent || *pageline != transparent_color ) {
+ for ( x = 0; x < info.width; x++ ) {
+ if ( !have_transparent || *pageline != transparent_color ) {
*scanline = pal[*pageline];
scanline->rgbReserved = 255;
}
@@ -812,9 +812,9 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
}
}
//copy frame time
- if( page == end ) {
+ if ( page == end ) {
FITAG *tag;
- if( FreeImage_GetMetadataEx(FIMD_ANIMATION, pagedib, "FrameTime", FIDT_LONG, &tag) ) {
+ if ( FreeImage_GetMetadataEx(FIMD_ANIMATION, pagedib, "FrameTime", FIDT_LONG, &tag) ) {
delay_time = *(LONG *)FreeImage_GetTagValue(tag);
}
}
@@ -846,18 +846,18 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
no_local_palette = (packed & GIF_PACKED_ID_HAVELCT) ? false : true;
int bpp = 8;
- if( (flags & GIF_LOAD256) == 0 ) {
- if( !no_local_palette ) {
+ if ( (flags & GIF_LOAD256) == 0 ) {
+ if ( !no_local_palette ) {
int size = 2 << (packed & GIF_PACKED_ID_LCTSIZE);
- if( size <= 2 ) bpp = 1;
- else if( size <= 16 ) bpp = 4;
- } else if( info->global_color_table_offset != 0 ) {
- if( info->global_color_table_size <= 2 ) bpp = 1;
- else if( info->global_color_table_size <= 16 ) bpp = 4;
+ if ( size <= 2 ) bpp = 1;
+ else if ( size <= 16 ) bpp = 4;
+ } else if ( info->global_color_table_offset != 0 ) {
+ if ( info->global_color_table_size <= 2 ) bpp = 1;
+ else if ( info->global_color_table_size <= 16 ) bpp = 4;
}
}
dib = FreeImage_Allocate(width, height, bpp);
- if( dib == NULL ) {
+ if ( dib == NULL ) {
throw FI_MSG_ERROR_DIB_MEMORY;
}
@@ -870,7 +870,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
//Palette
RGBQUAD *pal = FreeImage_GetPalette(dib);
- if( !no_local_palette ) {
+ if ( !no_local_palette ) {
int size = 2 << (packed & GIF_PACKED_ID_LCTSIZE);
int i = 0;
@@ -880,7 +880,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
io->read_proc(&pal[i].rgbBlue, 1, 1, handle);
i++;
}
- } else if( info->global_color_table_offset != 0 ) {
+ } else if ( info->global_color_table_offset != 0 ) {
long pos = io->tell_proc(handle);
io->seek_proc(handle, (long)info->global_color_table_offset, SEEK_SET);
@@ -895,7 +895,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
io->seek_proc(handle, pos, SEEK_SET);
} else {
//its legal to have no palette, but we're going to generate *something*
- for( int i = 0; i < 256; i++ ) {
+ for ( int i = 0; i < 256; i++ ) {
pal[i].rgbRed = (BYTE)i;
pal[i].rgbGreen = (BYTE)i;
pal[i].rgbBlue = (BYTE)i;
@@ -916,24 +916,24 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
io->read_proc(stringtable->FillInputBuffer(b), b, 1, handle);
int size = sizeof(buf);
while( stringtable->Decompress(buf, &size) ) {
- for( int i = 0; i < size; i++ ) {
+ for ( int i = 0; i < size; i++ ) {
scanline[xpos] |= (buf[i] & mask) << shift;
- if( shift > 0 ) {
+ if ( shift > 0 ) {
shift -= bpp;
} else {
xpos++;
shift = 8 - bpp;
}
- if( ++x >= width ) {
- if( interlaced ) {
+ if ( ++x >= width ) {
+ if ( interlaced ) {
y += g_GifInterlaceIncrement[interlacepass];
- if( y >= height && ++interlacepass < GIF_INTERLACE_PASSES ) {
+ if ( y >= height && ++interlacepass < GIF_INTERLACE_PASSES ) {
y = g_GifInterlaceOffset[interlacepass];
}
} else {
y++;
}
- if( y >= height ) {
+ if ( y >= height ) {
stringtable->Done();
break;
}
@@ -947,7 +947,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
io->read_proc(&b, 1, 1, handle);
}
- if( page == 0 ) {
+ if ( page == 0 ) {
size_t idx;
//Logical Screen Descriptor
@@ -963,7 +963,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
FreeImage_SetMetadataEx(FIMD_ANIMATION, dib, "LogicalHeight", ANIMTAG_LOGICALHEIGHT, FIDT_SHORT, 1, 2, &logicalheight);
//Global Color Table
- if( info->global_color_table_offset != 0 ) {
+ if ( info->global_color_table_offset != 0 ) {
RGBQUAD globalpalette[256];
io->seek_proc(handle, (long)info->global_color_table_offset, SEEK_SET);
int i = 0;
@@ -976,29 +976,29 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
}
FreeImage_SetMetadataEx(FIMD_ANIMATION, dib, "GlobalPalette", ANIMTAG_GLOBALPALETTE, FIDT_PALETTE, info->global_color_table_size, info->global_color_table_size * 4, globalpalette);
//background color
- if( info->background_color < info->global_color_table_size ) {
+ if ( info->background_color < info->global_color_table_size ) {
FreeImage_SetBackgroundColor(dib, &globalpalette[info->background_color]);
}
}
//Application Extension
LONG loop = 1; //If no AE with a loop count is found, the default must be 1
- for( idx = 0; idx < info->application_extension_offsets.size(); idx++ ) {
+ for ( idx = 0; idx < info->application_extension_offsets.size(); idx++ ) {
io->seek_proc(handle, (long)info->application_extension_offsets[idx], SEEK_SET);
io->read_proc(&b, 1, 1, handle);
- if( b == 11 ) { //All AEs start with an 11 byte sub-block to determine what type of AE it is
+ if ( b == 11 ) { //All AEs start with an 11 byte sub-block to determine what type of AE it is
char buf[11];
io->read_proc(buf, 11, 1, handle);
- if( !memcmp(buf, "NETSCAPE2.0", 11) || !memcmp(buf, "ANIMEXTS1.0", 11) ) { //Not everybody recognizes ANIMEXTS1.0 but it is valid
+ if ( !memcmp(buf, "NETSCAPE2.0", 11) || !memcmp(buf, "ANIMEXTS1.0", 11) ) { //Not everybody recognizes ANIMEXTS1.0 but it is valid
io->read_proc(&b, 1, 1, handle);
- if( b == 3 ) { //we're supposed to have a 3 byte sub-block now
+ if ( b == 3 ) { //we're supposed to have a 3 byte sub-block now
io->read_proc(&b, 1, 1, handle); //this should be 0x01 but isn't really important
io->read_proc(&w, 2, 1, handle);
#ifdef FREEIMAGE_BIGENDIAN
SwapShort(&w);
#endif
loop = w;
- if( loop > 0 ) loop++;
+ if ( loop > 0 ) loop++;
break;
}
}
@@ -1007,7 +1007,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
FreeImage_SetMetadataEx(FIMD_ANIMATION, dib, "Loop", ANIMTAG_LOOP, FIDT_LONG, 1, 4, &loop);
//Comment Extension
- for( idx = 0; idx < info->comment_extension_offsets.size(); idx++ ) {
+ for ( idx = 0; idx < info->comment_extension_offsets.size(); idx++ ) {
io->seek_proc(handle, (long)info->comment_extension_offsets[idx], SEEK_SET);
std::string comment;
char buf[255];
@@ -1025,7 +1025,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
}
//Graphic Control Extension
- if( info->graphic_control_extension_offsets[page] != 0 ) {
+ if ( info->graphic_control_extension_offsets[page] != 0 ) {
io->seek_proc(handle, (long)(info->graphic_control_extension_offsets[page] + 1), SEEK_SET);
io->read_proc(&packed, 1, 1, handle);
io->read_proc(&w, 2, 1, handle);
@@ -1037,9 +1037,9 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
disposal_method = (packed & GIF_PACKED_GCE_DISPOSAL) >> 2;
delay_time = w * 10; //convert cs to ms
transparent_color = b;
- if( have_transparent ) {
+ if ( have_transparent ) {
int size = 1 << bpp;
- if( transparent_color <= size ) {
+ if ( transparent_color <= size ) {
BYTE table[256];
memset(table, 0xFF, size);
table[transparent_color] = 0;
@@ -1054,7 +1054,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
delete stringtable;
} catch (const char *msg) {
- if( dib != NULL ) {
+ if ( dib != NULL ) {
FreeImage_Unload(dib);
}
FreeImage_OutputMessageProc(s_format_id, msg);
@@ -1066,12 +1066,12 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
static BOOL DLL_CALLCONV
Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void *data) {
- if( data == NULL ) {
+ if ( data == NULL ) {
return FALSE;
}
//GIFinfo *info = (GIFinfo *)data;
- if( page == -1 ) {
+ if ( page == -1 ) {
page = 0;
}
@@ -1081,7 +1081,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
FITAG *tag;
int bpp = FreeImage_GetBPP(dib);
- if( bpp != 1 && bpp != 4 && bpp != 8 ) {
+ if ( bpp != 1 && bpp != 4 && bpp != 8 ) {
throw "Only 1, 4, or 8 bpp images supported";
}
@@ -1089,22 +1089,22 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
int disposal_method = GIF_DISPOSAL_BACKGROUND, delay_time = 100, transparent_color = 0;
WORD left = 0, top = 0, width = (WORD)FreeImage_GetWidth(dib), height = (WORD)FreeImage_GetHeight(dib);
WORD output_height = height;
- if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "FrameLeft", FIDT_SHORT, &tag) ) {
+ if ( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "FrameLeft", FIDT_SHORT, &tag) ) {
left = *(WORD *)FreeImage_GetTagValue(tag);
}
- if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "FrameTop", FIDT_SHORT, &tag) ) {
+ if ( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "FrameTop", FIDT_SHORT, &tag) ) {
top = *(WORD *)FreeImage_GetTagValue(tag);
}
- if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "NoLocalPalette", FIDT_BYTE, &tag) ) {
+ if ( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "NoLocalPalette", FIDT_BYTE, &tag) ) {
no_local_palette = *(BYTE *)FreeImage_GetTagValue(tag) ? true : false;
}
- if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "Interlaced", FIDT_BYTE, &tag) ) {
+ if ( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "Interlaced", FIDT_BYTE, &tag) ) {
interlaced = *(BYTE *)FreeImage_GetTagValue(tag) ? true : false;
}
- if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "FrameTime", FIDT_LONG, &tag) ) {
+ if ( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "FrameTime", FIDT_LONG, &tag) ) {
delay_time = *(LONG *)FreeImage_GetTagValue(tag);
}
- if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "DisposalMethod", FIDT_BYTE, &tag) ) {
+ if ( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "DisposalMethod", FIDT_BYTE, &tag) ) {
disposal_method = *(BYTE *)FreeImage_GetTagValue(tag);
}
@@ -1116,17 +1116,17 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
SwapShort(&height);
#endif
- if( page == 0 ) {
+ if ( page == 0 ) {
//gather some info
WORD logicalwidth = width; // width has already been swapped...
- if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "LogicalWidth", FIDT_SHORT, &tag) ) {
+ if ( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "LogicalWidth", FIDT_SHORT, &tag) ) {
logicalwidth = *(WORD *)FreeImage_GetTagValue(tag);
#ifdef FREEIMAGE_BIGENDIAN
SwapShort(&logicalwidth);
#endif
}
WORD logicalheight = height; // height has already been swapped...
- if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "LogicalHeight", FIDT_SHORT, &tag) ) {
+ if ( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "LogicalHeight", FIDT_SHORT, &tag) ) {
logicalheight = *(WORD *)FreeImage_GetTagValue(tag);
#ifdef FREEIMAGE_BIGENDIAN
SwapShort(&logicalheight);
@@ -1134,9 +1134,9 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
}
RGBQUAD *globalpalette = NULL;
int globalpalette_size = 0;
- if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "GlobalPalette", FIDT_PALETTE, &tag) ) {
+ if ( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "GlobalPalette", FIDT_PALETTE, &tag) ) {
globalpalette_size = FreeImage_GetTagCount(tag);
- if( globalpalette_size >= 2 ) {
+ if ( globalpalette_size >= 2 ) {
globalpalette = (RGBQUAD *)FreeImage_GetTagValue(tag);
}
}
@@ -1147,36 +1147,36 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
packed = GIF_PACKED_LSD_COLORRES;
b = 0;
RGBQUAD background_color;
- if( globalpalette != NULL ) {
+ if ( globalpalette != NULL ) {
packed |= GIF_PACKED_LSD_HAVEGCT;
- if( globalpalette_size < 4 ) {
+ if ( globalpalette_size < 4 ) {
globalpalette_size = 2;
packed |= 0 & GIF_PACKED_LSD_GCTSIZE;
- } else if( globalpalette_size < 8 ) {
+ } else if ( globalpalette_size < 8 ) {
globalpalette_size = 4;
packed |= 1 & GIF_PACKED_LSD_GCTSIZE;
- } else if( globalpalette_size < 16 ) {
+ } else if ( globalpalette_size < 16 ) {
globalpalette_size = 8;
packed |= 2 & GIF_PACKED_LSD_GCTSIZE;
- } else if( globalpalette_size < 32 ) {
+ } else if ( globalpalette_size < 32 ) {
globalpalette_size = 16;
packed |= 3 & GIF_PACKED_LSD_GCTSIZE;
- } else if( globalpalette_size < 64 ) {
+ } else if ( globalpalette_size < 64 ) {
globalpalette_size = 32;
packed |= 4 & GIF_PACKED_LSD_GCTSIZE;
- } else if( globalpalette_size < 128 ) {
+ } else if ( globalpalette_size < 128 ) {
globalpalette_size = 64;
packed |= 5 & GIF_PACKED_LSD_GCTSIZE;
- } else if( globalpalette_size < 256 ) {
+ } else if ( globalpalette_size < 256 ) {
globalpalette_size = 128;
packed |= 6 & GIF_PACKED_LSD_GCTSIZE;
} else {
globalpalette_size = 256;
packed |= 7 & GIF_PACKED_LSD_GCTSIZE;
}
- if( FreeImage_GetBackgroundColor(dib, &background_color) ) {
- for( int i = 0; i < globalpalette_size; i++ ) {
- if( background_color.rgbRed == globalpalette[i].rgbRed &&
+ if ( FreeImage_GetBackgroundColor(dib, &background_color) ) {
+ for ( int i = 0; i < globalpalette_size; i++ ) {
+ if ( background_color.rgbRed == globalpalette[i].rgbRed &&
background_color.rgbGreen == globalpalette[i].rgbGreen &&
background_color.rgbBlue == globalpalette[i].rgbBlue ) {
@@ -1194,7 +1194,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
io->write_proc(&b, 1, 1, handle);
//Global Color Table
- if( globalpalette != NULL ) {
+ if ( globalpalette != NULL ) {
int i = 0;
while( i < globalpalette_size ) {
io->write_proc(&globalpalette[i].rgbRed, 1, 1, handle);
@@ -1206,13 +1206,13 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
//Application Extension
LONG loop = 0;
- if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "Loop", FIDT_LONG, &tag) ) {
+ if ( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "Loop", FIDT_LONG, &tag) ) {
loop = *(LONG *)FreeImage_GetTagValue(tag);
}
- if( loop != 1 ) {
+ if ( loop != 1 ) {
//the Netscape extension is really "repeats" not "loops"
- if( loop > 1 ) loop--;
- if( loop > 0xFFFF ) loop = 0xFFFF;
+ if ( loop > 1 ) loop--;
+ if ( loop > 0xFFFF ) loop = 0xFFFF;
w = (WORD)loop;
#ifdef FREEIMAGE_BIGENDIAN
SwapShort(&w);
@@ -1227,9 +1227,9 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
FIMETADATA *mdhandle = NULL;
FITAG *tag = NULL;
mdhandle = FreeImage_FindFirstMetadata(FIMD_COMMENTS, dib, &tag);
- if( mdhandle ) {
+ if ( mdhandle ) {
do {
- if( FreeImage_GetTagType(tag) == FIDT_ASCII ) {
+ if ( FreeImage_GetTagType(tag) == FIDT_ASCII ) {
int length = FreeImage_GetTagLength(tag) - 1;
char *value = (char *)FreeImage_GetTagValue(tag);
io->write_proc((void *)"\x21\xFE", 2, 1, handle);
@@ -1250,11 +1250,11 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
}
//Graphic Control Extension
- if( FreeImage_IsTransparent(dib) ) {
+ if ( FreeImage_IsTransparent(dib) ) {
int count = FreeImage_GetTransparencyCount(dib);
BYTE *table = FreeImage_GetTransparencyTable(dib);
- for( int i = 0; i < count; i++ ) {
- if( table[i] == 0 ) {
+ for ( int i = 0; i < count; i++ ) {
+ if ( table[i] == 0 ) {
have_transparent = true;
transparent_color = i;
break;
@@ -1263,7 +1263,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
}
io->write_proc((void *)"\x21\xF9\x04", 3, 1, handle);
b = (BYTE)((disposal_method << 2) & GIF_PACKED_GCE_DISPOSAL);
- if( have_transparent ) b |= GIF_PACKED_GCE_HAVETRANS;
+ if ( have_transparent ) b |= GIF_PACKED_GCE_HAVETRANS;
io->write_proc(&b, 1, 1, handle);
//Notes about delay time for GIFs:
//IE5/IE6 have a minimum and default of 100ms
@@ -1287,14 +1287,14 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
io->write_proc(&width, 2, 1, handle);
io->write_proc(&height, 2, 1, handle);
packed = 0;
- if( !no_local_palette ) packed |= GIF_PACKED_ID_HAVELCT | ((bpp - 1) & GIF_PACKED_ID_LCTSIZE);
- if( interlaced ) packed |= GIF_PACKED_ID_INTERLACED;
+ if ( !no_local_palette ) packed |= GIF_PACKED_ID_HAVELCT | ((bpp - 1) & GIF_PACKED_ID_LCTSIZE);
+ if ( interlaced ) packed |= GIF_PACKED_ID_INTERLACED;
io->write_proc(&packed, 1, 1, handle);
//Local Color Table
- if( !no_local_palette ) {
+ if ( !no_local_palette ) {
int palsize = 1 << bpp;
- for( int i = 0; i < palsize; i++ ) {
+ for ( int i = 0; i < palsize; i++ ) {
io->write_proc(&pal[i].rgbRed, 1, 1, handle);
io->write_proc(&pal[i].rgbGreen, 1, 1, handle);
io->write_proc(&pal[i].rgbBlue, 1, 1, handle);
@@ -1318,7 +1318,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
memcpy(stringtable->FillInputBuffer(line), FreeImage_GetScanLine(dib, output_height - y - 1), line);
while( stringtable->Compress(bufptr, &size) ) {
bufptr += size;
- if( bufptr - buf == sizeof(buf) ) {
+ if ( bufptr - buf == sizeof(buf) ) {
io->write_proc(&b, 1, 1, handle);
io->write_proc(buf, sizeof(buf), 1, handle);
size = sizeof(buf);
@@ -1327,9 +1327,9 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
size = (int)(sizeof(buf) - (bufptr - buf));
}
}
- if( interlaced ) {
+ if ( interlaced ) {
y += g_GifInterlaceIncrement[interlacepass];
- if( y >= output_height && ++interlacepass < GIF_INTERLACE_PASSES ) {
+ if ( y >= output_height && ++interlacepass < GIF_INTERLACE_PASSES ) {
y = g_GifInterlaceOffset[interlacepass];
}
} else {
@@ -1339,14 +1339,14 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
size = (int)(bufptr - buf);
BYTE last[4];
w = (WORD)stringtable->CompressEnd(last);
- if( size + w >= sizeof(buf) ) {
+ if ( size + w >= sizeof(buf) ) {
//one last full size sub-block
io->write_proc(&b, 1, 1, handle);
io->write_proc(buf, size, 1, handle);
io->write_proc(last, sizeof(buf) - size, 1, handle);
//and possibly a tiny additional sub-block
b = (BYTE)(w - (sizeof(buf) - size));
- if( b > 0 ) {
+ if ( b > 0 ) {
io->write_proc(&b, 1, 1, handle);
io->write_proc(last + w - b, b, 1, handle);
}
diff --git a/plugins/FreeImage/Source/FreeImage/PluginHDR.cpp b/plugins/FreeImage/Source/FreeImage/PluginHDR.cpp
index 96a10d7d35..a0334e1143 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginHDR.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginHDR.cpp
@@ -127,7 +127,7 @@ rgbe_GetLine(FreeImageIO *io, fi_handle handle, char *buffer, int length) {
int i;
memset(buffer, 0, length);
for(i = 0; i < length; i++) {
- if(!io->read_proc(&buffer[i], 1, 1, handle))
+ if (!io->read_proc(&buffer[i], 1, 1, handle))
return FALSE;
if(buffer[i] == 0x0A)
break;
@@ -196,7 +196,7 @@ rgbe_ReadHeader(FreeImageIO *io, fi_handle handle, unsigned *width, unsigned *he
header_info->exposure = 1.0;
// get the first line
- if(!rgbe_GetLine(io, handle, buf, HDR_MAXLINE))
+ if (!rgbe_GetLine(io, handle, buf, HDR_MAXLINE))
return rgbe_Error(rgbe_read_error, NULL);
// check the signature
@@ -208,19 +208,19 @@ rgbe_ReadHeader(FreeImageIO *io, fi_handle handle, unsigned *width, unsigned *he
else {
header_info->valid |= RGBE_VALID_PROGRAMTYPE;
for(i = 0; i < sizeof(header_info->programtype) - 1; i++) {
- if((buf[i+2] == 0) || isspace(buf[i+2]))
+ if ((buf[i+2] == 0) || isspace(buf[i+2]))
break;
header_info->programtype[i] = buf[i+2];
}
header_info->programtype[i] = 0;
}
- for(;;) {
+ for (;;) {
// get next line
- if(!rgbe_GetLine(io, handle, buf, HDR_MAXLINE))
+ if (!rgbe_GetLine(io, handle, buf, HDR_MAXLINE))
return rgbe_Error(rgbe_read_error, NULL);
- if((buf[0] == 0) || (buf[0] == '\n')) {
+ if ((buf[0] == 0) || (buf[0] == '\n')) {
// end of header so break out of loop
bHeaderFound = TRUE;
break;
@@ -236,17 +236,17 @@ rgbe_ReadHeader(FreeImageIO *io, fi_handle handle, unsigned *width, unsigned *he
header_info->exposure = tempf;
header_info->valid |= RGBE_VALID_EXPOSURE;
}
- else if((buf[0] == '#') && (buf[1] == 0x20)) {
+ else if ((buf[0] == '#') && (buf[1] == 0x20)) {
header_info->valid |= RGBE_VALID_COMMENT;
strcpy(header_info->comment, buf);
}
}
- if(!bHeaderFound || !bFormatFound) {
+ if (!bHeaderFound || !bFormatFound) {
return rgbe_Error(rgbe_format_error, "invalid header");
}
// get next line
- if(!rgbe_GetLine(io, handle, buf, HDR_MAXLINE))
+ if (!rgbe_GetLine(io, handle, buf, HDR_MAXLINE))
return rgbe_Error(rgbe_read_error, NULL);
// get the image width & height
@@ -364,14 +364,14 @@ rgbe_ReadPixels_RLE(FreeImageIO *io, fi_handle handle, FIRGBF *data, int scanlin
free(scanline_buffer);
return rgbe_Error(rgbe_read_error,NULL);
}
- if((rgbe[0] != 2) || (rgbe[1] != 2) || (rgbe[2] & 0x80)) {
+ if ((rgbe[0] != 2) || (rgbe[1] != 2) || (rgbe[2] & 0x80)) {
// this file is not run length encoded
rgbe_RGBEToFloat(data, rgbe);
data ++;
free(scanline_buffer);
return rgbe_ReadPixels(io, handle, data, scanline_width * num_scanlines - 1);
}
- if((((int)rgbe[2]) << 8 | rgbe[3]) != scanline_width) {
+ if ((((int)rgbe[2]) << 8 | rgbe[3]) != scanline_width) {
free(scanline_buffer);
return rgbe_Error(rgbe_format_error,"wrong scanline width");
}
@@ -394,7 +394,7 @@ rgbe_ReadPixels_RLE(FreeImageIO *io, fi_handle handle, FIRGBF *data, int scanlin
if(buf[0] > 128) {
// a run of the same value
count = buf[0] - 128;
- if((count == 0) || (count > ptr_end - ptr)) {
+ if ((count == 0) || (count > ptr_end - ptr)) {
free(scanline_buffer);
return rgbe_Error(rgbe_format_error, "bad scanline data");
}
@@ -404,12 +404,12 @@ rgbe_ReadPixels_RLE(FreeImageIO *io, fi_handle handle, FIRGBF *data, int scanlin
else {
// a non-run
count = buf[0];
- if((count == 0) || (count > ptr_end - ptr)) {
+ if ((count == 0) || (count > ptr_end - ptr)) {
free(scanline_buffer);
return rgbe_Error(rgbe_format_error, "bad scanline data");
}
*ptr++ = buf[1];
- if(--count > 0) {
+ if (--count > 0) {
if(io->read_proc(ptr, 1, sizeof(BYTE) * count, handle) < 1) {
free(scanline_buffer);
return rgbe_Error(rgbe_read_error, NULL);
@@ -530,7 +530,7 @@ rgbe_WritePixels_RLE(FreeImageIO *io, fi_handle handle, FIRGBF *data, unsigned s
// first red, then green, then blue, then exponent
for(int i = 0; i < 4; i++) {
BOOL bOK = rgbe_WriteBytes_RLE(io, handle, &buffer[i*scanline_width], scanline_width);
- if(!bOK) {
+ if (!bOK) {
free(buffer);
return bOK;
}
@@ -606,7 +606,7 @@ static FIBITMAP * DLL_CALLCONV
Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
FIBITMAP *dib = NULL;
- if(!handle) {
+ if (!handle) {
return NULL;
}
@@ -624,7 +624,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// allocate a RGBF image
dib = FreeImage_AllocateHeaderT(header_only, FIT_RGBF, width, height);
- if(!dib) {
+ if (!dib) {
throw FI_MSG_ERROR_MEMORY;
}
@@ -640,7 +640,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
for(unsigned y = 0; y < height; y++) {
FIRGBF *scanline = (FIRGBF*)FreeImage_GetScanLine(dib, height - 1 - y);
- if(!rgbe_ReadPixels_RLE(io, handle, scanline, width, 1)) {
+ if (!rgbe_ReadPixels_RLE(io, handle, scanline, width, 1)) {
FreeImage_Unload(dib);
return NULL;
}
@@ -659,7 +659,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
static BOOL DLL_CALLCONV
Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void *data) {
- if(!dib) return FALSE;
+ if (!dib) return FALSE;
if(FreeImage_GetImageType(dib) != FIT_RGBF) {
return FALSE;
@@ -676,7 +676,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
rgbe_WriteMetadata(dib, &header_info);
// fill a comment
sprintf(header_info.comment, "# Made with FreeImage %s", FreeImage_GetVersion());
- if(!rgbe_WriteHeader(io, handle, width, height, &header_info)) {
+ if (!rgbe_WriteHeader(io, handle, width, height, &header_info)) {
return FALSE;
}
@@ -684,7 +684,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
for(unsigned y = 0; y < height; y++) {
FIRGBF *scanline = (FIRGBF*)FreeImage_GetScanLine(dib, height - 1 - y);
- if(!rgbe_WritePixels_RLE(io, handle, scanline, width, 1)) {
+ if (!rgbe_WritePixels_RLE(io, handle, scanline, width, 1)) {
return FALSE;
}
}
diff --git a/plugins/FreeImage/Source/FreeImage/PluginICO.cpp b/plugins/FreeImage/Source/FreeImage/PluginICO.cpp
index 7f41a0d841..1107841d33 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginICO.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginICO.cpp
@@ -232,7 +232,7 @@ Open(FreeImageIO *io, fi_handle handle, BOOL read) {
SwapIconHeader(lpIH);
#endif
- if(!(lpIH->idReserved == 0) || !(lpIH->idType == 1)) {
+ if (!(lpIH->idReserved == 0) || !(lpIH->idType == 1)) {
// Not an ICO file
free(lpIH);
return NULL;
@@ -295,7 +295,7 @@ LoadStandardIcon(FreeImageIO *io, fi_handle handle, int flags, BOOL header_only)
return NULL;
}
- if( bmih.biBitCount <= 8 ) {
+ if ( bmih.biBitCount <= 8 ) {
// read the palette data
io->read_proc(FreeImage_GetPalette(dib), CalculateUsedPaletteEntries(bit_count) * sizeof(RGBQUAD), 1, handle);
#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_RGB
@@ -339,7 +339,7 @@ LoadStandardIcon(FreeImageIO *io, fi_handle handle, int flags, BOOL header_only)
// bitmap has been loaded successfully!
// convert to 32bpp and generate an alpha channel
- if((flags & ICO_MAKEALPHA) == ICO_MAKEALPHA) {
+ if ((flags & ICO_MAKEALPHA) == ICO_MAKEALPHA) {
FIBITMAP *dib32 = FreeImage_ConvertTo32Bits(dib);
FreeImage_Unload(dib);
@@ -350,7 +350,7 @@ LoadStandardIcon(FreeImageIO *io, fi_handle handle, int flags, BOOL header_only)
int width_and = WidthBytes(width);
BYTE *line_and = (BYTE *)malloc(width_and);
- if( line_and == NULL ) {
+ if ( line_and == NULL ) {
FreeImage_Unload(dib32);
return NULL;
}
@@ -361,7 +361,7 @@ LoadStandardIcon(FreeImageIO *io, fi_handle handle, int flags, BOOL header_only)
io->read_proc(line_and, width_and, 1, handle);
for(int x = 0; x < width; x++) {
quad->rgbReserved = (line_and[x>>3] & (0x80 >> (x & 0x07))) != 0 ? 0 : 0xFF;
- if( quad->rgbReserved == 0 ) {
+ if ( quad->rgbReserved == 0 ) {
quad->rgbBlue ^= 0xFF;
quad->rgbGreen ^= 0xFF;
quad->rgbRed ^= 0xFF;
@@ -409,7 +409,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
io->seek_proc(handle, 0, SEEK_SET);
io->seek_proc(handle, icon_list[page].dwImageOffset, SEEK_CUR);
- if((icon_list[page].bWidth == 0) && (icon_list[page].bHeight == 0)) {
+ if ((icon_list[page].bWidth == 0) && (icon_list[page].bHeight == 0)) {
// Vista icon support
dib = FreeImage_LoadFromHandle(FIF_PNG, io, handle, header_only ? FIF_LOAD_NOPIXELS : PNG_DEFAULT);
}
@@ -530,7 +530,7 @@ SaveStandardIcon(FreeImageIO *io, FIBITMAP *dib, fi_handle handle) {
#endif
// AND mask
BYTE *and_mask = (BYTE*)malloc(size_and);
- if(!and_mask) {
+ if (!and_mask) {
return FALSE;
}
@@ -642,14 +642,14 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
std::vector<FIBITMAP*> vPages;
int k;
- if(!dib || !handle || !data) {
+ if (!dib || !handle || !data) {
return FALSE;
}
// check format limits
unsigned w = FreeImage_GetWidth(dib);
unsigned h = FreeImage_GetHeight(dib);
- if((w < 16) || (w > 256) || (h < 16) || (h > 256) || (w != h)) {
+ if ((w < 16) || (w > 256) || (h < 16) || (h > 256) || (w != h)) {
FreeImage_OutputMessageProc(s_format_id, "Unsupported icon size: width x height = %d x %d", w, h);
return FALSE;
}
@@ -667,7 +667,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
// load all icons
for(k = 0; k < icon_header->idCount; k++) {
icon_dib = Load(io, handle, k, flags, data);
- if(!icon_dib) {
+ if (!icon_dib) {
throw FI_MSG_ERROR_DIB_MEMORY;
}
vPages.push_back(icon_dib);
@@ -694,7 +694,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
// save the icon descriptions
ICONDIRENTRY *icon_list = (ICONDIRENTRY *)malloc(icon_header->idCount * sizeof(ICONDIRENTRY));
- if(!icon_list) {
+ if (!icon_list) {
throw FI_MSG_ERROR_MEMORY;
}
memset(icon_list, 0, icon_header->idCount * sizeof(ICONDIRENTRY));
@@ -710,7 +710,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
icon_list[k].bReserved = 0;
icon_list[k].wPlanes = bmih->biPlanes;
icon_list[k].wBitCount = bmih->biBitCount;
- if( (icon_list[k].wPlanes * icon_list[k].wBitCount) >= 8 ) {
+ if ( (icon_list[k].wPlanes * icon_list[k].wBitCount) >= 8 ) {
icon_list[k].bColorCount = 0;
} else {
icon_list[k].bColorCount = (BYTE)(1 << (icon_list[k].wPlanes * icon_list[k].wBitCount));
@@ -731,7 +731,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
for(k = 0; k < icon_header->idCount; k++) {
icon_dib = (FIBITMAP*)vPages[k];
- if((icon_list[k].bWidth == 0) && (icon_list[k].bHeight == 0)) {
+ if ((icon_list[k].bWidth == 0) && (icon_list[k].bHeight == 0)) {
// Vista icon support
FreeImage_SaveToHandle(FIF_PNG, icon_dib, io, handle, PNG_DEFAULT);
}
diff --git a/plugins/FreeImage/Source/FreeImage/PluginIFF.cpp b/plugins/FreeImage/Source/FreeImage/PluginIFF.cpp
index ae1f903f82..b6cd45d6db 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginIFF.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginIFF.cpp
@@ -220,7 +220,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
SwapLong(&type);
#endif
- if((type != ID_ILBM) && (type != ID_PBM))
+ if ((type != ID_ILBM) && (type != ID_PBM))
return NULL;
size -= 4;
@@ -266,7 +266,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
depth = planes > 8 ? 24 : 8;
- if( depth == 24 ) {
+ if ( depth == 24 ) {
dib = FreeImage_Allocate(width, height, depth, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
} else {
dib = FreeImage_Allocate(width, height, depth);
@@ -358,7 +358,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// t = [0..127] => copy the next t+1 bytes literally
unsigned size_to_read = t + 1;
- if((size_to_read + x) > src_size) {
+ if ((size_to_read + x) > src_size) {
// sanity check for buffer overruns
size_to_read = src_size - x;
io->read_proc(src + x, size_to_read, 1, handle);
@@ -373,7 +373,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
io->read_proc(&b, 1, 1, handle);
unsigned size_to_copy = (unsigned)(-(int)t + 1);
- if((size_to_copy + x) > src_size) {
+ if ((size_to_copy + x) > src_size) {
// sanity check for buffer overruns
size_to_copy = src_size - x;
memset(src + x, b, size_to_copy);
diff --git a/plugins/FreeImage/Source/FreeImage/PluginJ2K.cpp b/plugins/FreeImage/Source/FreeImage/PluginJ2K.cpp
index c868ce253d..6e772afdaa 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginJ2K.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginJ2K.cpp
@@ -142,7 +142,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
FIBITMAP *dib = NULL;
// check the file format
- if(!Validate(io, handle)) {
+ if (!Validate(io, handle)) {
return NULL;
}
@@ -163,7 +163,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
file_length = io->tell_proc(handle) - start_pos;
io->seek_proc(handle, start_pos, SEEK_SET);
src = (BYTE*)malloc(file_length * sizeof(BYTE));
- if(!src) {
+ if (!src) {
throw FI_MSG_ERROR_MEMORY;
}
if(io->read_proc(src, 1, file_length, handle) < 1) {
@@ -186,7 +186,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// decode the stream and fill the image structure
image = opj_decode(dinfo, cio);
- if(!image) {
+ if (!image) {
throw "Failed to decode image!\n";
}
@@ -203,7 +203,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// create output image
dib = J2KImageToFIBITMAP(s_format_id, image);
- if(!dib) throw "Failed to import JPEG2000 image";
+ if (!dib) throw "Failed to import JPEG2000 image";
// free image data structure
opj_image_destroy(image);
@@ -261,7 +261,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
try {
// convert the dib to a OpenJPEG image
image = FIBITMAPToJ2KImage(s_format_id, dib, &parameters);
- if(!image) return FALSE;
+ if (!image) return FALSE;
// decide if MCT should be used
parameters.tcp_mct = (image->numcomps == 3) ? 1 : 0;
diff --git a/plugins/FreeImage/Source/FreeImage/PluginJP2.cpp b/plugins/FreeImage/Source/FreeImage/PluginJP2.cpp
index df41218761..ed1cb267bb 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginJP2.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginJP2.cpp
@@ -142,7 +142,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
FIBITMAP *dib = NULL;
// check the file format
- if(!Validate(io, handle)) {
+ if (!Validate(io, handle)) {
return NULL;
}
@@ -163,7 +163,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
file_length = io->tell_proc(handle) - start_pos;
io->seek_proc(handle, start_pos, SEEK_SET);
src = (BYTE*)malloc(file_length * sizeof(BYTE));
- if(!src) {
+ if (!src) {
throw FI_MSG_ERROR_MEMORY;
}
if(io->read_proc(src, 1, file_length, handle) < 1) {
@@ -186,7 +186,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// decode the stream and fill the image structure
image = opj_decode(dinfo, cio);
- if(!image) {
+ if (!image) {
throw "Failed to decode image!\n";
}
@@ -203,7 +203,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// create output image
dib = J2KImageToFIBITMAP(s_format_id, image);
- if(!dib) throw "Failed to import JPEG2000 image";
+ if (!dib) throw "Failed to import JPEG2000 image";
// free image data structure
opj_image_destroy(image);
@@ -261,7 +261,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
try {
// convert the dib to a OpenJPEG image
image = FIBITMAPToJ2KImage(s_format_id, dib, &parameters);
- if(!image) return FALSE;
+ if (!image) return FALSE;
// decide if MCT should be used
parameters.tcp_mct = (image->numcomps == 3) ? 1 : 0;
diff --git a/plugins/FreeImage/Source/FreeImage/PluginJPEG.cpp b/plugins/FreeImage/Source/FreeImage/PluginJPEG.cpp
index ed52bfdd0d..b6393de7aa 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginJPEG.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginJPEG.cpp
@@ -757,7 +757,7 @@ read_markers(j_decompress_ptr cinfo, FIBITMAP *dib) {
continue;
}
if(memcmp(marker->data, "JFXX" , 5) == 0) {
- if(!cinfo->saw_JFIF_marker || cinfo->JFIF_minor_version < 2) {
+ if (!cinfo->saw_JFIF_marker || cinfo->JFIF_minor_version < 2) {
FreeImage_OutputMessageProc(s_format_id, "Warning: non-standard JFXX segment");
}
jpeg_read_jfxx(dib, marker->data, marker->data_length);
@@ -785,7 +785,7 @@ read_markers(j_decompress_ptr cinfo, FIBITMAP *dib) {
BYTE *icc_profile = NULL;
unsigned icc_length = 0;
- if( jpeg_read_icc_profile(cinfo, &icc_profile, &icc_length) ) {
+ if ( jpeg_read_icc_profile(cinfo, &icc_profile, &icc_length) ) {
// copy ICC profile data
FreeImage_CreateICCProfile(dib, icc_profile, icc_length);
// clean up
@@ -995,11 +995,11 @@ static BOOL
jpeg_write_jfxx(j_compress_ptr cinfo, FIBITMAP *dib) {
// get the thumbnail to be stored
FIBITMAP* thumbnail = FreeImage_GetThumbnail(dib);
- if(!thumbnail) {
+ if (!thumbnail) {
return TRUE;
}
// check for a compatible output format
- if((FreeImage_GetImageType(thumbnail) != FIT_BITMAP) || (FreeImage_GetBPP(thumbnail) != 8) && (FreeImage_GetBPP(thumbnail) != 24)) {
+ if ((FreeImage_GetImageType(thumbnail) != FIT_BITMAP) || (FreeImage_GetBPP(thumbnail) != 8) && (FreeImage_GetBPP(thumbnail) != 24)) {
FreeImage_OutputMessageProc(s_format_id, FI_MSG_WARNING_INVALID_THUMBNAIL);
return FALSE;
}
@@ -1325,22 +1325,22 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// step 5b: allocate dib and init header
- if((cinfo.num_components == 4) && (cinfo.out_color_space == JCS_CMYK)) {
+ if ((cinfo.num_components == 4) && (cinfo.out_color_space == JCS_CMYK)) {
// CMYK image
- if((flags & JPEG_CMYK) == JPEG_CMYK) {
+ if ((flags & JPEG_CMYK) == JPEG_CMYK) {
// load as CMYK
dib = FreeImage_AllocateHeader(header_only, cinfo.output_width, cinfo.output_height, 32, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
- if(!dib) throw FI_MSG_ERROR_DIB_MEMORY;
+ if (!dib) throw FI_MSG_ERROR_DIB_MEMORY;
FreeImage_GetICCProfile(dib)->flags |= FIICC_COLOR_IS_CMYK;
} else {
// load as CMYK and convert to RGB
dib = FreeImage_AllocateHeader(header_only, cinfo.output_width, cinfo.output_height, 24, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
- if(!dib) throw FI_MSG_ERROR_DIB_MEMORY;
+ if (!dib) throw FI_MSG_ERROR_DIB_MEMORY;
}
} else {
// RGB or greyscale image
dib = FreeImage_AllocateHeader(header_only, cinfo.output_width, cinfo.output_height, 8 * cinfo.num_components, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
- if(!dib) throw FI_MSG_ERROR_DIB_MEMORY;
+ if (!dib) throw FI_MSG_ERROR_DIB_MEMORY;
if (cinfo.num_components == 1) {
// build a greyscale palette
@@ -1385,7 +1385,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// step 7a: while (scan lines remain to be read) jpeg_read_scanlines(...);
- if((cinfo.out_color_space == JCS_CMYK) && ((flags & JPEG_CMYK) != JPEG_CMYK)) {
+ if ((cinfo.out_color_space == JCS_CMYK) && ((flags & JPEG_CMYK) != JPEG_CMYK)) {
// convert from CMYK to RGB
JSAMPARRAY buffer; // output row buffer
@@ -1411,7 +1411,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
dst += 3;
}
}
- } else if((cinfo.out_color_space == JCS_CMYK) && ((flags & JPEG_CMYK) == JPEG_CMYK)) {
+ } else if ((cinfo.out_color_space == JCS_CMYK) && ((flags & JPEG_CMYK) == JPEG_CMYK)) {
// convert from LibJPEG CMYK to standard CMYK
JSAMPARRAY buffer; // output row buffer
@@ -1466,7 +1466,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
jpeg_destroy_decompress(&cinfo);
// check for automatic Exif rotation
- if(!header_only && ((flags & JPEG_EXIFROTATE) == JPEG_EXIFROTATE)) {
+ if (!header_only && ((flags & JPEG_EXIFROTATE) == JPEG_EXIFROTATE)) {
rotate_exif(&dib);
}
@@ -1560,12 +1560,12 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
jpeg_set_defaults(&cinfo);
// progressive-JPEG support
- if((flags & JPEG_PROGRESSIVE) == JPEG_PROGRESSIVE) {
+ if ((flags & JPEG_PROGRESSIVE) == JPEG_PROGRESSIVE) {
jpeg_simple_progression(&cinfo);
}
// compute optimal Huffman coding tables for the image
- if((flags & JPEG_OPTIMIZE) == JPEG_OPTIMIZE) {
+ if ((flags & JPEG_OPTIMIZE) == JPEG_OPTIMIZE) {
cinfo.optimize_coding = TRUE;
}
@@ -1590,7 +1590,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
// set subsampling options if required
if(cinfo.in_color_space == JCS_RGB) {
- if((flags & JPEG_SUBSAMPLING_411) == JPEG_SUBSAMPLING_411) {
+ if ((flags & JPEG_SUBSAMPLING_411) == JPEG_SUBSAMPLING_411) {
// 4:1:1 (4x1 1x1 1x1) - CrH 25% - CbH 25% - CrV 100% - CbV 100%
// the horizontal color resolution is quartered
cinfo.comp_info[0].h_samp_factor = 4; // Y
@@ -1599,7 +1599,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
cinfo.comp_info[1].v_samp_factor = 1;
cinfo.comp_info[2].h_samp_factor = 1; // Cr
cinfo.comp_info[2].v_samp_factor = 1;
- } else if((flags & JPEG_SUBSAMPLING_420) == JPEG_SUBSAMPLING_420) {
+ } else if ((flags & JPEG_SUBSAMPLING_420) == JPEG_SUBSAMPLING_420) {
// 4:2:0 (2x2 1x1 1x1) - CrH 50% - CbH 50% - CrV 50% - CbV 50%
// the chrominance resolution in both the horizontal and vertical directions is cut in half
cinfo.comp_info[0].h_samp_factor = 2; // Y
@@ -1608,7 +1608,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
cinfo.comp_info[1].v_samp_factor = 1;
cinfo.comp_info[2].h_samp_factor = 1; // Cr
cinfo.comp_info[2].v_samp_factor = 1;
- } else if((flags & JPEG_SUBSAMPLING_422) == JPEG_SUBSAMPLING_422){ //2x1 (low)
+ } else if ((flags & JPEG_SUBSAMPLING_422) == JPEG_SUBSAMPLING_422){ //2x1 (low)
// 4:2:2 (2x1 1x1 1x1) - CrH 50% - CbH 50% - CrV 100% - CbV 100%
// half of the horizontal resolution in the chrominance is dropped (Cb & Cr),
// while the full resolution is retained in the vertical direction, with respect to the luminance
@@ -1619,7 +1619,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
cinfo.comp_info[2].h_samp_factor = 1; // Cr
cinfo.comp_info[2].v_samp_factor = 1;
}
- else if((flags & JPEG_SUBSAMPLING_444) == JPEG_SUBSAMPLING_444){ //1x1 (no subsampling)
+ else if ((flags & JPEG_SUBSAMPLING_444) == JPEG_SUBSAMPLING_444){ //1x1 (no subsampling)
// 4:4:4 (1x1 1x1 1x1) - CrH 100% - CbH 100% - CrV 100% - CbV 100%
// the resolution of chrominance information (Cb & Cr) is preserved
// at the same rate as the luminance (Y) information
diff --git a/plugins/FreeImage/Source/FreeImage/PluginPCD.cpp b/plugins/FreeImage/Source/FreeImage/PluginPCD.cpp
index ff0c5b8679..87cbe967b2 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginPCD.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginPCD.cpp
@@ -155,7 +155,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
try {
// allocate the dib and write out the header
dib = FreeImage_AllocateHeader(header_only, width, height, bpp, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
- if(!dib) throw FI_MSG_ERROR_DIB_MEMORY;
+ if (!dib) throw FI_MSG_ERROR_DIB_MEMORY;
if(header_only) {
return dib;
@@ -173,7 +173,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
BYTE *y1 = (BYTE*)malloc(width * sizeof(BYTE));
BYTE *y2 = (BYTE*)malloc(width * sizeof(BYTE));
BYTE *cbcr = (BYTE*)malloc(width * sizeof(BYTE));
- if(!y1 || !y2 || !cbcr) throw FI_MSG_ERROR_MEMORY;
+ if (!y1 || !y2 || !cbcr) throw FI_MSG_ERROR_MEMORY;
BYTE *yl[] = { y1, y2 };
diff --git a/plugins/FreeImage/Source/FreeImage/PluginPCX.cpp b/plugins/FreeImage/Source/FreeImage/PluginPCX.cpp
index cd75629ddc..a6feb5fea7 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginPCX.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginPCX.cpp
@@ -84,9 +84,9 @@ pcx_validate(FreeImageIO *io, fi_handle handle) {
// version
if(signature[1] <= 5) {
// encoding
- if((signature[2] == 0) || (signature[2] == 1)) {
+ if ((signature[2] == 0) || (signature[2] == 1)) {
// bits per pixel per plane
- if((signature[3] == 1) || (signature[3] == 8)) {
+ if ((signature[3] == 1) || (signature[3] == 8)) {
return TRUE;
}
}
@@ -339,7 +339,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
BYTE *ReadBuf = NULL; // buffer;
BOOL bIsRLE; // True if the file is run-length encoded
- if(!handle) {
+ if (!handle) {
return NULL;
}
@@ -351,7 +351,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
long start_pos = io->tell_proc(handle);
BOOL validated = pcx_validate(io, handle);
io->seek_proc(handle, start_pos, SEEK_SET);
- if(!validated) {
+ if (!validated) {
throw FI_MSG_ERROR_MAGIC_NUMBER;
}
@@ -478,10 +478,10 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// ---------------
line = (BYTE*)malloc(linelength * sizeof(BYTE));
- if(!line) throw FI_MSG_ERROR_MEMORY;
+ if (!line) throw FI_MSG_ERROR_MEMORY;
ReadBuf = (BYTE*)malloc(IO_BUF_SIZE * sizeof(BYTE));
- if(!ReadBuf) throw FI_MSG_ERROR_MEMORY;
+ if (!ReadBuf) throw FI_MSG_ERROR_MEMORY;
bits = FreeImage_GetScanLine(dib, height - 1);
@@ -513,7 +513,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
unsigned x, y, written;
buffer = (BYTE*)malloc(width * sizeof(BYTE));
- if(!buffer) throw FI_MSG_ERROR_MEMORY;
+ if (!buffer) throw FI_MSG_ERROR_MEMORY;
for (y = 0; y < height; y++) {
written = readline(*io, handle, line, linelength, bIsRLE, ReadBuf, &ReadPos);
@@ -553,7 +553,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
free(buffer);
- } else if((header.planes == 3) && (header.bpp == 8)) {
+ } else if ((header.planes == 3) && (header.bpp == 8)) {
BYTE *pline;
for (unsigned y = 0; y < height; y++) {
diff --git a/plugins/FreeImage/Source/FreeImage/PluginPFM.cpp b/plugins/FreeImage/Source/FreeImage/PluginPFM.cpp
index 231e8baa22..8ccbd48ba5 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginPFM.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginPFM.cpp
@@ -48,7 +48,7 @@ pfm_get_line(FreeImageIO *io, fi_handle handle, char *buffer, int length) {
int i;
memset(buffer, 0, length);
for(i = 0; i < length; i++) {
- if(!io->read_proc(&buffer[i], 1, 1, handle))
+ if (!io->read_proc(&buffer[i], 1, 1, handle))
return FALSE;
if(buffer[i] == 0x0A)
break;
@@ -67,7 +67,7 @@ pfm_get_int(FreeImageIO *io, fi_handle handle) {
// skip forward to start of next number
- if(!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
+ if (!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
while (1) {
// eat comments
@@ -78,7 +78,7 @@ pfm_get_int(FreeImageIO *io, fi_handle handle) {
firstchar = TRUE;
while (1) {
- if(!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
+ if (!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
if (firstchar && c == ' ') {
// loop off 1 sp after #
@@ -96,7 +96,7 @@ pfm_get_int(FreeImageIO *io, fi_handle handle) {
break;
}
- if(!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
+ if (!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
}
// we're at the start of a number, continue until we hit a non-number
@@ -106,7 +106,7 @@ pfm_get_int(FreeImageIO *io, fi_handle handle) {
while (1) {
i = (i * 10) + (c - '0');
- if(!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
+ if (!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
if (c < '0' || c > '9')
break;
@@ -231,7 +231,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
if(bResult) {
bResult = (sscanf(line_buffer, "%f", &scalefactor) == 1) ? TRUE : FALSE;
}
- if(!bResult) {
+ if (!bResult) {
throw "Read error: invalid PFM header";
}
@@ -251,7 +251,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
if(image_type == FIT_RGBF) {
const unsigned lineWidth = 3 * width;
lineBuffer = (float*)malloc(lineWidth * sizeof(float));
- if(!lineBuffer) {
+ if (!lineBuffer) {
throw FI_MSG_ERROR_MEMORY;
}
@@ -285,7 +285,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
} else if(image_type == FIT_FLOAT) {
const unsigned lineWidth = width;
lineBuffer = (float*)malloc(lineWidth * sizeof(float));
- if(!lineBuffer) {
+ if (!lineBuffer) {
throw FI_MSG_ERROR_MEMORY;
}
@@ -330,10 +330,10 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
static BOOL DLL_CALLCONV
Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void *data) {
- if(!dib || !handle) return FALSE;
+ if (!dib || !handle) return FALSE;
FREE_IMAGE_TYPE image_type = FreeImage_GetImageType(dib);
- if((image_type != FIT_RGBF) && (image_type != FIT_FLOAT)) {
+ if ((image_type != FIT_RGBF) && (image_type != FIT_FLOAT)) {
return FALSE;
}
diff --git a/plugins/FreeImage/Source/FreeImage/PluginPICT.cpp b/plugins/FreeImage/Source/FreeImage/PluginPICT.cpp
index 99958a489c..0c44cb2d1f 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginPICT.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginPICT.cpp
@@ -1168,7 +1168,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// io->seek_proc( handle, 122, SEEK_CUR );
// found = TRUE;
BYTE data[ 2 ];
- if( io->read_proc( data, 2, 1, handle ) ) {
+ if ( io->read_proc( data, 2, 1, handle ) ) {
io->seek_proc( handle, -2, SEEK_CUR );
if ( data[0] == 0xFF && data[1] == 0xD8 ) {
diff --git a/plugins/FreeImage/Source/FreeImage/PluginPNG.cpp b/plugins/FreeImage/Source/FreeImage/PluginPNG.cpp
index b2cddec2b8..ad398a87e8 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginPNG.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginPNG.cpp
@@ -104,7 +104,7 @@ ReadMetadata(png_structp png_ptr, png_infop info_ptr, FIBITMAP *dib) {
for(int i = 0; i < num_text; i++) {
// create a tag
tag = FreeImage_CreateTag();
- if(!tag) return FALSE;
+ if (!tag) return FALSE;
DWORD tag_length = (DWORD) MAX(text_ptr[i].text_length, text_ptr[i].itxt_length);
@@ -354,7 +354,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
}
#ifndef FREEIMAGE_BIGENDIAN
- if((image_type == FIT_UINT16) || (image_type == FIT_RGB16) || (image_type == FIT_RGBA16)) {
+ if ((image_type == FIT_UINT16) || (image_type == FIT_RGB16) || (image_type == FIT_RGBA16)) {
// turn on 16 bit byte swapping
png_set_swap(png_ptr);
}
@@ -503,7 +503,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
png_get_tRNS(png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color);
- if((color_type == PNG_COLOR_TYPE_GRAY) && trans_color) {
+ if ((color_type == PNG_COLOR_TYPE_GRAY) && trans_color) {
// single transparent color
if (trans_color->gray < palette_entries) {
BYTE table[256];
@@ -511,7 +511,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
table[trans_color->gray] = 0;
FreeImage_SetTransparencyTable(dib, table, palette_entries);
}
- } else if((color_type == PNG_COLOR_TYPE_PALETTE) && trans_alpha) {
+ } else if ((color_type == PNG_COLOR_TYPE_PALETTE) && trans_alpha) {
// transparency table
FreeImage_SetTransparencyTable(dib, (BYTE *)trans_alpha, num_trans);
}
@@ -726,7 +726,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
pixel_depth = FreeImage_GetBPP(dib);
BOOL bInterlaced = FALSE;
- if( (flags & PNG_INTERLACED) == PNG_INTERLACED) {
+ if ( (flags & PNG_INTERLACED) == PNG_INTERLACED) {
interlace_type = PNG_INTERLACE_ADAM7;
bInterlaced = TRUE;
} else {
@@ -735,9 +735,9 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
// set the ZLIB compression level or default to PNG default compression level (ZLIB level = 6)
int zlib_level = flags & 0x0F;
- if((zlib_level >= 1) && (zlib_level <= 9)) {
+ if ((zlib_level >= 1) && (zlib_level <= 9)) {
png_set_compression_level(png_ptr, zlib_level);
- } else if((flags & PNG_Z_NO_COMPRESSION) == PNG_Z_NO_COMPRESSION) {
+ } else if ((flags & PNG_Z_NO_COMPRESSION) == PNG_Z_NO_COMPRESSION) {
png_set_compression_level(png_ptr, Z_NO_COMPRESSION);
}
diff --git a/plugins/FreeImage/Source/FreeImage/PluginPNM.cpp b/plugins/FreeImage/Source/FreeImage/PluginPNM.cpp
index 3155315559..a30f858851 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginPNM.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginPNM.cpp
@@ -37,7 +37,7 @@ GetInt(FreeImageIO *io, fi_handle handle) {
// skip forward to start of next number
- if(!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
+ if (!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
while (1) {
// eat comments
@@ -48,7 +48,7 @@ GetInt(FreeImageIO *io, fi_handle handle) {
firstchar = TRUE;
while (1) {
- if(!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
+ if (!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
if (firstchar && c == ' ') {
// loop off 1 sp after #
@@ -66,7 +66,7 @@ GetInt(FreeImageIO *io, fi_handle handle) {
break;
}
- if(!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
+ if (!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
}
// we're at the start of a number, continue until we hit a non-number
@@ -76,7 +76,7 @@ GetInt(FreeImageIO *io, fi_handle handle) {
while (1) {
i = (i * 10) + (c - '0');
- if(!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
+ if (!io->read_proc(&c, 1, 1, handle)) throw FI_MSG_ERROR_PARSING;
if (c < '0' || c > '9')
break;
@@ -239,9 +239,9 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
int height = GetInt(io, handle);
int maxval = 1;
- if((id_two == '2') || (id_two == '5') || (id_two == '3') || (id_two == '6')) {
+ if ((id_two == '2') || (id_two == '5') || (id_two == '3') || (id_two == '6')) {
maxval = GetInt(io, handle);
- if((maxval <= 0) || (maxval > 65535)) {
+ if ((maxval <= 0) || (maxval > 65535)) {
FreeImage_OutputMessageProc(s_format_id, "Invalid max value : %d", maxval);
throw (const char*)NULL;
}
@@ -539,7 +539,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
char buffer[256]; // temporary buffer whose size should be enough for what we need
- if(!dib || !handle) return FALSE;
+ if (!dib || !handle) return FALSE;
FREE_IMAGE_TYPE image_type = FreeImage_GetImageType(dib);
diff --git a/plugins/FreeImage/Source/FreeImage/PluginRAS.cpp b/plugins/FreeImage/Source/FreeImage/PluginRAS.cpp
index 08fd558450..08fc0c9e17 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginRAS.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginRAS.cpp
@@ -203,7 +203,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
BYTE *bits; // Pointer to dib data
WORD x, y;
- if(!handle) {
+ if (!handle) {
return NULL;
}
@@ -309,7 +309,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// Read SUN raster colormap
int numcolors = 1 << header.depth;
- if((DWORD)(3 * numcolors) > header.maplength) {
+ if ((DWORD)(3 * numcolors) > header.maplength) {
// some RAS may have less colors than the full palette
numcolors = header.maplength / 3;
} else {
diff --git a/plugins/FreeImage/Source/FreeImage/PluginRAW.cpp b/plugins/FreeImage/Source/FreeImage/PluginRAW.cpp
index 2229cbb20b..4611824f4d 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginRAW.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginRAW.cpp
@@ -79,14 +79,14 @@ public:
virtual int get_char() {
int c = 0;
if(substream) return substream->get_char();
- if(!_io->read_proc(&c, 1, 1, _handle)) return -1;
+ if (!_io->read_proc(&c, 1, 1, _handle)) return -1;
return c;
}
virtual char* gets(char *buffer, int length) {
if (substream) return substream->gets(buffer, length);
memset(buffer, 0, length);
for(int i = 0; i < length; i++) {
- if(!_io->read_proc(&buffer[i], 1, 1, _handle))
+ if (!_io->read_proc(&buffer[i], 1, 1, _handle))
return NULL;
if(buffer[i] == 0x0A)
break;
@@ -137,7 +137,7 @@ libraw_ConvertToDib(libraw_processed_image_t *image) {
if(bpp == 16) {
// allocate output dib
dib = FreeImage_AllocateT(FIT_RGB16, width, height);
- if(!dib) {
+ if (!dib) {
throw FI_MSG_ERROR_DIB_MEMORY;
}
// write data
@@ -154,7 +154,7 @@ libraw_ConvertToDib(libraw_processed_image_t *image) {
} else if(bpp == 8) {
// allocate output dib
dib = FreeImage_AllocateT(FIT_BITMAP, width, height, 24);
- if(!dib) {
+ if (!dib) {
throw FI_MSG_ERROR_DIB_MEMORY;
}
// write data
@@ -468,15 +468,15 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// header only mode
dib = FreeImage_AllocateHeaderT(header_only, FIT_RGB16, RawProcessor.imgdata.sizes.width, RawProcessor.imgdata.sizes.height);
}
- else if((flags & RAW_PREVIEW) == RAW_PREVIEW) {
+ else if ((flags & RAW_PREVIEW) == RAW_PREVIEW) {
// try to get the embedded JPEG
dib = libraw_LoadEmbeddedPreview(RawProcessor, 0);
- if(!dib) {
+ if (!dib) {
// no JPEG preview: try to load as 8-bit/sample (i.e. RGB 24-bit)
dib = libraw_LoadRawData(RawProcessor, 8);
}
}
- else if((flags & RAW_DISPLAY) == RAW_DISPLAY) {
+ else if ((flags & RAW_DISPLAY) == RAW_DISPLAY) {
// load raw data as 8-bit/sample (i.e. RGB 24-bit)
dib = libraw_LoadRawData(RawProcessor, 8);
}
diff --git a/plugins/FreeImage/Source/FreeImage/PluginSGI.cpp b/plugins/FreeImage/Source/FreeImage/PluginSGI.cpp
index 0fd162b1d4..3ac189e0ef 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginSGI.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginSGI.cpp
@@ -265,7 +265,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// read the Offset Tables
int index_len = height * zsize;
pRowIndex = (LONG*)malloc(index_len * sizeof(LONG));
- if(!pRowIndex) {
+ if (!pRowIndex) {
throw FI_MSG_ERROR_MEMORY;
}
@@ -282,7 +282,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// Discard row size index
for (i = 0; i < (int)(index_len * sizeof(LONG)); i++) {
BYTE packed = 0;
- if( io->read_proc(&packed, sizeof(BYTE), 1, handle) < 1 ) {
+ if ( io->read_proc(&packed, sizeof(BYTE), 1, handle) < 1 ) {
throw SGI_EOF_IN_RLE_INDEX;
}
}
@@ -307,7 +307,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
}
dib = FreeImage_Allocate(width, height, bitcount);
- if(!dib) {
+ if (!dib) {
throw FI_MSG_ERROR_DIB_MEMORY;
}
diff --git a/plugins/FreeImage/Source/FreeImage/PluginTARGA.cpp b/plugins/FreeImage/Source/FreeImage/PluginTARGA.cpp
index 5fb1f53ee0..4e3f1a720a 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginTARGA.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginTARGA.cpp
@@ -176,7 +176,7 @@ FIBITMAP* TargaThumbnail::toFIBITMAP() {
const unsigned line_size = _depth * _w / 8;
FIBITMAP* dib = FreeImage_Allocate(_w, _h, _depth);
- if(!dib) {
+ if (!dib) {
return NULL;
}
@@ -1203,14 +1203,14 @@ saveRLE(FIBITMAP* dib, FreeImageIO* io, fi_handle handle) {
// read next pixel from dib
- if( x + 1*pixel_size < line_size) {
+ if ( x + 1*pixel_size < line_size) {
AssignPixel(next, (bits + x + 1*pixel_size), pixel_size);
} else {
// last pixel in line
// include current pixel and flush
- if(!has_rle) {
+ if (!has_rle) {
writeToPacket(packet, current, pixel_size);
packet += pixel_size;
@@ -1231,7 +1231,7 @@ saveRLE(FIBITMAP* dib, FreeImageIO* io, fi_handle handle) {
// has rle
- if(!has_rle) {
+ if (!has_rle) {
// flush non rle packet
flushPacket(line, pixel_size, packet_begin, packet, packet_count, has_rle);
diff --git a/plugins/FreeImage/Source/FreeImage/PluginTIFF.cpp b/plugins/FreeImage/Source/FreeImage/PluginTIFF.cpp
index d5db9574da..54f81e0938 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginTIFF.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginTIFF.cpp
@@ -450,7 +450,7 @@ static FIBITMAP*
CreateImageType(BOOL header_only, FREE_IMAGE_TYPE fit, int width, int height, uint16 bitspersample, uint16 samplesperpixel) {
FIBITMAP *dib = NULL;
- if((width < 0) || (height < 0)) {
+ if ((width < 0) || (height < 0)) {
// check for malicious images
return NULL;
}
@@ -462,7 +462,7 @@ CreateImageType(BOOL header_only, FREE_IMAGE_TYPE fit, int width, int height, ui
if(bpp == 16) {
- if((samplesperpixel == 2) && (bitspersample == 8)) {
+ if ((samplesperpixel == 2) && (bitspersample == 8)) {
// 8-bit indexed + 8-bit alpha channel -> convert to 8-bit transparent
dib = FreeImage_AllocateHeader(header_only, width, height, 8);
} else {
@@ -562,7 +562,7 @@ ReadImageType(TIFF *tiff, uint16 bitspersample, uint16 samplesperpixel) {
break;
case 48:
// 3 x half float => convert to RGBF
- if((samplesperpixel == 3) && (bitspersample == 16)) {
+ if ((samplesperpixel == 3) && (bitspersample == 16)) {
fit = FIT_RGBF;
}
break;
@@ -683,7 +683,7 @@ WriteCompression(TIFF *tiff, uint16 bitspersample, uint16 samplesperpixel, uint1
} else if ((flags & TIFF_LZW) == TIFF_LZW) {
compression = COMPRESSION_LZW;
} else if ((flags & TIFF_JPEG) == TIFF_JPEG) {
- if(((bitsperpixel == 8) && (photometric != PHOTOMETRIC_PALETTE)) || (bitsperpixel == 24)) {
+ if (((bitsperpixel == 8) && (photometric != PHOTOMETRIC_PALETTE)) || (bitsperpixel == 24)) {
compression = COMPRESSION_JPEG;
// RowsPerStrip must be multiple of 8 for JPEG
uint32 rowsperstrip = (uint32) -1;
@@ -736,7 +736,7 @@ WriteCompression(TIFF *tiff, uint16 bitspersample, uint16 samplesperpixel, uint1
// and many palette-color images. But natural 24-bit color images and some 8-bit
// grayscale images do much better with differencing.
- if((bitspersample == 8) || (bitspersample == 16)) {
+ if ((bitspersample == 8) || (bitspersample == 16)) {
if ((bitsperpixel >= 8) && (photometric != PHOTOMETRIC_PALETTE)) {
TIFFSetField(tiff, TIFFTAG_PREDICTOR, 2);
} else {
@@ -793,7 +793,7 @@ tiff_read_xmp_profile(TIFF *tiff, FIBITMAP *dib) {
if (TIFFGetField(tiff, TIFFTAG_XMLPACKET, &profile_size, &profile) == 1) {
// create a tag
FITAG *tag = FreeImage_CreateTag();
- if(!tag) return FALSE;
+ if (!tag) return FALSE;
FreeImage_SetTagID(tag, TIFFTAG_XMLPACKET); // 700
FreeImage_SetTagKey(tag, g_TagLib_XMPFieldName);
@@ -832,7 +832,7 @@ tiff_read_exif_profile(TIFF *tiff, FIBITMAP *dib) {
if(TIFFGetField(tiff, TIFFTAG_EXIFIFD, &exif_offset)) {
// read EXIF tags
- if(!TIFFReadEXIFDirectory(tiff, exif_offset)) {
+ if (!TIFFReadEXIFDirectory(tiff, exif_offset)) {
return FALSE;
}
@@ -877,7 +877,7 @@ tiff_write_iptc_profile(TIFF *tiff, FIBITMAP *dib) {
uint32 iptc_size = profile_size;
iptc_size += (4-(iptc_size & 0x03)); // Round up for long word alignment
BYTE *iptc_profile = (BYTE*)malloc(iptc_size);
- if(!iptc_profile) {
+ if (!iptc_profile) {
free(profile);
return FALSE;
}
@@ -1046,7 +1046,7 @@ static void * DLL_CALLCONV
Open(FreeImageIO *io, fi_handle handle, BOOL read) {
// wrapper for TIFF I/O
fi_TIFFIO *fio = (fi_TIFFIO*)malloc(sizeof(fi_TIFFIO));
- if(!fio) return NULL;
+ if (!fio) return NULL;
fio->io = io;
fio->handle = handle;
@@ -1106,7 +1106,7 @@ IsValidBitsPerSample(uint16 photometric, uint16 bitspersample, uint16 samplesper
switch(bitspersample) {
case 1:
case 4:
- if((photometric == PHOTOMETRIC_MINISWHITE) || (photometric == PHOTOMETRIC_MINISBLACK) || (photometric == PHOTOMETRIC_PALETTE)) {
+ if ((photometric == PHOTOMETRIC_MINISWHITE) || (photometric == PHOTOMETRIC_MINISBLACK) || (photometric == PHOTOMETRIC_PALETTE)) {
return TRUE;
} else {
return FALSE;
@@ -1155,12 +1155,12 @@ FindLoadMethod(TIFF *tif, FREE_IMAGE_TYPE image_type, int flags) {
switch(photometric) {
// convert to 24 or 32 bits RGB if the image is full color
case PHOTOMETRIC_RGB:
- if((image_type == FIT_RGB16) || (image_type == FIT_RGBA16)) {
+ if ((image_type == FIT_RGB16) || (image_type == FIT_RGBA16)) {
// load 48-bit RGB and 64-bit RGBA without conversion
loadMethod = LoadAsGenericStrip;
}
else if(image_type == FIT_RGBF) {
- if((samplesperpixel == 3) && (bitspersample == 16)) {
+ if ((samplesperpixel == 3) && (bitspersample == 16)) {
// load 3 x 16-bit half as RGBF
loadMethod = LoadAsHalfFloat;
}
@@ -1182,7 +1182,7 @@ FindLoadMethod(TIFF *tif, FREE_IMAGE_TYPE image_type, int flags) {
// to avoid multiple conversions. Conversion can be done by changing
// the profile from it's original CMYK to an RGB profile with an
// apropriate color management system. Works with non-tiled TIFFs.
- if(!bIsTiled) {
+ if (!bIsTiled) {
loadMethod = LoadAsCMYK;
}
break;
@@ -1192,7 +1192,7 @@ FindLoadMethod(TIFF *tif, FREE_IMAGE_TYPE image_type, int flags) {
// When samplesperpixel = 2 and bitspersample = 8, set the image as a
// 8-bit indexed image + 8-bit alpha layer image
// and convert to a 8-bit image with a transparency table
- if((samplesperpixel > 1) && (bitspersample == 8)) {
+ if ((samplesperpixel > 1) && (bitspersample == 8)) {
loadMethod = LoadAs8BitTrns;
} else {
loadMethod = LoadAsGenericStrip;
@@ -1203,7 +1203,7 @@ FindLoadMethod(TIFF *tif, FREE_IMAGE_TYPE image_type, int flags) {
break;
}
- if((loadMethod == LoadAsGenericStrip) && bIsTiled) {
+ if ((loadMethod == LoadAsGenericStrip) && bIsTiled) {
loadMethod = LoadAsTiled;
}
@@ -1249,7 +1249,7 @@ ReadThumbnail(FreeImageIO *io, fi_handle handle, void *data, TIFF *tiff, FIBITMA
// ... or read the first subIFD
- if(!thumbnail) {
+ if (!thumbnail) {
uint16 subIFD_count = 0;
uint64* subIFD_offsets = NULL;
// ### Theoretically this should also read the first subIFD from a Photoshop-created file with "pyramid".
@@ -1276,7 +1276,7 @@ ReadThumbnail(FreeImageIO *io, fi_handle handle, void *data, TIFF *tiff, FIBITMA
// ... or read Photoshop thumbnail
- if(!thumbnail) {
+ if (!thumbnail) {
uint32 ps_size = 0;
void *ps_data = NULL;
@@ -1399,7 +1399,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
uint32 *raster = NULL;
- if(!header_only) {
+ if (!header_only) {
raster = (uint32*)_TIFFmalloc(width * height * sizeof(uint32));
if (raster == NULL) {
@@ -1443,7 +1443,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
ReadResolution(tif, dib);
- if(!header_only) {
+ if (!header_only) {
// read the raster lines and save them in the DIB
// with RGB mode, we have to change the order of the 3 samples RGB
@@ -1636,7 +1636,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
alpha = FreeImage_Allocate(width, height, 8);
}
- if(!alpha) {
+ if (!alpha) {
FreeImage_OutputMessageProc(s_format_id, "Failed to allocate temporary alpha channel");
} else {
alpha_bits = FreeImage_GetScanLine(alpha, height - 1);
@@ -1658,7 +1658,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
ReadResolution(tif, dib);
- if(!header_only) {
+ if (!header_only) {
// calculate the line + pitch (separate for scr & dest)
@@ -1706,7 +1706,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
for(BYTE *pixel = bits, *al_pixel = alpha_bits, *src_pixel = buf + l * src_line; pixel < bits + dib_pitch; pixel += dibBpp, al_pixel += alpha_Bpp, src_pixel += srcBpp) {
// copy pixel byte by byte
BYTE b = 0;
- for( ; b < dibBpp; ++b) {
+ for ( ; b < dibBpp; ++b) {
pixel[b] = src_pixel[b];
}
// TODO write the remaining bytes to extra channel(s)
@@ -1814,7 +1814,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
free(buf);
- if(!asCMYK) {
+ if (!asCMYK) {
ConvertCMYKtoRGBA(dib);
// The ICC Profile is invalid, clear it
@@ -1862,7 +1862,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
ReadPalette(tif, photometric, bitspersample, dib);
- if(!header_only) {
+ if (!header_only) {
// calculate the line + pitch (separate for scr & dest)
const tmsize_t src_line = TIFFScanlineSize(tif);
@@ -2000,7 +2000,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
ReadPalette(tif, photometric, bitspersample, dib);
// get the tile geometry
- if(!TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tileWidth) || !TIFFGetField(tif, TIFFTAG_TILELENGTH, &tileHeight)) {
+ if (!TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tileWidth) || !TIFFGetField(tif, TIFFTAG_TILELENGTH, &tileHeight)) {
throw "Invalid tiled TIFF image";
}
@@ -2142,7 +2142,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
ReadResolution(tif, dib);
- if(!header_only) {
+ if (!header_only) {
// calculate the line + pitch (separate for scr & dest)
@@ -2268,7 +2268,7 @@ SaveOneTIFF(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flag
bitspersample = bitsperpixel / samplesperpixel;
photometric = GetPhotometric(dib);
- if((bitsperpixel == 8) && FreeImage_IsTransparent(dib)) {
+ if ((bitsperpixel == 8) && FreeImage_IsTransparent(dib)) {
// 8-bit transparent picture : convert later to 8-bit + 8-bit alpha
samplesperpixel = 2;
bitspersample = 8;
@@ -2276,7 +2276,7 @@ SaveOneTIFF(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flag
else if(bitsperpixel == 32) {
// 32-bit images : check for CMYK or alpha transparency
- if((((iccProfile->flags & FIICC_COLOR_IS_CMYK) == FIICC_COLOR_IS_CMYK) || ((flags & TIFF_CMYK) == TIFF_CMYK))) {
+ if ((((iccProfile->flags & FIICC_COLOR_IS_CMYK) == FIICC_COLOR_IS_CMYK) || ((flags & TIFF_CMYK) == TIFF_CMYK))) {
// CMYK support
photometric = PHOTOMETRIC_SEPARATED;
TIFFSetField(out, TIFFTAG_INKSET, INKSET_CMYK);
@@ -2301,7 +2301,7 @@ SaveOneTIFF(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flag
samplesperpixel = 4;
bitspersample = bitsperpixel / samplesperpixel;
- if((((iccProfile->flags & FIICC_COLOR_IS_CMYK) == FIICC_COLOR_IS_CMYK) || ((flags & TIFF_CMYK) == TIFF_CMYK))) {
+ if ((((iccProfile->flags & FIICC_COLOR_IS_CMYK) == FIICC_COLOR_IS_CMYK) || ((flags & TIFF_CMYK) == TIFF_CMYK))) {
// CMYK support
photometric = PHOTOMETRIC_SEPARATED;
TIFFSetField(out, TIFFTAG_INKSET, INKSET_CMYK);
@@ -2321,7 +2321,7 @@ SaveOneTIFF(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flag
samplesperpixel = 3;
bitspersample = bitsperpixel / samplesperpixel;
// the library converts to and from floating-point XYZ CIE values
- if((flags & TIFF_LOGLUV) == TIFF_LOGLUV) {
+ if ((flags & TIFF_LOGLUV) == TIFF_LOGLUV) {
photometric = PHOTOMETRIC_LOGLUV;
TIFFSetField(out, TIFFTAG_SGILOGDATAFMT, SGILOGDATAFMT_FLOAT);
// TIFFSetField(out, TIFFTAG_STONITS, 1.0); // assume unknown
@@ -2421,7 +2421,7 @@ SaveOneTIFF(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flag
// thumbnail tag
- if((ifd == 0) && (ifdCount > 1)) {
+ if ((ifd == 0) && (ifdCount > 1)) {
uint16 nsubifd = 1;
uint64 subifd[1];
subifd[0] = 0;
@@ -2442,7 +2442,7 @@ SaveOneTIFF(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flag
case 4 :
case 8 :
{
- if((bitsperpixel == 8) && FreeImage_IsTransparent(dib)) {
+ if ((bitsperpixel == 8) && FreeImage_IsTransparent(dib)) {
// 8-bit transparent picture : convert to 8-bit + 8-bit alpha
// get the transparency table
@@ -2564,7 +2564,7 @@ SaveOneTIFF(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flag
// write out the directory tag if we wrote a page other than -1 or if we have a thumbnail to write later
- if( (page >= 0) || ((ifd == 0) && (ifdCount > 1)) ) {
+ if ( (page >= 0) || ((ifd == 0) && (ifdCount > 1)) ) {
TIFFWriteDirectory(out);
// else: TIFFClose will WriteDirectory
}
@@ -2594,7 +2594,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
}
bResult = SaveOneTIFF(io, bitmap, handle, page, flags, data, ifd, ifdCount);
- if(!bResult) {
+ if (!bResult) {
return FALSE;
}
}
diff --git a/plugins/FreeImage/Source/FreeImage/PluginXBM.cpp b/plugins/FreeImage/Source/FreeImage/PluginXBM.cpp
index 0aac48ca27..140029e862 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginXBM.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginXBM.cpp
@@ -109,14 +109,14 @@ readXBMFile(FreeImageIO *io, fi_handle handle, int *widthP, int *heightP, char *
while(!found_declaration && !eof) {
- if( readLine(line, MAX_LINE, io, handle) == NULL) {
+ if ( readLine(line, MAX_LINE, io, handle) == NULL) {
eof = TRUE;
}
else {
- if( strlen( line ) == MAX_LINE - 1 )
+ if ( strlen( line ) == MAX_LINE - 1 )
return( ERR_XBM_LINE );
- if( sscanf(line, "#define %s %d", name_and_type, &v) == 2 ) {
- if( ( t = strrchr( name_and_type, '_' ) ) == NULL )
+ if ( sscanf(line, "#define %s %d", name_and_type, &v) == 2 ) {
+ if ( ( t = strrchr( name_and_type, '_' ) ) == NULL )
t = name_and_type;
else
t++;
@@ -127,11 +127,11 @@ readXBMFile(FreeImageIO *io, fi_handle handle, int *widthP, int *heightP, char *
continue;
}
- if( sscanf( line, "static short %s = {", name_and_type ) == 1 ) {
+ if ( sscanf( line, "static short %s = {", name_and_type ) == 1 ) {
version = 10;
found_declaration = TRUE;
}
- else if( sscanf( line, "static char %s = {", name_and_type ) == 1 ) {
+ else if ( sscanf( line, "static char %s = {", name_and_type ) == 1 ) {
version = 11;
found_declaration = TRUE;
}
@@ -142,12 +142,12 @@ readXBMFile(FreeImageIO *io, fi_handle handle, int *widthP, int *heightP, char *
}
}
- if(!found_declaration)
+ if (!found_declaration)
return( ERR_XBM_DECL );
- if(*widthP == -1 )
+ if (*widthP == -1 )
return( ERR_XBM_WIDTH );
- if( *heightP == -1 )
+ if ( *heightP == -1 )
return( ERR_XBM_HEIGHT );
padding = 0;
@@ -189,7 +189,7 @@ readXBMFile(FreeImageIO *io, fi_handle handle, int *widthP, int *heightP, char *
hex_table['f'] = 15;
if(version == 10) {
- for( bytes = 0, ptr = *dataP; bytes < raster_length; bytes += 2 ) {
+ for ( bytes = 0, ptr = *dataP; bytes < raster_length; bytes += 2 ) {
while( ( c1 = readChar(io, handle) ) != 'x' ) {
if ( c1 == EOF )
return( ERR_XBM_EOFREAD );
@@ -197,14 +197,14 @@ readXBMFile(FreeImageIO *io, fi_handle handle, int *widthP, int *heightP, char *
c1 = readChar(io, handle);
c2 = readChar(io, handle);
- if( c1 == EOF || c2 == EOF )
+ if ( c1 == EOF || c2 == EOF )
return( ERR_XBM_EOFREAD );
value1 = ( hex_table[c1] << 4 ) + hex_table[c2];
if ( value1 >= 256 )
return( ERR_XBM_SYNTAX );
c1 = readChar(io, handle);
c2 = readChar(io, handle);
- if( c1 == EOF || c2 == EOF )
+ if ( c1 == EOF || c2 == EOF )
return( ERR_XBM_EOFREAD );
value2 = ( hex_table[c1] << 4 ) + hex_table[c2];
if ( value2 >= 256 )
@@ -219,7 +219,7 @@ readXBMFile(FreeImageIO *io, fi_handle handle, int *widthP, int *heightP, char *
/*
** skip until digit is found
*/
- for( ; ; ) {
+ for ( ; ; ) {
c1 = readChar(io, handle);
if ( c1 == EOF )
return( ERR_XBM_EOFREAD );
@@ -230,7 +230,7 @@ readXBMFile(FreeImageIO *io, fi_handle handle, int *widthP, int *heightP, char *
/*
** loop on digits
*/
- for( ; ; ) {
+ for ( ; ; ) {
c2 = readChar(io, handle);
if ( c2 == EOF )
return( ERR_XBM_EOFREAD );
@@ -327,7 +327,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// allocate a new dib
dib = FreeImage_Allocate(width, height, 1);
- if(!dib) throw (char*)ERR_XBM_MEMORY;
+ if (!dib) throw (char*)ERR_XBM_MEMORY;
// write the palette data
RGBQUAD *pal = FreeImage_GetPalette(dib);
@@ -347,7 +347,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
count = 0;
mask = 1;
}
- if(*bP & mask) {
+ if (*bP & mask) {
// Set bit(x, y) to 0
bits[x >> 3] &= (0xFF7F >> (x & 0x7));
} else {
diff --git a/plugins/FreeImage/Source/FreeImage/PluginXPM.cpp b/plugins/FreeImage/Source/FreeImage/PluginXPM.cpp
index a698321958..16db443c47 100644
--- a/plugins/FreeImage/Source/FreeImage/PluginXPM.cpp
+++ b/plugins/FreeImage/Source/FreeImage/PluginXPM.cpp
@@ -53,7 +53,7 @@ FindChar(FreeImageIO *io, fi_handle handle, BYTE look_for) {
BYTE c;
io->read_proc(&c, sizeof(BYTE), 1, handle);
while(c != look_for) {
- if( io->read_proc(&c, sizeof(BYTE), 1, handle) != 1 )
+ if ( io->read_proc(&c, sizeof(BYTE), 1, handle) != 1 )
return FALSE;
}
return TRUE;
@@ -62,14 +62,14 @@ FindChar(FreeImageIO *io, fi_handle handle, BYTE look_for) {
// find start of string, read data until ending quote found, allocate memory and return a string
static char *
ReadString(FreeImageIO *io, fi_handle handle) {
- if( !FindChar(io, handle,'"') )
+ if ( !FindChar(io, handle,'"') )
return NULL;
BYTE c;
std::string s;
io->read_proc(&c, sizeof(BYTE), 1, handle);
while(c != '"') {
s += c;
- if( io->read_proc(&c, sizeof(BYTE), 1, handle) != 1 )
+ if ( io->read_proc(&c, sizeof(BYTE), 1, handle) != 1 )
return NULL;
}
char *cstr = (char *)malloc(s.length()+1);
@@ -166,16 +166,16 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
BOOL header_only = (flags & FIF_LOAD_NOPIXELS) == FIF_LOAD_NOPIXELS;
//find the starting brace
- if( !FindChar(io, handle,'{') )
+ if ( !FindChar(io, handle,'{') )
throw "Could not find starting brace";
//read info string
str = ReadString(io, handle);
- if(!str)
+ if (!str)
throw "Error reading info string";
int width, height, colors, cpp;
- if( sscanf(str, "%d %d %d %d", &width, &height, &colors, &cpp) != 4 ) {
+ if ( sscanf(str, "%d %d %d %d", &width, &height, &colors, &cpp) != 4 ) {
free(str);
throw "Improperly formed info string";
}
@@ -193,7 +193,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
FILE_RGBA rgba;
str = ReadString(io, handle);
- if(!str)
+ if (!str)
throw "Error reading color strings";
std::string chrs(str,cpp); //create a string for the color chars using the first cpp chars
@@ -207,14 +207,14 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
}
//prefer the color visual
- if( strstr(keys," c ") ) {
+ if ( strstr(keys," c ") ) {
char *clr = strstr(keys," c ") + 3;
while( *clr == ' ' ) clr++; //find the start of the hex rgb value
- if( *clr == '#' ) {
+ if ( *clr == '#' ) {
int red = 0, green = 0, blue = 0, n;
clr++;
//end string at first space, if any found
- if( strchr(clr,' ') )
+ if ( strchr(clr,' ') )
*(strchr(clr,' ')) = '\0';
//parse hex color, it can be #rgb #rrggbb #rrrgggbbb or #rrrrggggbbbb
switch( strlen(clr) ) {
@@ -239,14 +239,14 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
n = 0;
break;
}
- if( n != 3 ) {
+ if ( n != 3 ) {
free(str);
throw "Improperly formed hex color value";
}
rgba.r = (BYTE)red;
rgba.g = (BYTE)green;
rgba.b = (BYTE)blue;
- } else if( !strncmp(clr,"None",4) || !strncmp(clr,"none",4) ) {
+ } else if ( !strncmp(clr,"None",4) || !strncmp(clr,"none",4) ) {
rgba.r = rgba.g = rgba.b = 0xFF;
} else {
char *tmp = clr;
@@ -256,8 +256,8 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
//part of the color name. How many named color end with a 1 or 2 character
//word? Probably none in our list at least.
while( (tmp = strchr(tmp,' ')) != NULL ) {
- if( tmp[1] != ' ' ) {
- if( (tmp[2] == ' ') || (tmp[2] != ' ' && tmp[3] == ' ') ) {
+ if ( tmp[1] != ' ' ) {
+ if ( (tmp[2] == ' ') || (tmp[2] != ' ' && tmp[3] == ' ') ) {
tmp[0] = '\0';
break;
}
@@ -288,7 +288,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
rawpal[chrs] = rgba;
//build palette if needed
- if( colors <= 256 ) {
+ if ( colors <= 256 ) {
RGBQUAD *pal = FreeImage_GetPalette(dib);
pal[i].rgbBlue = rgba.b;
pal[i].rgbGreen = rgba.g;
@@ -308,7 +308,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
for(int y = 0; y < height; y++ ) {
BYTE *line = FreeImage_GetScanLine(dib, height - y - 1);
str = ReadString(io, handle);
- if(!str)
+ if (!str)
throw "Error reading pixel strings";
char *pixel_ptr = str;
@@ -317,7 +317,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
std::string chrs(pixel_ptr,cpp);
FILE_RGBA rgba = rawpal[chrs];
- if( colors > 256 ) {
+ if ( colors > 256 ) {
line[FI_RGBA_BLUE] = rgba.b;
line[FI_RGBA_GREEN] = rgba.g;
line[FI_RGBA_RED] = rgba.r;
@@ -338,7 +338,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
} catch(const char *text) {
FreeImage_OutputMessageProc(s_format_id, text);
- if( dib != NULL )
+ if ( dib != NULL )
FreeImage_Unload(dib);
return NULL;
@@ -355,7 +355,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
footer[] = "\"\n};\n",
buf[256]; //256 is more then enough to sprintf 4 ints into, or the base-92 chars and #rrggbb line
- if( io->write_proc(header, (unsigned int)strlen(header), 1, handle) != 1 )
+ if ( io->write_proc(header, (unsigned int)strlen(header), 1, handle) != 1 )
return FALSE;
int width = FreeImage_GetWidth(dib), height = FreeImage_GetHeight(dib), bpp = FreeImage_GetBPP(dib);
@@ -378,7 +378,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
for(x = 0; x < width; x++ ) {
FILE_RGB rgb;
DWORDRGBA u;
- if( bpp > 8 ) {
+ if ( bpp > 8 ) {
u.rgba.b = rgb.b = line[FI_RGBA_BLUE];
u.rgba.g = rgb.g = line[FI_RGBA_GREEN];
u.rgba.r = rgb.r = line[FI_RGBA_RED];
@@ -391,7 +391,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
rgb.r = pal[u.index].rgbRed;
line++;
}
- if( color2chrs.find(u.index) == color2chrs.end() ) { //new color
+ if ( color2chrs.find(u.index) == color2chrs.end() ) { //new color
std::string chrs(Base92(num_colors));
color2chrs[u.index] = chrs;
chrs2color[num_colors] = rgb;
@@ -403,22 +403,22 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
int cpp = (int)(log((double)num_colors)/log(92.0)) + 1;
sprintf(buf, "%d %d %d %d", FreeImage_GetWidth(dib), FreeImage_GetHeight(dib), num_colors, cpp );
- if( io->write_proc(buf, (unsigned int)strlen(buf), 1, handle) != 1 )
+ if ( io->write_proc(buf, (unsigned int)strlen(buf), 1, handle) != 1 )
return FALSE;
- if( io->write_proc(start_colors, (unsigned int)strlen(start_colors), 1, handle) != 1 )
+ if ( io->write_proc(start_colors, (unsigned int)strlen(start_colors), 1, handle) != 1 )
return FALSE;
//write colors, using map of chrs->rgb
for(x = 0; x < num_colors; x++ ) {
sprintf(buf, "%*s c #%02x%02x%02x", cpp, Base92(x), chrs2color[x].r, chrs2color[x].g, chrs2color[x].b );
- if( io->write_proc(buf, (unsigned int)strlen(buf), 1, handle) != 1 )
+ if ( io->write_proc(buf, (unsigned int)strlen(buf), 1, handle) != 1 )
return FALSE;
- if( x == num_colors - 1 ) {
- if( io->write_proc(start_pixels, (unsigned int)strlen(start_pixels), 1, handle) != 1 )
+ if ( x == num_colors - 1 ) {
+ if ( io->write_proc(start_pixels, (unsigned int)strlen(start_pixels), 1, handle) != 1 )
return FALSE;
} else {
- if( io->write_proc(new_line, (unsigned int)strlen(new_line), 1, handle) != 1 )
+ if ( io->write_proc(new_line, (unsigned int)strlen(new_line), 1, handle) != 1 )
return FALSE;
}
}
@@ -429,7 +429,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
BYTE *line = FreeImage_GetScanLine(dib, height - y - 1);
for(x = 0; x < width; x++ ) {
DWORDRGBA u;
- if( bpp > 8 ) {
+ if ( bpp > 8 ) {
u.rgba.b = line[FI_RGBA_BLUE];
u.rgba.g = line[FI_RGBA_GREEN];
u.rgba.r = line[FI_RGBA_RED];
@@ -440,14 +440,14 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
line++;
}
sprintf(buf, "%*s", cpp, (char *)color2chrs[u.index].c_str());
- if( io->write_proc(buf, cpp, 1, handle) != 1 )
+ if ( io->write_proc(buf, cpp, 1, handle) != 1 )
return FALSE;
}
- if( y == height - 1 ) {
- if( io->write_proc(footer, (unsigned int)strlen(footer), 1, handle) != 1 )
+ if ( y == height - 1 ) {
+ if ( io->write_proc(footer, (unsigned int)strlen(footer), 1, handle) != 1 )
return FALSE;
} else {
- if( io->write_proc(new_line, (unsigned int)strlen(new_line), 1, handle) != 1 )
+ if ( io->write_proc(new_line, (unsigned int)strlen(new_line), 1, handle) != 1 )
return FALSE;
}
}
diff --git a/plugins/FreeImage/Source/FreeImage/ToneMapping.cpp b/plugins/FreeImage/Source/FreeImage/ToneMapping.cpp
index 27f8c95a07..33ae08ea59 100644
--- a/plugins/FreeImage/Source/FreeImage/ToneMapping.cpp
+++ b/plugins/FreeImage/Source/FreeImage/ToneMapping.cpp
@@ -38,7 +38,7 @@ FreeImage_ToneMapping(FIBITMAP *dib, FREE_IMAGE_TMO tmo, double first_param, dou
switch(tmo) {
// Adaptive logarithmic mapping (F. Drago, 2003)
case FITMO_DRAGO03:
- if((first_param == 0) && (second_param == 0)) {
+ if ((first_param == 0) && (second_param == 0)) {
// use default values (gamma = 2.2, exposure = 0)
return FreeImage_TmoDrago03(dib, 2.2, 0);
} else {
@@ -48,7 +48,7 @@ FreeImage_ToneMapping(FIBITMAP *dib, FREE_IMAGE_TMO tmo, double first_param, dou
break;
// Dynamic range reduction inspired by photoreceptor phhysiology (E. Reinhard, 2005)
case FITMO_REINHARD05:
- if((first_param == 0) && (second_param == 0)) {
+ if ((first_param == 0) && (second_param == 0)) {
// use default values by setting intensity to 0 and contrast to 0
return FreeImage_TmoReinhard05(dib, 0, 0);
} else {
@@ -58,7 +58,7 @@ FreeImage_ToneMapping(FIBITMAP *dib, FREE_IMAGE_TMO tmo, double first_param, dou
break;
// Gradient Domain HDR Compression (R. Fattal, 2002)
case FITMO_FATTAL02:
- if((first_param == 0) && (second_param == 0)) {
+ if ((first_param == 0) && (second_param == 0)) {
// use default values by setting color saturation to 0.5 and attenuation to 0.85
return FreeImage_TmoFattal02(dib, 0.5, 0.85);
} else {
diff --git a/plugins/FreeImage/Source/FreeImage/WuQuantizer.cpp b/plugins/FreeImage/Source/FreeImage/WuQuantizer.cpp
index 041eae368b..532fbfc3e6 100644
--- a/plugins/FreeImage/Source/FreeImage/WuQuantizer.cpp
+++ b/plugins/FreeImage/Source/FreeImage/WuQuantizer.cpp
@@ -66,7 +66,7 @@ WuQuantizer::WuQuantizer(FIBITMAP *dib) {
// Allocate Qadd
Qadd = (WORD *)malloc(sizeof(WORD) * width * height);
- if(!gm2 || !wt || !mr || !mg || !mb || !Qadd) {
+ if (!gm2 || !wt || !mr || !mg || !mb || !Qadd) {
if(gm2) free(gm2);
if(wt) free(wt);
if(mr) free(mr);
@@ -127,10 +127,10 @@ WuQuantizer::Hist3D(LONG *vwt, LONG *vmr, LONG *vmg, LONG *vmb, float *m2, int R
}
}
- if( ReserveSize > 0 ) {
+ if ( ReserveSize > 0 ) {
int max = 0;
for(i = 0; i < SIZE_3D; i++) {
- if( vwt[i] > max ) max = vwt[i];
+ if ( vwt[i] > max ) max = vwt[i];
}
max++;
for(i = 0; i < ReserveSize; i++) {
diff --git a/plugins/FreeImage/Source/FreeImage/tmoColorConvert.cpp b/plugins/FreeImage/Source/FreeImage/tmoColorConvert.cpp
index 66869b2806..c40ee29c60 100644
--- a/plugins/FreeImage/Source/FreeImage/tmoColorConvert.cpp
+++ b/plugins/FreeImage/Source/FreeImage/tmoColorConvert.cpp
@@ -275,7 +275,7 @@ ClampConvertRGBFTo24(FIBITMAP *src) {
const unsigned height = FreeImage_GetHeight(src);
FIBITMAP *dst = FreeImage_Allocate(width, height, 24, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
- if(!dst) return NULL;
+ if (!dst) return NULL;
const unsigned src_pitch = FreeImage_GetPitch(src);
const unsigned dst_pitch = FreeImage_GetPitch(dst);
@@ -321,7 +321,7 @@ ConvertRGBFToY(FIBITMAP *src) {
const unsigned height = FreeImage_GetHeight(src);
FIBITMAP *dst = FreeImage_AllocateT(FIT_FLOAT, width, height);
- if(!dst) return NULL;
+ if (!dst) return NULL;
const unsigned src_pitch = FreeImage_GetPitch(src);
const unsigned dst_pitch = FreeImage_GetPitch(dst);
@@ -444,7 +444,7 @@ NormalizeY(FIBITMAP *Y, float minPrct, float maxPrct) {
int pitch = FreeImage_GetPitch(Y);
// find max & min luminance values
- if((minPrct > 0) || (maxPrct < 1)) {
+ if ((minPrct > 0) || (maxPrct < 1)) {
maxLum = 0, minLum = 0;
findMaxMinPercentile(Y, minPrct, &minLum, maxPrct, &maxLum);
} else {
diff --git a/plugins/FreeImage/Source/FreeImage/tmoDrago03.cpp b/plugins/FreeImage/Source/FreeImage/tmoDrago03.cpp
index a61534474d..b820bb3577 100644
--- a/plugins/FreeImage/Source/FreeImage/tmoDrago03.cpp
+++ b/plugins/FreeImage/Source/FreeImage/tmoDrago03.cpp
@@ -258,13 +258,13 @@ FIBITMAP* DLL_CALLCONV
FreeImage_TmoDrago03(FIBITMAP *src, double gamma, double exposure) {
float maxLum, minLum, avgLum;
- if(!FreeImage_HasPixels(src)) return NULL;
+ if (!FreeImage_HasPixels(src)) return NULL;
// working RGBF variable
FIBITMAP *dib = NULL;
dib = FreeImage_ConvertToRGBF(src);
- if(!dib) return NULL;
+ if (!dib) return NULL;
// default algorithm parameters
const float biasParam = 0.85F;
diff --git a/plugins/FreeImage/Source/FreeImage/tmoFattal02.cpp b/plugins/FreeImage/Source/FreeImage/tmoFattal02.cpp
index c458246c6f..71be370b3e 100644
--- a/plugins/FreeImage/Source/FreeImage/tmoFattal02.cpp
+++ b/plugins/FreeImage/Source/FreeImage/tmoFattal02.cpp
@@ -54,7 +54,7 @@ static FIBITMAP* GaussianLevel5x5(FIBITMAP *dib) {
h_dib = FreeImage_AllocateT(image_type, width, height);
v_dib = FreeImage_AllocateT(image_type, width, height);
- if(!h_dib || !v_dib) throw(1);
+ if (!h_dib || !v_dib) throw(1);
const unsigned pitch = FreeImage_GetPitch(dib) / sizeof(float);
@@ -166,7 +166,7 @@ static FIBITMAP* GradientLevel(FIBITMAP *H, float *avgGrad, int k) {
const unsigned height = FreeImage_GetHeight(H);
G = FreeImage_AllocateT(image_type, width, height);
- if(!G) throw(1);
+ if (!G) throw(1);
const unsigned pitch = FreeImage_GetPitch(H) / sizeof(float);
@@ -246,7 +246,7 @@ static FIBITMAP* PhiMatrix(FIBITMAP **gradients, float *avgGrad, int nlevels, fl
try {
phi = (FIBITMAP**)malloc(nlevels * sizeof(FIBITMAP*));
- if(!phi) throw(1);
+ if (!phi) throw(1);
memset(phi, 0, nlevels * sizeof(FIBITMAP*));
for(int k = nlevels-1; k >= 0; k--) {
@@ -266,7 +266,7 @@ static FIBITMAP* PhiMatrix(FIBITMAP **gradients, float *avgGrad, int nlevels, fl
if(ALPHA == 0) ALPHA = EPSILON;
phi[k] = FreeImage_AllocateT(FIT_FLOAT, width, height);
- if(!phi[k]) throw(1);
+ if (!phi[k]) throw(1);
src_pixel = (float*)FreeImage_GetBits(Gk);
dst_pixel = (float*)FreeImage_GetBits(phi[k]);
@@ -285,7 +285,7 @@ static FIBITMAP* PhiMatrix(FIBITMAP **gradients, float *avgGrad, int nlevels, fl
if(k < nlevels-1) {
// compute PHI(k) = L( PHI(k+1) ) * phi(k)
FIBITMAP *L = FreeImage_Rescale(phi[k+1], width, height, FILTER_BILINEAR);
- if(!L) throw(1);
+ if (!L) throw(1);
src_pixel = (float*)FreeImage_GetBits(L);
dst_pixel = (float*)FreeImage_GetBits(phi[k]);
@@ -345,9 +345,9 @@ static FIBITMAP* Divergence(FIBITMAP *H, FIBITMAP *PHI) {
const unsigned height = FreeImage_GetHeight(H);
Gx = FreeImage_AllocateT(image_type, width, height);
- if(!Gx) throw(1);
+ if (!Gx) throw(1);
Gy = FreeImage_AllocateT(image_type, width, height);
- if(!Gy) throw(1);
+ if (!Gy) throw(1);
const unsigned pitch = FreeImage_GetPitch(H) / sizeof(float);
@@ -377,7 +377,7 @@ static FIBITMAP* Divergence(FIBITMAP *H, FIBITMAP *PHI) {
// calculate the divergence
divG = FreeImage_AllocateT(image_type, width, height);
- if(!divG) throw(1);
+ if (!divG) throw(1);
gx = (float*)FreeImage_GetBits(Gx);
gy = (float*)FreeImage_GetBits(Gy);
@@ -421,7 +421,7 @@ static FIBITMAP* LogLuminance(FIBITMAP *Y) {
try {
// get the luminance channel
FIBITMAP *H = FreeImage_Clone(Y);
- if(!H) throw(1);
+ if (!H) throw(1);
const unsigned width = FreeImage_GetWidth(H);
const unsigned height = FreeImage_GetHeight(H);
@@ -509,7 +509,7 @@ static FIBITMAP* tmoFattal02(FIBITMAP *Y, float alpha, float beta) {
try {
// get the normalized luminance
FIBITMAP *H = LogLuminance(Y);
- if(!H) throw(1);
+ if (!H) throw(1);
// get the number of levels for the pyramid
const unsigned width = FreeImage_GetWidth(H);
@@ -522,19 +522,19 @@ static FIBITMAP* tmoFattal02(FIBITMAP *Y, float alpha, float beta) {
// create the Gaussian pyramid
pyramid = (FIBITMAP**)malloc(nlevels * sizeof(FIBITMAP*));
- if(!pyramid) throw(1);
+ if (!pyramid) throw(1);
memset(pyramid, 0, nlevels * sizeof(FIBITMAP*));
- if(!GaussianPyramid(H, pyramid, nlevels)) throw(1);
+ if (!GaussianPyramid(H, pyramid, nlevels)) throw(1);
// calculate gradient magnitude and its average value on each pyramid level
gradients = (FIBITMAP**)malloc(nlevels * sizeof(FIBITMAP*));
- if(!gradients) throw(1);
+ if (!gradients) throw(1);
memset(gradients, 0, nlevels * sizeof(FIBITMAP*));
avgGrad = (float*)malloc(nlevels * sizeof(float));
- if(!avgGrad) throw(1);
+ if (!avgGrad) throw(1);
- if(!GradientPyramid(pyramid, nlevels, gradients, avgGrad)) throw(1);
+ if (!GradientPyramid(pyramid, nlevels, gradients, avgGrad)) throw(1);
// free the Gaussian pyramid
for(k = 0; k < nlevels; k++) {
@@ -544,7 +544,7 @@ static FIBITMAP* tmoFattal02(FIBITMAP *Y, float alpha, float beta) {
// compute the gradient attenuation function PHI(x, y)
phy = PhiMatrix(gradients, avgGrad, nlevels, alpha, beta);
- if(!phy) throw(1);
+ if (!phy) throw(1);
// free the gradient pyramid
for(k = 0; k < nlevels; k++) {
@@ -556,7 +556,7 @@ static FIBITMAP* tmoFattal02(FIBITMAP *Y, float alpha, float beta) {
// compute gradients in x and y directions, attenuate them with the attenuation matrix,
// then compute the divergence div G from the attenuated gradient.
divG = Divergence(H, phy);
- if(!divG) throw(1);
+ if (!divG) throw(1);
// H & phy no longer needed
FreeImage_Unload(H); H = NULL;
@@ -564,7 +564,7 @@ static FIBITMAP* tmoFattal02(FIBITMAP *Y, float alpha, float beta) {
// solve the PDE (Poisson equation) using a multigrid solver and 3 cycles
FIBITMAP *U = FreeImage_MultigridPoissonSolver(divG, 3);
- if(!U) throw(1);
+ if (!U) throw(1);
FreeImage_Unload(divG);
@@ -618,21 +618,21 @@ FreeImage_TmoFattal02(FIBITMAP *dib, double color_saturation, double attenuation
FIBITMAP *Yout = NULL;
FIBITMAP *dst = NULL;
- if(!FreeImage_HasPixels(dib)) return NULL;
+ if (!FreeImage_HasPixels(dib)) return NULL;
try {
// convert to RGBF
src = FreeImage_ConvertToRGBF(dib);
- if(!src) throw(1);
+ if (!src) throw(1);
// get the luminance channel
Yin = ConvertRGBFToY(src);
- if(!Yin) throw(1);
+ if (!Yin) throw(1);
// perform the tone mapping
Yout = tmoFattal02(Yin, alpha, beta);
- if(!Yout) throw(1);
+ if (!Yout) throw(1);
// clip low and high values and normalize to [0..1]
//NormalizeY(Yout, 0.001F, 0.995F);
diff --git a/plugins/FreeImage/Source/FreeImage/tmoReinhard05.cpp b/plugins/FreeImage/Source/FreeImage/tmoReinhard05.cpp
index f91b41c062..dfa6553806 100644
--- a/plugins/FreeImage/Source/FreeImage/tmoReinhard05.cpp
+++ b/plugins/FreeImage/Source/FreeImage/tmoReinhard05.cpp
@@ -59,7 +59,7 @@ ToneMappingReinhard05(FIBITMAP *dib, FIBITMAP *Y, float f, float m, float a, flo
// check input parameters
- if((FreeImage_GetImageType(dib) != FIT_RGBF) || (FreeImage_GetImageType(Y) != FIT_FLOAT)) {
+ if ((FreeImage_GetImageType(dib) != FIT_RGBF) || (FreeImage_GetImageType(Y) != FIT_FLOAT)) {
return FALSE;
}
@@ -81,7 +81,7 @@ ToneMappingReinhard05(FIBITMAP *dib, FIBITMAP *Y, float f, float m, float a, flo
// get statistics about the data (but only if its really needed)
f = exp(-f);
- if((m == 0) || (a != 1) && (c != 1)) {
+ if ((m == 0) || (a != 1) && (c != 1)) {
// avoid these calculations if its not needed after ...
LuminanceFromY(Y, &maxLum, &minLum, &Lav, &Llav);
k = (log(maxLum) - Llav) / (log(maxLum) - log(minLum));
@@ -103,7 +103,7 @@ ToneMappingReinhard05(FIBITMAP *dib, FIBITMAP *Y, float f, float m, float a, flo
bits = (BYTE*)FreeImage_GetBits(dib);
Ybits = (BYTE*)FreeImage_GetBits(Y);
- if((a == 1) && (c == 0)) {
+ if ((a == 1) && (c == 0)) {
// when using default values, use a fastest code
for(y = 0; y < height; y++) {
@@ -131,7 +131,7 @@ ToneMappingReinhard05(FIBITMAP *dib, FIBITMAP *Y, float f, float m, float a, flo
// channel averages
Cav[0] = Cav[1] = Cav[2] = 0;
- if((a != 1) && (c != 0)) {
+ if ((a != 1) && (c != 0)) {
// channel averages are not needed when (a == 1) or (c == 0)
bits = (BYTE*)FreeImage_GetBits(dib);
for(y = 0; y < height; y++) {
@@ -215,17 +215,17 @@ User parameters control intensity, contrast, and level of adaptation
*/
FIBITMAP* DLL_CALLCONV
FreeImage_TmoReinhard05Ex(FIBITMAP *src, double intensity, double contrast, double adaptation, double color_correction) {
- if(!FreeImage_HasPixels(src)) return NULL;
+ if (!FreeImage_HasPixels(src)) return NULL;
// working RGBF variable
FIBITMAP *dib = NULL, *Y = NULL;
dib = FreeImage_ConvertToRGBF(src);
- if(!dib) return NULL;
+ if (!dib) return NULL;
// get the Luminance channel
Y = ConvertRGBFToY(dib);
- if(!Y) {
+ if (!Y) {
FreeImage_Unload(dib);
return NULL;
}
diff --git a/plugins/FreeImage/Source/FreeImageToolkit/BSplineRotate.cpp b/plugins/FreeImage/Source/FreeImageToolkit/BSplineRotate.cpp
index 690db87d8c..e4be1d0bd2 100644
--- a/plugins/FreeImage/Source/FreeImageToolkit/BSplineRotate.cpp
+++ b/plugins/FreeImage/Source/FreeImageToolkit/BSplineRotate.cpp
@@ -556,7 +556,7 @@ Rotate8Bit(FIBITMAP *dib, double angle, double x_shift, double y_shift, double x
// allocate output image
FIBITMAP *dst = FreeImage_Allocate(width, height, bpp);
- if(!dst)
+ if (!dst)
return NULL;
// buid a grey scale palette
RGBQUAD *pal = FreeImage_GetPalette(dst);
@@ -566,7 +566,7 @@ Rotate8Bit(FIBITMAP *dib, double angle, double x_shift, double y_shift, double x
// allocate a temporary array
ImageRasterArray = (double*)malloc(width * height * sizeof(double));
- if(!ImageRasterArray) {
+ if (!ImageRasterArray) {
FreeImage_Unload(dst);
return NULL;
}
@@ -583,7 +583,7 @@ Rotate8Bit(FIBITMAP *dib, double angle, double x_shift, double y_shift, double x
// convert between a representation based on image samples
// and a representation based on image B-spline coefficients
bResult = SamplesToCoefficients(ImageRasterArray, width, height, spline);
- if(!bResult) {
+ if (!bResult) {
FreeImage_Unload(dst);
free(ImageRasterArray);
return NULL;
@@ -611,7 +611,7 @@ Rotate8Bit(FIBITMAP *dib, double angle, double x_shift, double y_shift, double x
x1 = x0 + a11 * (double)x;
y1 = y0 + a21 * (double)x;
if(use_mask) {
- if((x1 <= -0.5) || (((double)width - 0.5) <= x1) || (y1 <= -0.5) || (((double)height - 0.5) <= y1)) {
+ if ((x1 <= -0.5) || (((double)width - 0.5) <= x1) || (y1 <= -0.5) || (((double)height - 0.5) <= y1)) {
p = 0;
}
else {
@@ -652,7 +652,7 @@ FreeImage_RotateEx(FIBITMAP *dib, double angle, double x_shift, double y_shift,
BYTE *src_bits, *dst_bits;
FIBITMAP *src8 = NULL, *dst8 = NULL, *dst = NULL;
- if(!FreeImage_HasPixels(dib)) return NULL;
+ if (!FreeImage_HasPixels(dib)) return NULL;
try {
@@ -666,20 +666,20 @@ FreeImage_RotateEx(FIBITMAP *dib, double angle, double x_shift, double y_shift,
}
return dst_8;
}
- if((bpp == 24) || (bpp == 32)) {
+ if ((bpp == 24) || (bpp == 32)) {
// allocate dst image
int width = FreeImage_GetWidth(dib);
int height = FreeImage_GetHeight(dib);
- if( bpp == 24 ) {
+ if ( bpp == 24 ) {
dst = FreeImage_Allocate(width, height, bpp, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
} else {
dst = FreeImage_Allocate(width, height, bpp, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
}
- if(!dst) throw(1);
+ if (!dst) throw(1);
// allocate a temporary 8-bit dib (no need to build a palette)
src8 = FreeImage_Allocate(width, height, 8);
- if(!src8) throw(1);
+ if (!src8) throw(1);
// process each channel separately
// -------------------------------
@@ -698,7 +698,7 @@ FreeImage_RotateEx(FIBITMAP *dib, double angle, double x_shift, double y_shift,
// process channel
dst8 = Rotate8Bit(src8, angle, x_shift, y_shift, x_origin, y_origin, ROTATE_CUBIC, use_mask);
- if(!dst8) throw(1);
+ if (!dst8) throw(1);
// insert channel to destination dib
for(y = 0; y < height; y++) {
diff --git a/plugins/FreeImage/Source/FreeImageToolkit/Channels.cpp b/plugins/FreeImage/Source/FreeImageToolkit/Channels.cpp
index 5f01ad815f..f6e6c5509c 100644
--- a/plugins/FreeImage/Source/FreeImageToolkit/Channels.cpp
+++ b/plugins/FreeImage/Source/FreeImageToolkit/Channels.cpp
@@ -31,7 +31,7 @@
FIBITMAP * DLL_CALLCONV
FreeImage_GetChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) {
- if(!FreeImage_HasPixels(src)) return NULL;
+ if (!FreeImage_HasPixels(src)) return NULL;
FREE_IMAGE_TYPE image_type = FreeImage_GetImageType(src);
unsigned bpp = FreeImage_GetBPP(src);
@@ -63,7 +63,7 @@ FreeImage_GetChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) {
unsigned width = FreeImage_GetWidth(src);
unsigned height = FreeImage_GetHeight(src);
FIBITMAP *dst = FreeImage_Allocate(width, height, 8) ;
- if(!dst) return NULL;
+ if (!dst) return NULL;
// build a greyscale palette
RGBQUAD *pal = FreeImage_GetPalette(dst);
for(int i = 0; i < 256; i++) {
@@ -90,7 +90,7 @@ FreeImage_GetChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) {
}
// 48-bit RGB or 64-bit RGBA images
- if((image_type == FIT_RGB16) || (image_type == FIT_RGBA16)) {
+ if ((image_type == FIT_RGB16) || (image_type == FIT_RGBA16)) {
int c;
// select the channel to extract (always RGB[A])
@@ -116,7 +116,7 @@ FreeImage_GetChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) {
unsigned width = FreeImage_GetWidth(src);
unsigned height = FreeImage_GetHeight(src);
FIBITMAP *dst = FreeImage_AllocateT(FIT_UINT16, width, height) ;
- if(!dst) return NULL;
+ if (!dst) return NULL;
// perform extraction
@@ -138,7 +138,7 @@ FreeImage_GetChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) {
}
// 96-bit RGBF or 128-bit RGBAF images
- if((image_type == FIT_RGBF) || (image_type == FIT_RGBAF)) {
+ if ((image_type == FIT_RGBF) || (image_type == FIT_RGBAF)) {
int c;
// select the channel to extract (always RGB[A])
@@ -164,7 +164,7 @@ FreeImage_GetChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) {
unsigned width = FreeImage_GetWidth(src);
unsigned height = FreeImage_GetHeight(src);
FIBITMAP *dst = FreeImage_AllocateT(FIT_FLOAT, width, height) ;
- if(!dst) return NULL;
+ if (!dst) return NULL;
// perform extraction
@@ -199,32 +199,32 @@ BOOL DLL_CALLCONV
FreeImage_SetChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) {
int c;
- if(!FreeImage_HasPixels(src) || !FreeImage_HasPixels(dst)) return FALSE;
+ if (!FreeImage_HasPixels(src) || !FreeImage_HasPixels(dst)) return FALSE;
// src and dst images should have the same width and height
unsigned src_width = FreeImage_GetWidth(src);
unsigned src_height = FreeImage_GetHeight(src);
unsigned dst_width = FreeImage_GetWidth(dst);
unsigned dst_height = FreeImage_GetHeight(dst);
- if((src_width != dst_width) || (src_height != dst_height))
+ if ((src_width != dst_width) || (src_height != dst_height))
return FALSE;
// src image should be grayscale, dst image should be RGB or RGBA
FREE_IMAGE_COLOR_TYPE src_type = FreeImage_GetColorType(src);
FREE_IMAGE_COLOR_TYPE dst_type = FreeImage_GetColorType(dst);
- if((dst_type != FIC_RGB) && (dst_type != FIC_RGBALPHA) || (src_type != FIC_MINISBLACK)) {
+ if ((dst_type != FIC_RGB) && (dst_type != FIC_RGBALPHA) || (src_type != FIC_MINISBLACK)) {
return FALSE;
}
FREE_IMAGE_TYPE src_image_type = FreeImage_GetImageType(src);
FREE_IMAGE_TYPE dst_image_type = FreeImage_GetImageType(dst);
- if((dst_image_type == FIT_BITMAP) && (src_image_type == FIT_BITMAP)) {
+ if ((dst_image_type == FIT_BITMAP) && (src_image_type == FIT_BITMAP)) {
// src image should be grayscale, dst image should be 24- or 32-bit
unsigned src_bpp = FreeImage_GetBPP(src);
unsigned dst_bpp = FreeImage_GetBPP(dst);
- if((src_bpp != 8) || (dst_bpp != 24) && (dst_bpp != 32))
+ if ((src_bpp != 8) || (dst_bpp != 24) && (dst_bpp != 32))
return FALSE;
@@ -263,12 +263,12 @@ FreeImage_SetChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL chan
return TRUE;
}
- if(((dst_image_type == FIT_RGB16) || (dst_image_type == FIT_RGBA16)) && (src_image_type == FIT_UINT16)) {
+ if (((dst_image_type == FIT_RGB16) || (dst_image_type == FIT_RGBA16)) && (src_image_type == FIT_UINT16)) {
// src image should be grayscale, dst image should be 48- or 64-bit
unsigned src_bpp = FreeImage_GetBPP(src);
unsigned dst_bpp = FreeImage_GetBPP(dst);
- if((src_bpp != 16) || (dst_bpp != 48) && (dst_bpp != 64))
+ if ((src_bpp != 16) || (dst_bpp != 48) && (dst_bpp != 64))
return FALSE;
@@ -307,12 +307,12 @@ FreeImage_SetChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL chan
return TRUE;
}
- if(((dst_image_type == FIT_RGBF) || (dst_image_type == FIT_RGBAF)) && (src_image_type == FIT_FLOAT)) {
+ if (((dst_image_type == FIT_RGBF) || (dst_image_type == FIT_RGBAF)) && (src_image_type == FIT_FLOAT)) {
// src image should be grayscale, dst image should be 96- or 128-bit
unsigned src_bpp = FreeImage_GetBPP(src);
unsigned dst_bpp = FreeImage_GetBPP(dst);
- if((src_bpp != 32) || (dst_bpp != 96) && (dst_bpp != 128))
+ if ((src_bpp != 32) || (dst_bpp != 96) && (dst_bpp != 128))
return FALSE;
@@ -367,14 +367,14 @@ FreeImage_GetComplexChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) {
double *dst_bits = NULL;
FIBITMAP *dst = NULL;
- if(!FreeImage_HasPixels(src)) return NULL;
+ if (!FreeImage_HasPixels(src)) return NULL;
if(FreeImage_GetImageType(src) == FIT_COMPLEX) {
// allocate a dib of type FIT_DOUBLE
unsigned width = FreeImage_GetWidth(src);
unsigned height = FreeImage_GetHeight(src);
dst = FreeImage_AllocateT(FIT_DOUBLE, width, height) ;
- if(!dst) return NULL;
+ if (!dst) return NULL;
// perform extraction
@@ -415,7 +415,7 @@ FreeImage_GetComplexChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) {
src_bits = (FICOMPLEX *)FreeImage_GetScanLine(src, y);
dst_bits = (double *)FreeImage_GetScanLine(dst, y);
for(x = 0; x < width; x++) {
- if((src_bits[x].r == 0) && (src_bits[x].i == 0)) {
+ if ((src_bits[x].r == 0) && (src_bits[x].i == 0)) {
phase = 0;
} else {
phase = atan2(src_bits[x].i, src_bits[x].r);
@@ -446,12 +446,12 @@ FreeImage_SetComplexChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANN
double *src_bits = NULL;
FICOMPLEX *dst_bits = NULL;
- if(!FreeImage_HasPixels(src) || !FreeImage_HasPixels(dst)) return FALSE;
+ if (!FreeImage_HasPixels(src) || !FreeImage_HasPixels(dst)) return FALSE;
// src image should be of type FIT_DOUBLE, dst image should be of type FIT_COMPLEX
const FREE_IMAGE_TYPE src_type = FreeImage_GetImageType(src);
const FREE_IMAGE_TYPE dst_type = FreeImage_GetImageType(dst);
- if((src_type != FIT_DOUBLE) || (dst_type != FIT_COMPLEX))
+ if ((src_type != FIT_DOUBLE) || (dst_type != FIT_COMPLEX))
return FALSE;
// src and dst images should have the same width and height
@@ -459,7 +459,7 @@ FreeImage_SetComplexChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANN
unsigned src_height = FreeImage_GetHeight(src);
unsigned dst_width = FreeImage_GetWidth(dst);
unsigned dst_height = FreeImage_GetHeight(dst);
- if((src_width != dst_width) || (src_height != dst_height))
+ if ((src_width != dst_width) || (src_height != dst_height))
return FALSE;
// select the channel to modify
diff --git a/plugins/FreeImage/Source/FreeImageToolkit/ClassicRotate.cpp b/plugins/FreeImage/Source/FreeImageToolkit/ClassicRotate.cpp
index 83c2f92123..7046a4acc9 100644
--- a/plugins/FreeImage/Source/FreeImageToolkit/ClassicRotate.cpp
+++ b/plugins/FreeImage/Source/FreeImageToolkit/ClassicRotate.cpp
@@ -63,7 +63,7 @@ HorizontalSkewT(FIBITMAP *src, FIBITMAP *dst, int row, int iOffset, double weigh
// background
const T pxlBlack[4] = {0, 0, 0, 0 };
const T *pxlBkg = static_cast<const T*>(bkcolor); // assume at least bytespp and 4*sizeof(T) max
- if(!pxlBkg) {
+ if (!pxlBkg) {
// default background color is black
pxlBkg = pxlBlack;
}
@@ -98,7 +98,7 @@ HorizontalSkewT(FIBITMAP *src, FIBITMAP *dst, int row, int iOffset, double weigh
}
// check boundaries
iXPos = i + iOffset;
- if((iXPos >= 0) && (iXPos < (int)dst_width)) {
+ if ((iXPos >= 0) && (iXPos < (int)dst_width)) {
// update left over on source
for(unsigned j = 0; j < samples; j++) {
pxlSrc[j] = pxlSrc[j] - (pxlLeft[j] - pxlOldLeft[j]);
@@ -115,7 +115,7 @@ HorizontalSkewT(FIBITMAP *src, FIBITMAP *dst, int row, int iOffset, double weigh
// go to rightmost point of skew
iXPos = src_width + iOffset;
- if((iXPos >= 0) && (iXPos < (int)dst_width)) {
+ if ((iXPos >= 0) && (iXPos < (int)dst_width)) {
dst_bits = FreeImage_GetScanLine(dst, row) + iXPos * bytespp;
// If still in image bounds, put leftovers there
@@ -194,7 +194,7 @@ VerticalSkewT(FIBITMAP *src, FIBITMAP *dst, int col, int iOffset, double weight,
// background
const T pxlBlack[4] = {0, 0, 0, 0 };
const T *pxlBkg = static_cast<const T*>(bkcolor); // assume at least bytespp and 4*sizeof(T) max
- if(!pxlBkg) {
+ if (!pxlBkg) {
// default background color is black
pxlBkg = pxlBlack;
}
@@ -235,7 +235,7 @@ VerticalSkewT(FIBITMAP *src, FIBITMAP *dst, int col, int iOffset, double weight,
}
// check boundaries
iYPos = i + iOffset;
- if((iYPos >= 0) && (iYPos < (int)dst_height)) {
+ if ((iYPos >= 0) && (iYPos < (int)dst_height)) {
// update left over on source
for(unsigned j = 0; j < samples; j++) {
pxlSrc[j] = pxlSrc[j] - (pxlLeft[j] - pxlOldLeft[j]);
@@ -252,7 +252,7 @@ VerticalSkewT(FIBITMAP *src, FIBITMAP *dst, int col, int iOffset, double weight,
// go to bottom point of skew
iYPos = src_height + iOffset;
- if((iYPos >= 0) && (iYPos < (int)dst_height)) {
+ if ((iYPos >= 0) && (iYPos < (int)dst_height)) {
dst_bits = FreeImage_GetScanLine(dst, iYPos) + index;
// if still in image bounds, put leftovers there
@@ -367,7 +367,7 @@ Rotate90(FIBITMAP *src) {
}
}
}
- else if((bpp == 8) || (bpp == 24) || (bpp == 32)) {
+ else if ((bpp == 8) || (bpp == 24) || (bpp == 32)) {
// anything other than BW :
// This optimized version of rotation rotates image by smaller blocks. It is quite
// a bit faster than obvious algorithm, because it produces much less CPU cache misses.
@@ -472,7 +472,7 @@ Rotate180(FIBITMAP *src) {
}
break;
}
- // else if((bpp == 8) || (bpp == 24) || (bpp == 32)) FALL TROUGH
+ // else if ((bpp == 8) || (bpp == 24) || (bpp == 32)) FALL TROUGH
case FIT_UINT16:
case FIT_RGB16:
case FIT_RGBA16:
@@ -559,7 +559,7 @@ Rotate270(FIBITMAP *src) {
}
}
}
- else if((bpp == 8) || (bpp == 24) || (bpp == 32)) {
+ else if ((bpp == 8) || (bpp == 24) || (bpp == 32)) {
// anything other than BW :
// This optimized version of rotation rotates image by smaller blocks. It is quite
// a bit faster than obvious algorithm, because it produces much less CPU cache misses.
@@ -767,7 +767,7 @@ RotateAny(FIBITMAP *src, double dAngle, const void *bkcolor) {
// Bring angle to range of [0 .. 360)
dAngle += 360;
}
- if((dAngle > 45) && (dAngle <= 135)) {
+ if ((dAngle > 45) && (dAngle <= 135)) {
// Angle in (45 .. 135]
// Rotate image by 90 degrees into temporary image,
// so it requires only an extra rotation angle
@@ -775,7 +775,7 @@ RotateAny(FIBITMAP *src, double dAngle, const void *bkcolor) {
image = Rotate90(src);
dAngle -= 90;
}
- else if((dAngle > 135) && (dAngle <= 225)) {
+ else if ((dAngle > 135) && (dAngle <= 225)) {
// Angle in (135 .. 225]
// Rotate image by 180 degrees into temporary image,
// so it requires only an extra rotation angle
@@ -783,7 +783,7 @@ RotateAny(FIBITMAP *src, double dAngle, const void *bkcolor) {
image = Rotate180(src);
dAngle -= 180;
}
- else if((dAngle > 225) && (dAngle <= 315)) {
+ else if ((dAngle > 225) && (dAngle <= 315)) {
// Angle in (225 .. 315]
// Rotate image by 270 degrees into temporary image,
// so it requires only an extra rotation angle
@@ -825,7 +825,7 @@ RotateAny(FIBITMAP *src, double dAngle, const void *bkcolor) {
FIBITMAP *DLL_CALLCONV
FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor) {
- if(!FreeImage_HasPixels(dib)) return NULL;
+ if (!FreeImage_HasPixels(dib)) return NULL;
if(0 == angle) {
return FreeImage_Clone(dib);
@@ -846,7 +846,7 @@ FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor) {
// perform the rotation
FIBITMAP *dst = RotateAny(dib, angle, bkcolor);
- if(!dst) throw(1);
+ if (!dst) throw(1);
// build a greyscale palette
RGBQUAD *dst_pal = FreeImage_GetPalette(dst);
@@ -863,9 +863,9 @@ FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor) {
return dst;
}
- else if((bpp == 8) || (bpp == 24) || (bpp == 32)) {
+ else if ((bpp == 8) || (bpp == 24) || (bpp == 32)) {
FIBITMAP *dst = RotateAny(dib, angle, bkcolor);
- if(!dst) throw(1);
+ if (!dst) throw(1);
if(bpp == 8) {
// copy original palette to rotated bitmap
@@ -878,7 +878,7 @@ FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor) {
// copy background color
RGBQUAD bkcolor;
- if( FreeImage_GetBackgroundColor(dib, &bkcolor) ) {
+ if ( FreeImage_GetBackgroundColor(dib, &bkcolor) ) {
FreeImage_SetBackgroundColor(dst, &bkcolor);
}
@@ -898,7 +898,7 @@ FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor) {
case FIT_RGBAF:
{
FIBITMAP *dst = RotateAny(dib, angle, bkcolor);
- if(!dst) throw(1);
+ if (!dst) throw(1);
// copy metadata from src to dst
FreeImage_CloneMetadata(dst, dib);
diff --git a/plugins/FreeImage/Source/FreeImageToolkit/Colors.cpp b/plugins/FreeImage/Source/FreeImageToolkit/Colors.cpp
index 67191768bb..8b9bbd6482 100644
--- a/plugins/FreeImage/Source/FreeImageToolkit/Colors.cpp
+++ b/plugins/FreeImage/Source/FreeImageToolkit/Colors.cpp
@@ -108,7 +108,7 @@ FreeImage_Invert(FIBITMAP *src) {
return FALSE;
}
}
- else if((image_type == FIT_UINT16) || (image_type == FIT_RGB16) || (image_type == FIT_RGBA16)) {
+ else if ((image_type == FIT_UINT16) || (image_type == FIT_RGB16) || (image_type == FIT_RGBA16)) {
// Calculate the number of words per pixel (1 for 16-bit, 3 for 48-bit or 4 for 64-bit)
const unsigned wordspp = (FreeImage_GetLine(src) / width) / sizeof(WORD);
@@ -149,11 +149,11 @@ FreeImage_AdjustCurve(FIBITMAP *src, BYTE *LUT, FREE_IMAGE_COLOR_CHANNEL channel
unsigned x, y;
BYTE *bits = NULL;
- if(!FreeImage_HasPixels(src) || !LUT || (FreeImage_GetImageType(src) != FIT_BITMAP))
+ if (!FreeImage_HasPixels(src) || !LUT || (FreeImage_GetImageType(src) != FIT_BITMAP))
return FALSE;
int bpp = FreeImage_GetBPP(src);
- if((bpp != 8) && (bpp != 24) && (bpp != 32))
+ if ((bpp != 8) && (bpp != 24) && (bpp != 32))
return FALSE;
// apply the LUT
@@ -271,7 +271,7 @@ BOOL DLL_CALLCONV
FreeImage_AdjustGamma(FIBITMAP *src, double gamma) {
BYTE LUT[256]; // Lookup table
- if(!FreeImage_HasPixels(src) || (gamma <= 0))
+ if (!FreeImage_HasPixels(src) || (gamma <= 0))
return FALSE;
// Build the lookup table
@@ -302,7 +302,7 @@ FreeImage_AdjustBrightness(FIBITMAP *src, double percentage) {
BYTE LUT[256]; // Lookup table
double value;
- if(!FreeImage_HasPixels(src))
+ if (!FreeImage_HasPixels(src))
return FALSE;
// Build the lookup table
@@ -328,7 +328,7 @@ FreeImage_AdjustContrast(FIBITMAP *src, double percentage) {
BYTE LUT[256]; // Lookup table
double value;
- if(!FreeImage_HasPixels(src))
+ if (!FreeImage_HasPixels(src))
return FALSE;
// Build the lookup table
@@ -357,7 +357,7 @@ FreeImage_GetHistogram(FIBITMAP *src, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL cha
BYTE *bits = NULL;
unsigned x, y;
- if(!FreeImage_HasPixels(src) || !histo) return FALSE;
+ if (!FreeImage_HasPixels(src) || !histo) return FALSE;
unsigned width = FreeImage_GetWidth(src);
unsigned height = FreeImage_GetHeight(src);
@@ -377,7 +377,7 @@ FreeImage_GetHistogram(FIBITMAP *src, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL cha
}
return TRUE;
}
- else if((bpp == 24) || (bpp == 32)) {
+ else if ((bpp == 24) || (bpp == 32)) {
int bytespp = bpp / 8; // bytes / pixel
// clear histogram array
diff --git a/plugins/FreeImage/Source/FreeImageToolkit/CopyPaste.cpp b/plugins/FreeImage/Source/FreeImageToolkit/CopyPaste.cpp
index e4b8155739..59757287ed 100644
--- a/plugins/FreeImage/Source/FreeImageToolkit/CopyPaste.cpp
+++ b/plugins/FreeImage/Source/FreeImageToolkit/CopyPaste.cpp
@@ -58,12 +58,12 @@ Combine1(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned
BOOL value;
// check the bit depth of src and dst images
- if((FreeImage_GetBPP(dst_dib) != 1) || (FreeImage_GetBPP(src_dib) != 1)) {
+ if ((FreeImage_GetBPP(dst_dib) != 1) || (FreeImage_GetBPP(src_dib) != 1)) {
return FALSE;
}
// check the size of src image
- if((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) {
+ if ((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) {
return FALSE;
}
@@ -97,12 +97,12 @@ Combine4(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned
BOOL bOddStart, bOddEnd;
// check the bit depth of src and dst images
- if((FreeImage_GetBPP(dst_dib) != 4) || (FreeImage_GetBPP(src_dib) != 4)) {
+ if ((FreeImage_GetBPP(dst_dib) != 4) || (FreeImage_GetBPP(src_dib) != 4)) {
return FALSE;
}
// check the size of src image
- if((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) {
+ if ((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) {
return FALSE;
}
@@ -196,12 +196,12 @@ Combine4(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned
static BOOL
Combine8(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned alpha) {
// check the bit depth of src and dst images
- if((FreeImage_GetBPP(dst_dib) != 8) || (FreeImage_GetBPP(src_dib) != 8)) {
+ if ((FreeImage_GetBPP(dst_dib) != 8) || (FreeImage_GetBPP(src_dib) != 8)) {
return FALSE;
}
// check the size of src image
- if((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) {
+ if ((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) {
return FALSE;
}
@@ -238,12 +238,12 @@ Combine8(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned
static BOOL
Combine16_555(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned alpha) {
// check the bit depth of src and dst images
- if((FreeImage_GetBPP(dst_dib) != 16) || (FreeImage_GetBPP(src_dib) != 16)) {
+ if ((FreeImage_GetBPP(dst_dib) != 16) || (FreeImage_GetBPP(src_dib) != 16)) {
return FALSE;
}
// check the size of src image
- if((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) {
+ if ((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) {
return FALSE;
}
@@ -298,12 +298,12 @@ Combine16_555(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsi
static BOOL
Combine16_565(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned alpha) {
// check the bit depth of src and dst images
- if((FreeImage_GetBPP(dst_dib) != 16) || (FreeImage_GetBPP(src_dib) != 16)) {
+ if ((FreeImage_GetBPP(dst_dib) != 16) || (FreeImage_GetBPP(src_dib) != 16)) {
return FALSE;
}
// check the size of src image
- if((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) {
+ if ((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) {
return FALSE;
}
@@ -362,12 +362,12 @@ Combine16_565(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsi
static BOOL
Combine24(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned alpha) {
// check the bit depth of src and dst images
- if((FreeImage_GetBPP(dst_dib) != 24) || (FreeImage_GetBPP(src_dib) != 24)) {
+ if ((FreeImage_GetBPP(dst_dib) != 24) || (FreeImage_GetBPP(src_dib) != 24)) {
return FALSE;
}
// check the size of src image
- if((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) {
+ if ((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) {
return FALSE;
}
@@ -404,12 +404,12 @@ Combine24(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned
static BOOL
Combine32(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned alpha) {
// check the bit depth of src and dst images
- if((FreeImage_GetBPP(dst_dib) != 32) || (FreeImage_GetBPP(src_dib) != 32)) {
+ if ((FreeImage_GetBPP(dst_dib) != 32) || (FreeImage_GetBPP(src_dib) != 32)) {
return FALSE;
}
// check the size of src image
- if((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) {
+ if ((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) {
return FALSE;
}
@@ -459,7 +459,7 @@ CombineSameType(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y) {
unsigned dst_pitch = FreeImage_GetPitch(dst_dib);
// check the size of src image
- if((x + src_width > dst_width) || (y + src_height > dst_height)) {
+ if ((x + src_width > dst_width) || (y + src_height > dst_height)) {
return FALSE;
}
@@ -493,7 +493,7 @@ Works with any bitmap type.
FIBITMAP * DLL_CALLCONV
FreeImage_Copy(FIBITMAP *src, int left, int top, int right, int bottom) {
- if(!FreeImage_HasPixels(src))
+ if (!FreeImage_HasPixels(src))
return NULL;
// normalize the rectangle
@@ -506,7 +506,7 @@ FreeImage_Copy(FIBITMAP *src, int left, int top, int right, int bottom) {
// check the size of the sub image
int src_width = FreeImage_GetWidth(src);
int src_height = FreeImage_GetHeight(src);
- if((left < 0) || (right > src_width) || (top < 0) || (bottom > src_height)) {
+ if ((left < 0) || (right > src_width) || (top < 0) || (bottom > src_height)) {
return NULL;
}
@@ -608,7 +608,7 @@ FreeImage_Copy(FIBITMAP *src, int left, int top, int right, int bottom) {
// copy background color
RGBQUAD bkcolor;
- if( FreeImage_GetBackgroundColor(src, &bkcolor) ) {
+ if ( FreeImage_GetBackgroundColor(src, &bkcolor) ) {
FreeImage_SetBackgroundColor(dst, &bkcolor);
}
@@ -639,13 +639,13 @@ BOOL DLL_CALLCONV
FreeImage_Paste(FIBITMAP *dst, FIBITMAP *src, int left, int top, int alpha) {
BOOL bResult = FALSE;
- if(!FreeImage_HasPixels(src) || !FreeImage_HasPixels(dst)) return FALSE;
+ if (!FreeImage_HasPixels(src) || !FreeImage_HasPixels(dst)) return FALSE;
// check the size of src image
- if((left < 0) || (top < 0)) {
+ if ((left < 0) || (top < 0)) {
return FALSE;
}
- if((left + FreeImage_GetWidth(src) > FreeImage_GetWidth(dst)) || (top + FreeImage_GetHeight(src) > FreeImage_GetHeight(dst))) {
+ if ((left + FreeImage_GetWidth(src) > FreeImage_GetWidth(dst)) || (top + FreeImage_GetHeight(src) > FreeImage_GetHeight(dst))) {
return FALSE;
}
@@ -704,7 +704,7 @@ FreeImage_Paste(FIBITMAP *dst, FIBITMAP *src, int left, int top, int alpha) {
return FALSE;
}
- if(!clone) return FALSE;
+ if (!clone) return FALSE;
// paste src to dst
switch(FreeImage_GetBPP(dst)) {
diff --git a/plugins/FreeImage/Source/FreeImageToolkit/Display.cpp b/plugins/FreeImage/Source/FreeImageToolkit/Display.cpp
index 245c5c3a18..3e4807042d 100644
--- a/plugins/FreeImage/Source/FreeImageToolkit/Display.cpp
+++ b/plugins/FreeImage/Source/FreeImageToolkit/Display.cpp
@@ -40,20 +40,20 @@ For colour images, the computation is done separately for R, G, and B samples.
*/
FIBITMAP * DLL_CALLCONV
FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg, RGBQUAD *appBkColor, FIBITMAP *bg) {
- if(!FreeImage_HasPixels(fg)) return NULL;
+ if (!FreeImage_HasPixels(fg)) return NULL;
int width = FreeImage_GetWidth(fg);
int height = FreeImage_GetHeight(fg);
int bpp = FreeImage_GetBPP(fg);
- if((bpp != 8) && (bpp != 32))
+ if ((bpp != 8) && (bpp != 32))
return NULL;
if(bg) {
int bg_width = FreeImage_GetWidth(bg);
int bg_height = FreeImage_GetHeight(bg);
int bg_bpp = FreeImage_GetBPP(bg);
- if((bg_width != width) || (bg_height != height) || (bg_bpp != 24))
+ if ((bg_width != width) || (bg_height != height) || (bg_bpp != 24))
return NULL;
}
@@ -71,7 +71,7 @@ FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg, RGBQUAD *appBkColor, FIBITMAP
// allocate the composite image
FIBITMAP *composite = FreeImage_Allocate(width, height, 24, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
- if(!composite) return NULL;
+ if (!composite) return NULL;
// get the palette
RGBQUAD *pal = FreeImage_GetPalette(fg);
@@ -133,7 +133,7 @@ FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg, RGBQUAD *appBkColor, FIBITMAP
// background color
- if(!bHasBkColor) {
+ if (!bHasBkColor) {
if(bg) {
// get the background color from the background image
bkc.rgbBlue = bg_bits[FI_RGBA_BLUE];
diff --git a/plugins/FreeImage/Source/FreeImageToolkit/JPEGTransform.cpp b/plugins/FreeImage/Source/FreeImageToolkit/JPEGTransform.cpp
index 5822f748a6..c5345497f5 100644
--- a/plugins/FreeImage/Source/FreeImageToolkit/JPEGTransform.cpp
+++ b/plugins/FreeImage/Source/FreeImageToolkit/JPEGTransform.cpp
@@ -61,7 +61,7 @@ ls_jpeg_error_exit (j_common_ptr cinfo) {
(*cinfo->err->output_message)(cinfo);
// allow JPEG with a premature end of file
- if((cinfo)->err->msg_parm.i[0] != 13) {
+ if ((cinfo)->err->msg_parm.i[0] != 13) {
// let the memory manager delete any temp files before we die
jpeg_destroy(cinfo);
@@ -171,7 +171,7 @@ LosslessTransform(const FilenameIO *filenameIO, FREE_IMAGE_JPEG_OPERATION operat
// crop option
if(crop != NULL) {
- if(!jtransform_parse_crop_spec(&transfoptions, crop)) {
+ if (!jtransform_parse_crop_spec(&transfoptions, crop)) {
FreeImage_OutputMessageProc(FIF_JPEG, "Bogus crop argument %s", crop);
throw(1);
}
@@ -180,14 +180,14 @@ LosslessTransform(const FilenameIO *filenameIO, FREE_IMAGE_JPEG_OPERATION operat
// Open the input file
if(bUseUnicode) {
#ifdef _WIN32
- if((fp = _wfopen(filenameIO->wsrc_file, L"rb")) == NULL) {
+ if ((fp = _wfopen(filenameIO->wsrc_file, L"rb")) == NULL) {
FreeImage_OutputMessageProc(FIF_JPEG, "Cannot open input file for reading");
}
#else
fp = NULL;
#endif // _WIN32
} else {
- if((fp = fopen(filenameIO->src_file, "rb")) == NULL) {
+ if ((fp = fopen(filenameIO->src_file, "rb")) == NULL) {
FreeImage_OutputMessageProc(FIF_JPEG, "Cannot open %s for reading", filenameIO->src_file);
}
}
@@ -211,7 +211,7 @@ LosslessTransform(const FilenameIO *filenameIO, FREE_IMAGE_JPEG_OPERATION operat
// Prepare transformation workspace
// Fails right away if perfect flag is TRUE and transformation is not perfect
- if( !jtransform_request_workspace(&srcinfo, &transfoptions) ) {
+ if ( !jtransform_request_workspace(&srcinfo, &transfoptions) ) {
FreeImage_OutputMessageProc(FIF_JPEG, "Transformation is not perfect");
throw(1);
}
@@ -237,14 +237,14 @@ LosslessTransform(const FilenameIO *filenameIO, FREE_IMAGE_JPEG_OPERATION operat
// Open the output file
if(bUseUnicode) {
#ifdef _WIN32
- if((fp = _wfopen(filenameIO->wdst_file, L"wb")) == NULL) {
+ if ((fp = _wfopen(filenameIO->wdst_file, L"wb")) == NULL) {
FreeImage_OutputMessageProc(FIF_JPEG, "Cannot open output file for writing");
}
#else
fp = NULL;
#endif // _WIN32
} else {
- if((fp = fopen(filenameIO->dst_file, "wb")) == NULL) {
+ if ((fp = fopen(filenameIO->dst_file, "wb")) == NULL) {
FreeImage_OutputMessageProc(FIF_JPEG, "Cannot open %s for writing", filenameIO->dst_file);
}
}
diff --git a/plugins/FreeImage/Source/FreeImageToolkit/MultigridPoissonSolver.cpp b/plugins/FreeImage/Source/FreeImageToolkit/MultigridPoissonSolver.cpp
index 3b577cbd0a..6d17d45319 100644
--- a/plugins/FreeImage/Source/FreeImageToolkit/MultigridPoissonSolver.cpp
+++ b/plugins/FreeImage/Source/FreeImageToolkit/MultigridPoissonSolver.cpp
@@ -311,7 +311,7 @@ static BOOL fmg_mglin(FIBITMAP *U, int n, int ncycle) {
#define _CREATE_ARRAY_GRID_(array, array_size) \
array = (FIBITMAP**)malloc(array_size * sizeof(FIBITMAP*));\
- if(!array) throw(1);\
+ if (!array) throw(1);\
memset(array, 0, array_size * sizeof(FIBITMAP*))
#define _FREE_ARRAY_GRID_(array, array_size) \
@@ -351,7 +351,7 @@ static BOOL fmg_mglin(FIBITMAP *U, int n, int ncycle) {
// allocate storage for r.h.s. on grid (ng - 2) ...
IRHO[ngrid] = FreeImage_AllocateT(FIT_FLOAT, nn, nn);
- if(!IRHO[ngrid]) throw(1);
+ if (!IRHO[ngrid]) throw(1);
// ... and fill it by restricting from the fine grid
fmg_restrict(IRHO[ngrid], U, nn);
@@ -361,16 +361,16 @@ static BOOL fmg_mglin(FIBITMAP *U, int n, int ncycle) {
nn = nn/2 + 1;
ngrid--;
IRHO[ngrid] = FreeImage_AllocateT(FIT_FLOAT, nn, nn);
- if(!IRHO[ngrid]) throw(1);
+ if (!IRHO[ngrid]) throw(1);
fmg_restrict(IRHO[ngrid], IRHO[ngrid+1], nn);
}
nn = 3;
IU[0] = FreeImage_AllocateT(FIT_FLOAT, nn, nn);
- if(!IU[0]) throw(1);
+ if (!IU[0]) throw(1);
IRHS[0] = FreeImage_AllocateT(FIT_FLOAT, nn, nn);
- if(!IRHS[0]) throw(1);
+ if (!IRHS[0]) throw(1);
// initial solution on coarsest grid
fmg_solve(IU[0], IRHO[0]);
@@ -384,11 +384,11 @@ static BOOL fmg_mglin(FIBITMAP *U, int n, int ncycle) {
nn = 2*nn - 1;
IU[j] = FreeImage_AllocateT(FIT_FLOAT, nn, nn);
- if(!IU[j]) throw(1);
+ if (!IU[j]) throw(1);
IRHS[j] = FreeImage_AllocateT(FIT_FLOAT, nn, nn);
- if(!IRHS[j]) throw(1);
+ if (!IRHS[j]) throw(1);
IRES[j] = FreeImage_AllocateT(FIT_FLOAT, nn, nn);
- if(!IRES[j]) throw(1);
+ if (!IRES[j]) throw(1);
fmg_prolongate(IU[j], IU[j-1], nn);
@@ -464,7 +464,7 @@ where j is such that 2^j is the nearest larger dimension corresponding to MAX(im
*/
FIBITMAP* DLL_CALLCONV
FreeImage_MultigridPoissonSolver(FIBITMAP *Laplacian, int ncycle) {
- if(!FreeImage_HasPixels(Laplacian)) return NULL;
+ if (!FreeImage_HasPixels(Laplacian)) return NULL;
int width = FreeImage_GetWidth(Laplacian);
int height = FreeImage_GetHeight(Laplacian);
@@ -473,7 +473,7 @@ FreeImage_MultigridPoissonSolver(FIBITMAP *Laplacian, int ncycle) {
int n = MAX(width, height);
int size = 0;
while((n >>= 1) > 0) size++;
- if((1 << size) < MAX(width, height)) {
+ if ((1 << size) < MAX(width, height)) {
size++;
}
// size must be of the form 2^j + 1 for some integer j
@@ -481,7 +481,7 @@ FreeImage_MultigridPoissonSolver(FIBITMAP *Laplacian, int ncycle) {
// allocate a temporary square image I
FIBITMAP *I = FreeImage_AllocateT(FIT_FLOAT, size, size);
- if(!I) return NULL;
+ if (!I) return NULL;
// copy Laplacian into I and shift pixels to create a boundary
FreeImage_Paste(I, Laplacian, 1, 1, 255);
diff --git a/plugins/FreeImage/Source/FreeImageToolkit/Rescale.cpp b/plugins/FreeImage/Source/FreeImageToolkit/Rescale.cpp
index d957d9cb5e..e79e5f456c 100644
--- a/plugins/FreeImage/Source/FreeImageToolkit/Rescale.cpp
+++ b/plugins/FreeImage/Source/FreeImageToolkit/Rescale.cpp
@@ -52,7 +52,7 @@ FreeImage_Rescale(FIBITMAP *src, int dst_width, int dst_height, FREE_IMAGE_FILTE
break;
}
- if(!pFilter) {
+ if (!pFilter) {
return NULL;
}
@@ -60,7 +60,7 @@ FreeImage_Rescale(FIBITMAP *src, int dst_width, int dst_height, FREE_IMAGE_FILTE
// perform upsampling or downsampling
- if((FreeImage_GetBPP(src) == 4) || (FreeImage_GetColorType(src) == FIC_PALETTE)) {
+ if ((FreeImage_GetBPP(src) == 4) || (FreeImage_GetColorType(src) == FIC_PALETTE)) {
// special case for 4-bit images or color map indexed images ...
if(FreeImage_IsTransparent(src) == FALSE) {
FIBITMAP *src24 = NULL;
@@ -68,10 +68,10 @@ FreeImage_Rescale(FIBITMAP *src, int dst_width, int dst_height, FREE_IMAGE_FILTE
try {
// transparent conversion to 24-bit (any transparency table will be destroyed)
src24 = FreeImage_ConvertTo24Bits(src);
- if(!src24) throw(1);
+ if (!src24) throw(1);
// perform upsampling or downsampling
dst24 = Engine.scale(src24, dst_width, dst_height);
- if(!dst24) throw(1);
+ if (!dst24) throw(1);
FreeImage_Unload(src24); src24 = NULL;
// color quantize to 8-bit
dst = FreeImage_ColorQuantize(dst24, FIQ_NNQUANT);
@@ -86,10 +86,10 @@ FreeImage_Rescale(FIBITMAP *src, int dst_width, int dst_height, FREE_IMAGE_FILTE
try {
// transparent conversion to 32-bit (keep transparency)
src32 = FreeImage_ConvertTo32Bits(src);
- if(!src32) throw(1);
+ if (!src32) throw(1);
// perform upsampling or downsampling
dst = Engine.scale(src32, dst_width, dst_height);
- if(!dst) throw(1);
+ if (!dst) throw(1);
// free and return
FreeImage_Unload(src32);
} catch(int) {
@@ -98,16 +98,16 @@ FreeImage_Rescale(FIBITMAP *src, int dst_width, int dst_height, FREE_IMAGE_FILTE
}
}
}
- else if((FreeImage_GetBPP(src) == 16) && (FreeImage_GetImageType(src) == FIT_BITMAP)) {
+ else if ((FreeImage_GetBPP(src) == 16) && (FreeImage_GetImageType(src) == FIT_BITMAP)) {
// convert 16-bit RGB to 24-bit
FIBITMAP *src24 = NULL;
try {
// transparent conversion to 24-bit (any transparency table will be destroyed)
src24 = FreeImage_ConvertTo24Bits(src);
- if(!src24) throw(1);
+ if (!src24) throw(1);
// perform upsampling or downsampling
dst = Engine.scale(src24, dst_width, dst_height);
- if(!dst) throw(1);
+ if (!dst) throw(1);
// free and return
FreeImage_Unload(src24);
} catch(int) {
@@ -137,14 +137,14 @@ FreeImage_MakeThumbnail(FIBITMAP *dib, int max_pixel_size, BOOL convert) {
FIBITMAP *thumbnail = NULL;
int new_width, new_height;
- if(!FreeImage_HasPixels(dib) || (max_pixel_size <= 0)) return NULL;
+ if (!FreeImage_HasPixels(dib) || (max_pixel_size <= 0)) return NULL;
int width = FreeImage_GetWidth(dib);
int height = FreeImage_GetHeight(dib);
if(max_pixel_size == 0) max_pixel_size = 1;
- if((width < max_pixel_size) && (height < max_pixel_size)) {
+ if ((width < max_pixel_size) && (height < max_pixel_size)) {
// image is smaller than the requested thumbnail
return FreeImage_Clone(dib);
}
@@ -192,7 +192,7 @@ FreeImage_MakeThumbnail(FIBITMAP *dib, int max_pixel_size, BOOL convert) {
break;
}
- if((thumbnail != NULL) && (image_type != FIT_BITMAP) && convert) {
+ if ((thumbnail != NULL) && (image_type != FIT_BITMAP) && convert) {
// convert to a standard bitmap
FIBITMAP *bitmap = NULL;
switch(image_type) {
diff --git a/plugins/FreeImage/Source/FreeImageToolkit/Resize.cpp b/plugins/FreeImage/Source/FreeImageToolkit/Resize.cpp
index 5dcec62af0..5421bd47ab 100644
--- a/plugins/FreeImage/Source/FreeImageToolkit/Resize.cpp
+++ b/plugins/FreeImage/Source/FreeImageToolkit/Resize.cpp
@@ -68,7 +68,7 @@ CWeightsTable::CWeightsTable(CGenericFilter *pFilter, unsigned uDstSize, unsigne
int iRight = MIN ((int)ceil (dCenter + dWidth), int(uSrcSize) - 1);
// cut edge points to fit in filter window in case of spill-off
- if((iRight - iLeft + 1) > int(m_WindowSize)) {
+ if ((iRight - iLeft + 1) > int(m_WindowSize)) {
if(iLeft < (int(uSrcSize) - 1 / 2)) {
iLeft++;
} else {
@@ -87,7 +87,7 @@ CWeightsTable::CWeightsTable(CGenericFilter *pFilter, unsigned uDstSize, unsigne
m_WeightTable[u].Weights[iSrc-iLeft] = weight;
dTotalWeight += weight;
}
- if((dTotalWeight > 0) && (dTotalWeight != 1)) {
+ if ((dTotalWeight > 0) && (dTotalWeight != 1)) {
// normalize weight of neighbouring points
for(iSrc = iLeft; iSrc <= iRight; iSrc++) {
// normalize point
@@ -149,7 +149,7 @@ FIBITMAP* CResizeEngine::scale(FIBITMAP *src, unsigned dst_width, unsigned dst_h
// allocate the dst image
FIBITMAP *dst = FreeImage_AllocateT(image_type, dst_width, dst_height, bpp, redMask, greenMask, blueMask);
- if(!dst) return NULL;
+ if (!dst) return NULL;
if(bpp == 8) {
if(FreeImage_GetColorType(src) == FIC_MINISWHITE) {
@@ -191,7 +191,7 @@ FIBITMAP* CResizeEngine::scale(FIBITMAP *src, unsigned dst_width, unsigned dst_h
// allocate a temporary image
FIBITMAP *tmp = FreeImage_AllocateT(image_type, dst_width, src_height, bpp, redMask, greenMask, blueMask);
- if(!tmp) {
+ if (!tmp) {
FreeImage_Unload(dst);
return NULL;
}
@@ -211,7 +211,7 @@ FIBITMAP* CResizeEngine::scale(FIBITMAP *src, unsigned dst_width, unsigned dst_h
// allocate a temporary image
FIBITMAP *tmp = FreeImage_AllocateT(image_type, src_width, dst_height, bpp, redMask, greenMask, blueMask);
- if(!tmp) {
+ if (!tmp) {
FreeImage_Unload(dst);
return NULL;
}
diff --git a/plugins/FreeImage/Source/LibPNG/pngrutil.c b/plugins/FreeImage/Source/LibPNG/pngrutil.c
index 7b4557f5a3..995896dbc5 100644
--- a/plugins/FreeImage/Source/LibPNG/pngrutil.c
+++ b/plugins/FreeImage/Source/LibPNG/pngrutil.c
@@ -3115,7 +3115,7 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
/* This can only be the RGB case, so each copy is exactly one
* pixel and it is not necessary to check for a partial copy.
*/
- for(;;)
+ for (;;)
{
dp[0] = sp[0], dp[1] = sp[1], dp[2] = sp[2];
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_color.c b/plugins/FreeImage/Source/LibTIFF/tif_color.c
index 06cc431a0a..f0302e4bf2 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_color.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_color.c
@@ -49,7 +49,7 @@ TIFFCIELabToXYZ(TIFFCIELabToRGB *cielab, uint32 l, int32 a, int32 b,
float L = (float)l * 100.0F / 255.0F;
float cby, tmp;
- if( L < 8.856F ) {
+ if ( L < 8.856F ) {
*Y = (L * cielab->Y0) / 903.292F;
cby = 7.787F * (*Y / cielab->Y0) + 16.0F / 116.0F;
} else {
@@ -58,13 +58,13 @@ TIFFCIELabToXYZ(TIFFCIELabToRGB *cielab, uint32 l, int32 a, int32 b,
}
tmp = (float)a / 500.0F + cby;
- if( tmp < 0.2069F )
+ if ( tmp < 0.2069F )
*X = cielab->X0 * (tmp - 0.13793F) / 7.787F;
else
*X = cielab->X0 * tmp * tmp * tmp;
tmp = cby - (float)b / 200.0F;
- if( tmp < 0.2069F )
+ if ( tmp < 0.2069F )
*Z = cielab->Z0 * (tmp - 0.13793F) / 7.787F;
else
*Z = cielab->Z0 * tmp * tmp * tmp;
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_dir.c b/plugins/FreeImage/Source/LibTIFF/tif_dir.c
index 7815857f21..081bb43c06 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_dir.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_dir.c
@@ -193,7 +193,7 @@ _TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap)
/*
* Setup new compression routine state.
*/
- if( (status = TIFFSetCompressionScheme(tif, v)) != 0 )
+ if ( (status = TIFFSetCompressionScheme(tif, v)) != 0 )
td->td_compression = (uint16) v;
else
status = 0;
@@ -341,11 +341,11 @@ _TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap)
td->td_sampleformat = (uint16) v;
/* Try to fix up the SWAB function for complex data. */
- if( td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT
+ if ( td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT
&& td->td_bitspersample == 32
&& tif->tif_postdecode == _TIFFSwab32BitData )
tif->tif_postdecode = _TIFFSwab16BitData;
- else if( (td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT
+ else if ( (td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT
|| td->td_sampleformat == SAMPLEFORMAT_COMPLEXIEEEFP)
&& td->td_bitspersample == 64
&& tif->tif_postdecode == _TIFFSwab64BitData )
@@ -388,7 +388,7 @@ _TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap)
s = va_arg(ap, char*);
v = checkInkNamesString(tif, v, s);
status = v > 0;
- if( v > 0 ) {
+ if ( v > 0 ) {
_TIFFsetNString(&td->td_inknames, s, v);
td->td_inknameslen = v;
}
@@ -839,7 +839,7 @@ _TIFFVGetField(TIFF* tif, ttag_t tag, va_list ap)
* the other. If the client tries to get a tag that is not valid
* for the image's codec then we'll arrive here.
*/
- if( fip == NULL || fip->field_bit != FIELD_CUSTOM )
+ if ( fip == NULL || fip->field_bit != FIELD_CUSTOM )
{
TIFFErrorExt(tif->tif_clientdata, "_TIFFVGetField",
"%s: Invalid %stag \"%s\" "
@@ -1008,7 +1008,7 @@ TIFFFreeDirectory(TIFF* tif)
TIFFClrFieldBit(tif, FIELD_YCBCRPOSITIONING);
/* Cleanup custom tag values */
- for( i = 0; i < td->td_customValueCount; i++ ) {
+ for ( i = 0; i < td->td_customValueCount; i++ ) {
if (td->td_customValues[i].value)
_TIFFfree(td->td_customValues[i].value);
}
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_dirinfo.c b/plugins/FreeImage/Source/LibTIFF/tif_dirinfo.c
index a2055f44a5..7b7507a8cb 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_dirinfo.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_dirinfo.c
@@ -831,7 +831,7 @@ _TIFFFindOrRegisterFieldInfo( TIFF *tif, ttag_t tag, TIFFDataType dt )
const TIFFFieldInfo *fld;
fld = _TIFFFindFieldInfo( tif, tag, dt );
- if( fld == NULL )
+ if ( fld == NULL )
{
fld = _TIFFCreateAnonFieldInfo( tif, tag, dt );
if (!_TIFFMergeFieldInfo(tif, fld, 1))
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_dirread.c b/plugins/FreeImage/Source/LibTIFF/tif_dirread.c
index 86d2fa87a9..3567b2ae51 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_dirread.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_dirread.c
@@ -991,7 +991,7 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
td->td_stripbytecount = (uint32*)
_TIFFCheckMalloc(tif, td->td_nstrips, sizeof (uint32),
"for \"StripByteCounts\" array");
- if( td->td_stripbytecount == NULL )
+ if ( td->td_stripbytecount == NULL )
return -1;
if (td->td_compression != COMPRESSION_NONE) {
@@ -1689,7 +1689,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp)
*/
cp = (char *)_TIFFCheckMalloc(tif, dp->tdir_count + 1,
1, mesg);
- if( (ok = (cp && TIFFFetchString(tif, dp, cp))) != 0 )
+ if ( (ok = (cp && TIFFFetchString(tif, dp, cp))) != 0 )
cp[dp->tdir_count] = '\0'; /* XXX */
break;
}
@@ -1762,7 +1762,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp)
case TIFF_ASCII:
case TIFF_UNDEFINED: /* bit of a cheat... */
{ char c[2];
- if( (ok = (TIFFFetchString(tif, dp, c) != 0)) != 0 ) {
+ if ( (ok = (TIFFFetchString(tif, dp, c) != 0)) != 0 ) {
c[1] = '\0'; /* XXX paranoid */
ok = (fip->field_passcount ?
TIFFSetField(tif, dp->tdir_tag, 1, c)
@@ -1797,7 +1797,7 @@ TIFFFetchPerSampleShorts(TIFF* tif, TIFFDirEntry* dir, uint16* pl)
if (v && TIFFFetchShortArray(tif, dir, v)) {
uint16 i;
int check_count = dir->tdir_count;
- if( samples < check_count )
+ if ( samples < check_count )
check_count = samples;
for (i = 1; i < check_count; i++)
@@ -1839,7 +1839,7 @@ TIFFFetchPerSampleLongs(TIFF* tif, TIFFDirEntry* dir, uint32* pl)
uint16 i;
int check_count = dir->tdir_count;
- if( samples < check_count )
+ if ( samples < check_count )
check_count = samples;
for (i = 1; i < check_count; i++)
if (v[i] != v[0]) {
@@ -1878,7 +1878,7 @@ TIFFFetchPerSampleAnys(TIFF* tif, TIFFDirEntry* dir, double* minv, double* maxv)
if (v && TIFFFetchAnyArray(tif, dir, v)) {
uint16 i;
int check_count = dir->tdir_count;
- if( samples < check_count )
+ if ( samples < check_count )
check_count = samples;
*minv = *maxv = v[0];
@@ -1928,17 +1928,17 @@ TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, long nstrips, uint32** lpp)
dir->tdir_count, sizeof (uint16), "to fetch strip tag");
if (dp == NULL)
return (0);
- if( (status = TIFFFetchShortArray(tif, dir, dp)) != 0 ) {
+ if ( (status = TIFFFetchShortArray(tif, dir, dp)) != 0 ) {
int i;
- for( i = 0; i < nstrips && i < (int) dir->tdir_count; i++ )
+ for ( i = 0; i < nstrips && i < (int) dir->tdir_count; i++ )
{
lp[i] = dp[i];
}
}
_TIFFfree((char*) dp);
- } else if( nstrips != (int) dir->tdir_count ) {
+ } else if ( nstrips != (int) dir->tdir_count ) {
/* Special case to correct length */
uint32* dp = (uint32*) _TIFFCheckMalloc(tif,
@@ -1947,10 +1947,10 @@ TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, long nstrips, uint32** lpp)
return (0);
status = TIFFFetchLongArray(tif, dir, dp);
- if( status != 0 ) {
+ if ( status != 0 ) {
int i;
- for( i = 0; i < nstrips && i < (int) dir->tdir_count; i++ )
+ for ( i = 0; i < nstrips && i < (int) dir->tdir_count; i++ )
{
lp[i] = dp[i];
}
@@ -1980,10 +1980,10 @@ TIFFFetchRefBlackWhite(TIFF* tif, TIFFDirEntry* dir)
*/
cp = (char *)_TIFFCheckMalloc(tif, dir->tdir_count,
sizeof (uint32), mesg);
- if( (ok = (cp && TIFFFetchLongArray(tif, dir, (uint32*) cp))) != 0) {
+ if ( (ok = (cp && TIFFFetchLongArray(tif, dir, (uint32*) cp))) != 0) {
float* fp = (float*)
_TIFFCheckMalloc(tif, dir->tdir_count, sizeof (float), mesg);
- if( (ok = (fp != NULL)) != 0 ) {
+ if ( (ok = (fp != NULL)) != 0 ) {
uint32 i;
for (i = 0; i < dir->tdir_count; i++)
fp[i] = (float)((uint32*) cp)[i];
@@ -2006,7 +2006,7 @@ TIFFFetchSubjectDistance(TIFF* tif, TIFFDirEntry* dir)
float v;
int ok = 0;
- if( dir->tdir_count != 1 || dir->tdir_type != TIFF_RATIONAL )
+ if ( dir->tdir_count != 1 || dir->tdir_type != TIFF_RATIONAL )
{
TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
"incorrect count or type for SubjectDistance, tag ignored" );
@@ -2064,7 +2064,7 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
if (rowsperstrip >= td->td_rowsperstrip)
return;
nstrips = (tstrip_t) TIFFhowmany(bytecount, stripbytes);
- if( nstrips == 0 ) /* something is wonky, do nothing. */
+ if ( nstrips == 0 ) /* something is wonky, do nothing. */
return;
newcounts = (uint32*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint32),
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_dirwrite.c b/plugins/FreeImage/Source/LibTIFF/tif_dirwrite.c
index 17b8002af4..962937298e 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_dirwrite.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_dirwrite.c
@@ -185,14 +185,14 @@ _TIFFWriteDirectory(TIFF* tif, int done)
* is set or not. For normal fields, we just use the
* FieldSet test.
*/
- if( fip->field_bit == FIELD_CUSTOM )
+ if ( fip->field_bit == FIELD_CUSTOM )
{
int ci, is_set = FALSE;
- for( ci = 0; ci < td->td_customValueCount; ci++ )
+ for ( ci = 0; ci < td->td_customValueCount; ci++ )
is_set |= (td->td_customValues[ci].info == fip);
- if( !is_set )
+ if ( !is_set )
continue;
}
else if (!FieldSet(fields, fip->field_bit))
@@ -352,7 +352,7 @@ _TIFFWriteDirectory(TIFF* tif, int done)
}
dir++;
- if( fip->field_bit != FIELD_CUSTOM )
+ if ( fip->field_bit != FIELD_CUSTOM )
ResetFieldBit(fields, fip->field_bit);
}
@@ -496,20 +496,20 @@ _TIFFWriteCustomDirectory(TIFF* tif, toff_t *pdiroff)
* is set or not. For normal fields, we just use the
* FieldSet test.
*/
- if( fip->field_bit == FIELD_CUSTOM )
+ if ( fip->field_bit == FIELD_CUSTOM )
{
int ci, is_set = FALSE;
- for( ci = 0; ci < td->td_customValueCount; ci++ )
+ for ( ci = 0; ci < td->td_customValueCount; ci++ )
is_set |= (td->td_customValues[ci].info == fip);
- if( !is_set )
+ if ( !is_set )
continue;
}
else if (!FieldSet(fields, fip->field_bit))
continue;
- if( fip->field_bit != FIELD_CUSTOM )
+ if ( fip->field_bit != FIELD_CUSTOM )
ResetFieldBit(fields, fip->field_bit);
}
@@ -718,7 +718,7 @@ TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip)
char* cp;
if (fip->field_passcount)
{
- if( wc == (uint16) TIFF_VARIABLE2 )
+ if ( wc == (uint16) TIFF_VARIABLE2 )
TIFFGetField(tif, fip->field_tag, &wc2, &cp);
else
TIFFGetField(tif, fip->field_tag, &wc, &cp);
@@ -1163,7 +1163,7 @@ TIFFWriteAnyArray(TIFF* tif,
break;
case TIFF_DOUBLE:
{
- if( !TIFFWriteDoubleArray(tif, dir, v))
+ if ( !TIFFWriteDoubleArray(tif, dir, v))
goto out;
}
break;
@@ -1270,7 +1270,7 @@ TIFFRewriteDirectory( TIFF *tif )
static const char module[] = "TIFFRewriteDirectory";
/* We don't need to do anything special if it hasn't been written. */
- if( tif->tif_diroff == 0 )
+ if ( tif->tif_diroff == 0 )
return TIFFWriteDirectory( tif );
/*
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_extension.c b/plugins/FreeImage/Source/LibTIFF/tif_extension.c
index b00d9ac2aa..e8fb4a2cac 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_extension.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_extension.c
@@ -46,7 +46,7 @@ ttag_t TIFFGetTagListEntry( TIFF *tif, int tag_index )
{
TIFFDirectory* td = &tif->tif_dir;
- if( tag_index < 0 || tag_index >= td->td_customValueCount )
+ if ( tag_index < 0 || tag_index >= td->td_customValueCount )
return (ttag_t) -1;
else
return td->td_customValues[tag_index].info->field_tag;
@@ -71,7 +71,7 @@ void *TIFFGetClientInfo( TIFF *tif, const char *name )
while( link != NULL && strcmp(link->name,name) != 0 )
link = link->next;
- if( link != NULL )
+ if ( link != NULL )
return link->data;
else
return NULL;
@@ -89,7 +89,7 @@ void TIFFSetClientInfo( TIFF *tif, void *data, const char *name )
while( link != NULL && strcmp(link->name,name) != 0 )
link = link->next;
- if( link != NULL )
+ if ( link != NULL )
{
link->data = data;
return;
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_fax3.c b/plugins/FreeImage/Source/LibTIFF/tif_fax3.c
index 047ba5d5aa..2e74a37c69 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_fax3.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_fax3.c
@@ -387,7 +387,7 @@ _TIFFFax3fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
*cp++ &= 0xff << (8-bx);
run -= 8-bx;
}
- if( (n = run >> 3) != 0 ) { /* multiple bytes to fill */
+ if ( (n = run >> 3) != 0 ) { /* multiple bytes to fill */
if ((n/sizeof (long)) > 1) {
/*
* Align to longword boundary and fill.
@@ -422,7 +422,7 @@ _TIFFFax3fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
*cp++ |= 0xff >> bx;
run -= 8-bx;
}
- if( (n = run>>3) != 0 ) { /* multiple bytes to fill */
+ if ( (n = run>>3) != 0 ) { /* multiple bytes to fill */
if ((n/sizeof (long)) > 1) {
/*
* Align to longword boundary and fill.
@@ -1454,7 +1454,7 @@ Fax4Decode(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
NeedBits16( 13, BADG4 );
BADG4:
#ifdef FAX3_DEBUG
- if( GetBits(13) != 0x1001 )
+ if ( GetBits(13) != 0x1001 )
fputs( "Bad EOFB\n", stderr );
#endif
ClrBits( 13 );
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_fax3.h b/plugins/FreeImage/Source/LibTIFF/tif_fax3.h
index c4e16c52d8..ec2811f660 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_fax3.h
+++ b/plugins/FreeImage/Source/LibTIFF/tif_fax3.h
@@ -360,7 +360,7 @@ static const char* StateNames[] = {
doneBlack1d: \
if (a0 >= lastx) \
goto done1d; \
- if( *(pa-1) == 0 && *(pa-2) == 0 ) \
+ if ( *(pa-1) == 0 && *(pa-2) == 0 ) \
pa -= 2; \
} \
eof1d: \
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_getimage.c b/plugins/FreeImage/Source/LibTIFF/tif_getimage.c
index 714d7e85e2..041e540cba 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_getimage.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_getimage.c
@@ -202,7 +202,7 @@ TIFFRGBAImageEnd(TIFFRGBAImage* img)
_TIFFfree(img->ycbcr), img->ycbcr = NULL;
if (img->cielab)
_TIFFfree(img->cielab), img->cielab = NULL;
- if( img->redcmap ) {
+ if ( img->redcmap ) {
_TIFFfree( img->redcmap );
_TIFFfree( img->greencmap );
_TIFFfree( img->bluecmap );
@@ -273,10 +273,10 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
}
#ifdef DEFAULT_EXTRASAMPLE_AS_ALPHA
- if( !TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &img->photometric))
+ if ( !TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &img->photometric))
img->photometric = PHOTOMETRIC_MINISWHITE;
- if( extrasamples == 0
+ if ( extrasamples == 0
&& img->samplesperpixel == 4
&& img->photometric == PHOTOMETRIC_RGB )
{
@@ -317,7 +317,7 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
img->redcmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color);
img->greencmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color);
img->bluecmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color);
- if( !img->redcmap || !img->greencmap || !img->bluecmap ) {
+ if ( !img->redcmap || !img->greencmap || !img->bluecmap ) {
sprintf(emsg, "Out of memory for colormap copy");
return (0);
}
@@ -1575,7 +1575,7 @@ static void putcontig8bitYCbCrGenericTile(
(void) y;
fromskew = (fromskew * group_size) / h_group;
- for( yy = 0; yy < h; yy++ )
+ for ( yy = 0; yy < h; yy++ )
{
unsigned char *pp_line;
int y_line_group = yy / v_group;
@@ -1584,7 +1584,7 @@ static void putcontig8bitYCbCrGenericTile(
pp_line = pp + v_line_group *
- for( xx = 0; xx < w; xx++ )
+ for ( xx = 0; xx < w; xx++ )
{
Cb = pp
}
@@ -1818,7 +1818,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr41tile)
pp += 6;
} while (--x);
- if( (w&3) != 0 )
+ if ( (w&3) != 0 )
{
int32 Cb = pp[4];
int32 Cr = pp[5];
@@ -1918,7 +1918,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr21tile)
pp += 4;
} while (--x);
- if( (w&1) != 0 )
+ if ( (w&1) != 0 )
{
int32 Cb = pp[2];
int32 Cr = pp[3];
@@ -2093,7 +2093,7 @@ makebwmap(TIFFRGBAImage* img)
int i;
uint32* p;
- if( nsamples == 0 )
+ if ( nsamples == 0 )
nsamples = 1;
img->BWmap = (uint32**) _TIFFmalloc(
@@ -2151,7 +2151,7 @@ setupMap(TIFFRGBAImage* img)
range = (int32)((1L<<img->bitspersample)-1);
/* treat 16 bit the same as eight bit */
- if( img->bitspersample == 16 )
+ if ( img->bitspersample == 16 )
range = (int32) 255;
img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue));
@@ -2528,7 +2528,7 @@ TIFFReadRGBAStrip(TIFF* tif, uint32 row, uint32 * raster )
int ok;
uint32 rowsperstrip, rows_to_read;
- if( TIFFIsTiled( tif ) )
+ if ( TIFFIsTiled( tif ) )
{
TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif),
"Can't use TIFFReadRGBAStrip() with tiled file.");
@@ -2536,7 +2536,7 @@ TIFFReadRGBAStrip(TIFF* tif, uint32 row, uint32 * raster )
}
TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
- if( (row % rowsperstrip) != 0 )
+ if ( (row % rowsperstrip) != 0 )
{
TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif),
"Row passed to TIFFReadRGBAStrip() must be first in a strip.");
@@ -2548,7 +2548,7 @@ TIFFReadRGBAStrip(TIFF* tif, uint32 row, uint32 * raster )
img.row_offset = row;
img.col_offset = 0;
- if( row + rowsperstrip > img.height )
+ if ( row + rowsperstrip > img.height )
rows_to_read = img.height - row;
else
rows_to_read = rowsperstrip;
@@ -2586,7 +2586,7 @@ TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster)
* tile boundary.
*/
- if( !TIFFIsTiled( tif ) )
+ if ( !TIFFIsTiled( tif ) )
{
TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif),
"Can't use TIFFReadRGBATile() with stripped file.");
@@ -2595,7 +2595,7 @@ TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster)
TIFFGetFieldDefaulted(tif, TIFFTAG_TILEWIDTH, &tile_xsize);
TIFFGetFieldDefaulted(tif, TIFFTAG_TILELENGTH, &tile_ysize);
- if( (col % tile_xsize) != 0 || (row % tile_ysize) != 0 )
+ if ( (col % tile_xsize) != 0 || (row % tile_ysize) != 0 )
{
TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif),
"Row/col passed to TIFFReadRGBATile() must be top"
@@ -2620,12 +2620,12 @@ TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster)
* a full tile configuration afterwards.
*/
- if( row + tile_ysize > img.height )
+ if ( row + tile_ysize > img.height )
read_ysize = img.height - row;
else
read_ysize = tile_ysize;
- if( col + tile_xsize > img.width )
+ if ( col + tile_xsize > img.width )
read_xsize = img.width - col;
else
read_xsize = tile_xsize;
@@ -2649,10 +2649,10 @@ TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster)
* bottom to top format.
*/
- if( read_xsize == tile_xsize && read_ysize == tile_ysize )
+ if ( read_xsize == tile_xsize && read_ysize == tile_ysize )
return( ok );
- for( i_row = 0; i_row < read_ysize; i_row++ ) {
+ for ( i_row = 0; i_row < read_ysize; i_row++ ) {
memmove( raster + (tile_ysize - i_row - 1) * tile_xsize,
raster + (read_ysize - i_row - 1) * read_xsize,
read_xsize * sizeof(uint32) );
@@ -2660,7 +2660,7 @@ TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster)
0, sizeof(uint32) * (tile_xsize - read_xsize) );
}
- for( i_row = read_ysize; i_row < tile_ysize; i_row++ ) {
+ for ( i_row = read_ysize; i_row < tile_ysize; i_row++ ) {
_TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize,
0, sizeof(uint32) * tile_xsize );
}
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_jpeg.c b/plugins/FreeImage/Source/LibTIFF/tif_jpeg.c
index 06062b3376..ee7d886fa8 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_jpeg.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_jpeg.c
@@ -888,7 +888,7 @@ JPEGDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
if (cc % sp->bytesperline)
TIFFWarningExt(tif->tif_clientdata, tif->tif_name, "fractional scanline not read");
- if( nrows > (int) sp->cinfo.d.image_height )
+ if ( nrows > (int) sp->cinfo.d.image_height )
nrows = sp->cinfo.d.image_height;
/* data is expected to be read in multiples of a scanline */
@@ -901,7 +901,7 @@ JPEGDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
** For Mk1 always use it.
*/
#if !defined(JPEG_LIB_MK1)
- if( sp->cinfo.d.data_precision == 12 )
+ if ( sp->cinfo.d.data_precision == 12 )
#endif
{
line_work_buf = (JSAMPROW)
@@ -910,7 +910,7 @@ JPEGDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
}
do {
- if( line_work_buf != NULL )
+ if ( line_work_buf != NULL )
{
/*
** In the MK1 case, we aways read into a 16bit buffer, and then
@@ -920,13 +920,13 @@ JPEGDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
if (TIFFjpeg_read_scanlines(sp, &line_work_buf, 1) != 1)
return (0);
- if( sp->cinfo.d.data_precision == 12 )
+ if ( sp->cinfo.d.data_precision == 12 )
{
int value_pairs = (sp->cinfo.d.output_width
* sp->cinfo.d.num_components) / 2;
int iPair;
- for( iPair = 0; iPair < value_pairs; iPair++ )
+ for ( iPair = 0; iPair < value_pairs; iPair++ )
{
unsigned char *out_ptr =
((unsigned char *) buf) + iPair * 3;
@@ -938,13 +938,13 @@ JPEGDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
out_ptr[2] = ((in_ptr[1] & 0xff) >> 0);
}
}
- else if( sp->cinfo.d.data_precision == 8 )
+ else if ( sp->cinfo.d.data_precision == 8 )
{
int value_count = (sp->cinfo.d.output_width
* sp->cinfo.d.num_components);
int iValue;
- for( iValue = 0; iValue < value_count; iValue++ )
+ for ( iValue = 0; iValue < value_count; iValue++ )
{
((unsigned char *) buf)[iValue] =
line_work_buf[iValue] & 0xff;
@@ -968,7 +968,7 @@ JPEGDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
cc -= sp->bytesperline;
} while (--nrows > 0);
- if( line_work_buf != NULL )
+ if ( line_work_buf != NULL )
_TIFFfree( line_work_buf );
}
@@ -992,7 +992,7 @@ JPEGDecodeRaw(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
if (cc % sp->bytesperline)
TIFFWarningExt(tif->tif_clientdata, tif->tif_name, "fractional scanline not read");
- if( nrows > (int) sp->cinfo.d.image_height )
+ if ( nrows > (int) sp->cinfo.d.image_height )
nrows = sp->cinfo.d.image_height;
/* data is expected to be read in multiples of a scanline */
@@ -1075,7 +1075,7 @@ JPEGDecodeRaw(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
int value_pairs = (sp->cinfo.d.output_width
* sp->cinfo.d.num_components) / 2;
int iPair;
- for( iPair = 0; iPair < value_pairs; iPair++ )
+ for ( iPair = 0; iPair < value_pairs; iPair++ )
{
unsigned char *out_ptr = ((unsigned char *) buf) + iPair * 3;
JSAMPLE *in_ptr = tmpbuf + iPair * 2;
@@ -1275,7 +1275,7 @@ JPEGSetupEncode(TIFF* tif)
/* Create a JPEGTables field if appropriate */
if (sp->jpegtablesmode & (JPEGTABLESMODE_QUANT|JPEGTABLESMODE_HUFF)) {
- if( sp->jpegtables == NULL
+ if ( sp->jpegtables == NULL
|| memcmp(sp->jpegtables,"\0\0\0\0\0\0\0\0\0",8) == 0 )
{
if (!prepare_JPEGTables(tif))
@@ -1443,7 +1443,7 @@ JPEGEncode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
TIFFWarningExt(tif->tif_clientdata, tif->tif_name, "fractional scanline discarded");
/* The last strip will be limited to image size */
- if( !isTiled(tif) && tif->tif_row+nrows > tif->tif_dir.td_imagelength )
+ if ( !isTiled(tif) && tif->tif_row+nrows > tif->tif_dir.td_imagelength )
nrows = tif->tif_dir.td_imagelength - tif->tif_row;
while (nrows-- > 0) {
@@ -1591,7 +1591,7 @@ JPEGCleanup(TIFF* tif)
tif->tif_tagmethods.vsetfield = sp->vsetparent;
tif->tif_tagmethods.printdir = sp->printdir;
- if( sp->cinfo_initialized )
+ if ( sp->cinfo_initialized )
TIFFjpeg_destroy(sp); /* release libjpeg resources */
if (sp->jpegtables) /* tag value */
_TIFFfree(sp->jpegtables);
@@ -1630,7 +1630,7 @@ JPEGResetUpsampled( TIFF* tif )
* Must recalculate cached tile size in case sampling state changed.
* Should we really be doing this now if image size isn't set?
*/
- if( tif->tif_tilesize > 0 )
+ if ( tif->tif_tilesize > 0 )
tif->tif_tilesize = isTiled(tif) ? TIFFTileSize(tif) : (tsize_t) -1;
if(tif->tif_scanlinesize > 0 )
@@ -1750,20 +1750,20 @@ JPEGFixupTestSubsampling( TIFF * tif )
* this we actually have to scan the header of a strip or tile of
* jpeg data to get the sampling.
*/
- if( !sp->cinfo.comm.is_decompressor
+ if ( !sp->cinfo.comm.is_decompressor
|| sp->ycbcrsampling_fetched
|| td->td_photometric != PHOTOMETRIC_YCBCR )
return;
sp->ycbcrsampling_fetched = 1;
- if( TIFFIsTiled( tif ) )
+ if ( TIFFIsTiled( tif ) )
{
- if( !TIFFFillTile( tif, 0 ) )
+ if ( !TIFFFillTile( tif, 0 ) )
return;
}
else
{
- if( !TIFFFillStrip( tif, 0 ) )
+ if ( !TIFFFillStrip( tif, 0 ) )
return;
}
@@ -1900,9 +1900,9 @@ static int JPEGInitializeLibJPEG( TIFF * tif, int force_encode, int force_decode
if(sp->cinfo_initialized)
{
- if( force_encode && sp->cinfo.comm.is_decompressor )
+ if ( force_encode && sp->cinfo.comm.is_decompressor )
TIFFjpeg_destroy( sp );
- else if( force_decode && !sp->cinfo.comm.is_decompressor )
+ else if ( force_decode && !sp->cinfo.comm.is_decompressor )
TIFFjpeg_destroy( sp );
else
return 1;
@@ -1915,26 +1915,26 @@ static int JPEGInitializeLibJPEG( TIFF * tif, int force_encode, int force_decode
* the state in decompressor mode if we have tile data, even if we
* are not in read-only file access mode.
*/
- if( TIFFIsTiled( tif )
+ if ( TIFFIsTiled( tif )
&& TIFFGetField( tif, TIFFTAG_TILEBYTECOUNTS, &byte_counts )
&& byte_counts != NULL )
{
data_is_empty = byte_counts[0] == 0;
}
- if( !TIFFIsTiled( tif )
+ if ( !TIFFIsTiled( tif )
&& TIFFGetField( tif, TIFFTAG_STRIPBYTECOUNTS, &byte_counts)
&& byte_counts != NULL )
{
data_is_empty = byte_counts[0] == 0;
}
- if( force_decode )
+ if ( force_decode )
decompress = 1;
- else if( force_encode )
+ else if ( force_encode )
decompress = 0;
- else if( tif->tif_mode == O_RDONLY )
+ else if ( tif->tif_mode == O_RDONLY )
decompress = 1;
- else if( data_is_empty )
+ else if ( data_is_empty )
decompress = 0;
else
decompress = 1;
@@ -2040,7 +2040,7 @@ TIFFInitJPEG(TIFF* tif, int scheme)
** the JPEGTables field. It will be properly created the right
** size later.
*/
- if( tif->tif_diroff == 0 )
+ if ( tif->tif_diroff == 0 )
{
#define SIZE_OF_JPEGTABLES 2000
/*
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_luv.c b/plugins/FreeImage/Source/LibTIFF/tif_luv.c
index 153900701e..5e72ca63ba 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_luv.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_luv.c
@@ -1200,7 +1200,7 @@ LogL16InitState(TIFF* tif)
"No support for converting user data format to LogL");
return (0);
}
- if( isTiled(tif) )
+ if ( isTiled(tif) )
sp->tbuflen = multiply(td->td_tilewidth, td->td_tilelength);
else
sp->tbuflen = multiply(td->td_imagewidth, td->td_rowsperstrip);
@@ -1301,7 +1301,7 @@ LogLuvInitState(TIFF* tif)
"No support for converting user data format to LogLuv");
return (0);
}
- if( isTiled(tif) )
+ if ( isTiled(tif) )
sp->tbuflen = multiply(td->td_tilewidth, td->td_tilelength);
else
sp->tbuflen = multiply(td->td_imagewidth, td->td_rowsperstrip);
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_lzw.c b/plugins/FreeImage/Source/LibTIFF/tif_lzw.c
index 97105be1eb..16fcd7f9a7 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_lzw.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_lzw.c
@@ -195,7 +195,7 @@ LZWSetupDecode(TIFF* tif)
static const char module[] = " LZWSetupDecode";
int code;
- if( sp == NULL )
+ if ( sp == NULL )
{
/*
* Allocate state block so tag methods have storage to record
@@ -257,7 +257,7 @@ LZWPreDecode(TIFF* tif, tsample_t s)
(void) s;
assert(sp != NULL);
- if( sp->dec_codetab == NULL )
+ if ( sp->dec_codetab == NULL )
{
tif->tif_setupdecode( tif );
}
@@ -764,7 +764,7 @@ LZWPreEncode(TIFF* tif, tsample_t s)
(void) s;
assert(sp != NULL);
- if( sp->enc_hashtab == NULL )
+ if ( sp->enc_hashtab == NULL )
{
tif->tif_setupencode( tif );
}
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_packbits.c b/plugins/FreeImage/Source/LibTIFF/tif_packbits.c
index 52206ee322..1fc96d13a2 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_packbits.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_packbits.c
@@ -203,7 +203,7 @@ PackBitsEncodeChunk(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
while ((long)cc > 0) {
int chunk = rowsize;
- if( cc < chunk )
+ if ( cc < chunk )
chunk = cc;
if (PackBitsEncode(tif, bp, chunk, s) < 0)
@@ -237,7 +237,7 @@ PackBitsDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s)
if (n == -128) /* nop */
continue;
n = -n + 1;
- if( occ < n )
+ if ( occ < n )
{
TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
"PackBitsDecode: discarding %ld bytes "
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_predict.c b/plugins/FreeImage/Source/LibTIFF/tif_predict.c
index 4f477ab7ea..7f7dc636be 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_predict.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_predict.c
@@ -117,7 +117,7 @@ PredictorSetupDecode(TIFF* tif)
* Override default decoding method with one that does the
* predictor stuff.
*/
- if( tif->tif_decoderow != PredictorDecodeRow )
+ if ( tif->tif_decoderow != PredictorDecodeRow )
{
sp->decoderow = tif->tif_decoderow;
tif->tif_decoderow = PredictorDecodeRow;
@@ -150,7 +150,7 @@ PredictorSetupDecode(TIFF* tif)
* Override default decoding method with one that does the
* predictor stuff.
*/
- if( tif->tif_decoderow != PredictorDecodeRow )
+ if ( tif->tif_decoderow != PredictorDecodeRow )
{
sp->decoderow = tif->tif_decoderow;
tif->tif_decoderow = PredictorDecodeRow;
@@ -195,7 +195,7 @@ PredictorSetupEncode(TIFF* tif)
* Override default encoding method with one that does the
* predictor stuff.
*/
- if( tif->tif_encoderow != PredictorEncodeRow )
+ if ( tif->tif_encoderow != PredictorEncodeRow )
{
sp->encoderow = tif->tif_encoderow;
tif->tif_encoderow = PredictorEncodeRow;
@@ -212,7 +212,7 @@ PredictorSetupEncode(TIFF* tif)
* Override default encoding method with one that does the
* predictor stuff.
*/
- if( tif->tif_encoderow != PredictorEncodeRow )
+ if ( tif->tif_encoderow != PredictorEncodeRow )
{
sp->encoderow = tif->tif_encoderow;
tif->tif_encoderow = PredictorEncodeRow;
@@ -580,7 +580,7 @@ PredictorEncodeTile(TIFF* tif, tidata_t bp0, tsize_t cc0, tsample_t s)
* the callers buffer. http://trac.osgeo.org/gdal/ticket/1965
*/
working_copy = (uint8*) _TIFFmalloc(cc0);
- if( working_copy == NULL )
+ if ( working_copy == NULL )
{
TIFFErrorExt(tif->tif_clientdata, module,
"Out of memory allocating %d byte temp buffer.",
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_read.c b/plugins/FreeImage/Source/LibTIFF/tif_read.c
index 5618e63e6e..351a1b058d 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_read.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_read.c
@@ -99,7 +99,7 @@ TIFFReadScanline(TIFF* tif, tdata_t buf, uint32 row, tsample_t sample)
if (!TIFFCheckRead(tif, 0))
return (-1);
- if( (e = TIFFSeek(tif, row, sample)) != 0) {
+ if ( (e = TIFFSeek(tif, row, sample)) != 0) {
/*
* Decompress desired row into user buffer.
*/
@@ -141,7 +141,7 @@ TIFFReadEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size)
* rows in the strip (check for truncated last strip on any
* of the separations).
*/
- if( td->td_rowsperstrip >= td->td_imagelength )
+ if ( td->td_rowsperstrip >= td->td_imagelength )
strips_per_sep = 1;
else
strips_per_sep = (td->td_imagelength+td->td_rowsperstrip-1)
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_thunder.c b/plugins/FreeImage/Source/LibTIFF/tif_thunder.c
index 6439c54e42..b8c6cc93cc 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_thunder.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_thunder.c
@@ -72,7 +72,7 @@ ThunderSetupDecode(TIFF* tif)
{
static const char module[] = "ThunderSetupDecode";
- if( tif->tif_dir.td_bitspersample != 4 )
+ if ( tif->tif_dir.td_bitspersample != 4 )
{
TIFFErrorExt(tif->tif_clientdata, module,
"Wrong bitspersample value (%d), Thunder decoder only supports 4bits per sample.",
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_unix.c b/plugins/FreeImage/Source/LibTIFF/tif_unix.c
index f693df7653..7e294cb78b 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_unix.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_unix.c
@@ -176,7 +176,7 @@ TIFFOpen(const char* name, const char* mode)
}
tif = TIFFFdOpen((int)fd, name, mode);
- if(!tif)
+ if (!tif)
close(fd);
return tif;
}
@@ -229,7 +229,7 @@ TIFFOpenW(const wchar_t* name, const char* mode)
_TIFFfree(mbname);
- if(!tif)
+ if (!tif)
close(fd);
return tif;
}
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_win32.c b/plugins/FreeImage/Source/LibTIFF/tif_win32.c
index ddfd778ead..5b3875901d 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_win32.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_win32.c
@@ -210,7 +210,7 @@ TIFFOpen(const char* name, const char* mode)
}
tif = TIFFFdOpen((int)fd, name, mode);
- if(!tif)
+ if (!tif)
CloseHandle(fd);
return tif;
}
@@ -266,7 +266,7 @@ TIFFOpenW(const wchar_t* name, const char* mode)
tif = TIFFFdOpen((int)fd,
(mbname != NULL) ? mbname : "<unknown>", mode);
- if(!tif)
+ if (!tif)
CloseHandle(fd);
_TIFFfree(mbname);
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_write.c b/plugins/FreeImage/Source/LibTIFF/tif_write.c
index 067d3f76fe..043e645b87 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_write.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_write.c
@@ -124,7 +124,7 @@ TIFFWriteScanline(TIFF* tif, tdata_t buf, uint32 row, tsample_t sample)
tif->tif_rawcc = 0;
tif->tif_rawcp = tif->tif_rawdata;
- if( td->td_stripbytecount[strip] > 0 )
+ if ( td->td_stripbytecount[strip] > 0 )
{
/* if we are writing over existing tiles, zero length */
td->td_stripbytecount[strip] = 0;
@@ -225,7 +225,7 @@ TIFFWriteEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t data, tsize_t cc)
tif->tif_rawcc = 0;
tif->tif_rawcp = tif->tif_rawdata;
- if( td->td_stripbytecount[strip] > 0 )
+ if ( td->td_stripbytecount[strip] > 0 )
{
/* Force TIFFAppendToStrip() to consider placing data at end
of file. */
@@ -359,7 +359,7 @@ TIFFWriteEncodedTile(TIFF* tif, ttile_t tile, tdata_t data, tsize_t cc)
tif->tif_rawcc = 0;
tif->tif_rawcp = tif->tif_rawdata;
- if( td->td_stripbytecount[tile] > 0 )
+ if ( td->td_stripbytecount[tile] > 0 )
{
/* Force TIFFAppendToStrip() to consider placing data at end
of file. */
@@ -628,7 +628,7 @@ TIFFAppendToStrip(TIFF* tif, tstrip_t strip, tidata_t data, tsize_t cc)
if (td->td_stripoffset[strip] == 0 || tif->tif_curoff == 0) {
assert(td->td_nstrips > 0);
- if( td->td_stripbytecount[strip] != 0
+ if ( td->td_stripbytecount[strip] != 0
&& td->td_stripoffset[strip] != 0
&& td->td_stripbytecount[strip] >= cc )
{
diff --git a/plugins/FreeImage/Source/LibTIFF/tif_zip.c b/plugins/FreeImage/Source/LibTIFF/tif_zip.c
index 818b9dde09..74ee9c4b5a 100644
--- a/plugins/FreeImage/Source/LibTIFF/tif_zip.c
+++ b/plugins/FreeImage/Source/LibTIFF/tif_zip.c
@@ -118,7 +118,7 @@ ZIPPreDecode(TIFF* tif, tsample_t s)
(void) s;
assert(sp != NULL);
- if( (sp->state & ZSTATE_INIT_DECODE) == 0 )
+ if ( (sp->state & ZSTATE_INIT_DECODE) == 0 )
tif->tif_setupdecode( tif );
sp->stream.next_in = tif->tif_rawdata;
@@ -196,7 +196,7 @@ ZIPPreEncode(TIFF* tif, tsample_t s)
(void) s;
assert(sp != NULL);
- if( sp->state != ZSTATE_INIT_ENCODE )
+ if ( sp->state != ZSTATE_INIT_ENCODE )
tif->tif_setupencode( tif );
sp->stream.next_out = tif->tif_rawdata;
@@ -285,7 +285,7 @@ ZIPCleanup(TIFF* tif)
if (sp->state & ZSTATE_INIT_ENCODE) {
deflateEnd(&sp->stream);
sp->state = 0;
- } else if( sp->state & ZSTATE_INIT_DECODE) {
+ } else if ( sp->state & ZSTATE_INIT_DECODE) {
inflateEnd(&sp->stream);
sp->state = 0;
}
diff --git a/plugins/FreeImage/Source/Metadata/Exif.cpp b/plugins/FreeImage/Source/Metadata/Exif.cpp
index ed667b0974..7d0955c5db 100644
--- a/plugins/FreeImage/Source/Metadata/Exif.cpp
+++ b/plugins/FreeImage/Source/Metadata/Exif.cpp
@@ -69,7 +69,7 @@ static int
FreeImage_strnicmp(const char *s1, const char *s2, size_t len) {
unsigned char c1, c2;
- if(!s1 || !s2) return -1;
+ if (!s1 || !s2) return -1;
c1 = 0; c2 = 0;
if(len) {
@@ -182,7 +182,7 @@ processMakerNote(FIBITMAP *dib, char *pval, BOOL msb_order, DWORD *subdirOffset,
FreeImage_GetMetadata(FIMD_EXIF_MAIN, dib, "Make", &tagMake);
const char *Maker = (char*)FreeImage_GetTagValue(tagMake);
- if((memcmp("OLYMP\x00\x01", pval, 7) == 0) || (memcmp("OLYMP\x00\x02", pval, 7) == 0) || (memcmp("EPSON", pval, 5) == 0) || (memcmp("AGFA", pval, 4) == 0)) {
+ if ((memcmp("OLYMP\x00\x01", pval, 7) == 0) || (memcmp("OLYMP\x00\x02", pval, 7) == 0) || (memcmp("EPSON", pval, 5) == 0) || (memcmp("AGFA", pval, 4) == 0)) {
// Olympus Type 1 Makernote
// Epson and Agfa use Olympus maker note standard,
// see: http://www.ozhiker.com/electronics/pjmt/jpeg_info/
@@ -280,11 +280,11 @@ processMakerNote(FIBITMAP *dib, char *pval, BOOL msb_order, DWORD *subdirOffset,
*subdirOffset = 0;
}
}
- else if((memcmp("SONY CAM\x20\x00\x00\x00", pval, 12) == 0) || (memcmp("SONY DSC\x20\x00\x00\x00", pval, 12) == 0)) {
+ else if ((memcmp("SONY CAM\x20\x00\x00\x00", pval, 12) == 0) || (memcmp("SONY DSC\x20\x00\x00\x00", pval, 12) == 0)) {
*md_model = TagLib::EXIF_MAKERNOTE_SONY;
*subdirOffset = 12;
}
- else if((memcmp("SIGMA\x00\x00\x00", pval, 8) == 0) || (memcmp("FOVEON\x00\x00", pval, 8) == 0)) {
+ else if ((memcmp("SIGMA\x00\x00\x00", pval, 8) == 0) || (memcmp("FOVEON\x00\x00", pval, 8) == 0)) {
FITAG *tagModel = NULL;
FreeImage_GetMetadata(FIMD_EXIF_MAIN, dib, "Model", &tagModel);
const char *Model = (char*)FreeImage_GetTagValue(tagModel);
@@ -365,7 +365,7 @@ processCanonMakerNoteTag(FIBITMAP *dib, FITAG *tag) {
// create a tag
FITAG *canonTag = FreeImage_CreateTag();
- if(!canonTag) return FALSE;
+ if (!canonTag) return FALSE;
// we intentionally skip the first array member (if needed)
for (DWORD i = startIndex; i < FreeImage_GetTagCount(tag); i++) {
@@ -560,7 +560,7 @@ jpeg_read_exif_dir(FIBITMAP *dib, const BYTE *tiffp, unsigned long offset, unsig
do {
// if there is anything on the stack then pop it off
- if(!destack.empty()) {
+ if (!destack.empty()) {
ifdp = ifdstack.top(); ifdstack.pop();
de = destack.top(); destack.pop();
md_model = modelstack.top(); modelstack.pop();
@@ -577,13 +577,13 @@ jpeg_read_exif_dir(FIBITMAP *dib, const BYTE *tiffp, unsigned long offset, unsig
// determine how many entries there are in the current IFD
nde = ReadUint16(msb_order, ifdp);
- for(; de < nde; de++) {
+ for (; de < nde; de++) {
char *pde = NULL; // pointer to the directory entry
char *pval = NULL; // pointer to the tag value
// create a tag
FITAG *tag = FreeImage_CreateTag();
- if(!tag) return FALSE;
+ if (!tag) return FALSE;
// point to the directory entry
pde = (char*) DIR_ENTRY_ADDR(ifdp, de);
@@ -592,7 +592,7 @@ jpeg_read_exif_dir(FIBITMAP *dib, const BYTE *tiffp, unsigned long offset, unsig
FreeImage_SetTagID(tag, ReadUint16(msb_order, pde));
// get the tag type
WORD tag_type = (WORD)ReadUint16(msb_order, pde + 2);
- if((tag_type - 1) >= EXIF_NUM_FORMATS) {
+ if ((tag_type - 1) >= EXIF_NUM_FORMATS) {
// a problem occured : delete the tag (not free'd after)
FreeImage_DeleteTag(tag);
// break out of the for loop
@@ -658,7 +658,7 @@ jpeg_read_exif_dir(FIBITMAP *dib, const BYTE *tiffp, unsigned long offset, unsig
next_ifd = (BYTE*)tiffp + sub_offset;
}
- if((sub_offset < (DWORD) length) && (next_mdmodel != TagLib::UNKNOWN)) {
+ if ((sub_offset < (DWORD) length) && (next_mdmodel != TagLib::UNKNOWN)) {
// push our current directory state onto the stack
ifdstack.push(ifdp);
// bump to the next entry
@@ -675,7 +675,7 @@ jpeg_read_exif_dir(FIBITMAP *dib, const BYTE *tiffp, unsigned long offset, unsig
// select a new metadata model
modelstack.push(next_mdmodel);
- // delete the tag as it won't be stored nor deleted in the for() loop
+ // delete the tag as it won't be stored nor deleted in the for () loop
FreeImage_DeleteTag(tag);
break; // break out of the for loop
@@ -707,7 +707,7 @@ jpeg_read_exif_dir(FIBITMAP *dib, const BYTE *tiffp, unsigned long offset, unsig
const WORD entriesCount0th = ReadUint16(msb_order, ifd0th);
DWORD next_offset = ReadUint32(msb_order, DIR_ENTRY_ADDR(ifd0th, entriesCount0th));
- if((next_offset == 0) || (next_offset >= length)) {
+ if ((next_offset == 0) || (next_offset >= length)) {
return TRUE; //< no thumbnail
}
@@ -763,7 +763,7 @@ jpeg_read_exif_dir(FIBITMAP *dib, const BYTE *tiffp, unsigned long offset, unsig
}
}
- if(/*thCompression != 6 ||*/ thOffset == 0 || thSize == 0) {
+ if (/*thCompression != 6 ||*/ thOffset == 0 || thSize == 0) {
return TRUE;
}
diff --git a/plugins/FreeImage/Source/Metadata/FreeImageTag.cpp b/plugins/FreeImage/Source/Metadata/FreeImageTag.cpp
index 5d9f3034ec..84e15d0822 100644
--- a/plugins/FreeImage/Source/Metadata/FreeImageTag.cpp
+++ b/plugins/FreeImage/Source/Metadata/FreeImageTag.cpp
@@ -81,11 +81,11 @@ FreeImage_DeleteTag(FITAG *tag) {
FITAG * DLL_CALLCONV
FreeImage_CloneTag(FITAG *tag) {
- if(!tag) return NULL;
+ if (!tag) return NULL;
// allocate a new tag
FITAG *clone = FreeImage_CreateTag();
- if(!clone) return NULL;
+ if (!clone) return NULL;
try {
// copy the tag
@@ -97,7 +97,7 @@ FreeImage_CloneTag(FITAG *tag) {
// tag key
if(src_tag->key) {
dst_tag->key = (char*)malloc((strlen(src_tag->key) + 1) * sizeof(char));
- if(!dst_tag->key) {
+ if (!dst_tag->key) {
throw FI_MSG_ERROR_MEMORY;
}
strcpy(dst_tag->key, src_tag->key);
@@ -105,7 +105,7 @@ FreeImage_CloneTag(FITAG *tag) {
// tag description
if(src_tag->description) {
dst_tag->description = (char*)malloc((strlen(src_tag->description) + 1) * sizeof(char));
- if(!dst_tag->description) {
+ if (!dst_tag->description) {
throw FI_MSG_ERROR_MEMORY;
}
strcpy(dst_tag->description, src_tag->description);
@@ -118,7 +118,7 @@ FreeImage_CloneTag(FITAG *tag) {
dst_tag->length = src_tag->length;
// tag value
dst_tag->value = (BYTE*)malloc(src_tag->length * sizeof(BYTE));
- if(!dst_tag->value) {
+ if (!dst_tag->value) {
throw FI_MSG_ERROR_MEMORY;
}
memcpy(dst_tag->value, src_tag->value, src_tag->length);
@@ -253,7 +253,7 @@ FreeImage_SetTagValue(FITAG *tag, const void *value) {
case FIDT_ASCII:
{
tag_header->value = (char*)malloc((tag_header->length + 1) * sizeof(char));
- if(!tag_header->value) {
+ if (!tag_header->value) {
return FALSE;
}
char *src_data = (char*)value;
@@ -267,7 +267,7 @@ FreeImage_SetTagValue(FITAG *tag, const void *value) {
default:
tag_header->value = malloc(tag_header->length * sizeof(BYTE));
- if(!tag_header->value) {
+ if (!tag_header->value) {
return FALSE;
}
memcpy(tag_header->value, value, tag_header->length);
diff --git a/plugins/FreeImage/Source/Metadata/IPTC.cpp b/plugins/FreeImage/Source/Metadata/IPTC.cpp
index 1aba46c094..817beddf98 100644
--- a/plugins/FreeImage/Source/Metadata/IPTC.cpp
+++ b/plugins/FreeImage/Source/Metadata/IPTC.cpp
@@ -46,7 +46,7 @@ read_iptc_profile(FIBITMAP *dib, const BYTE *dataptr, unsigned int datalen) {
WORD tag_id;
- if(!dataptr || (datalen == 0)) {
+ if (!dataptr || (datalen == 0)) {
return FALSE;
}
@@ -59,7 +59,7 @@ read_iptc_profile(FIBITMAP *dib, const BYTE *dataptr, unsigned int datalen) {
// find start of the BIM portion of the binary data
size_t offset = 0;
while(offset < length - 1) {
- if((profile[offset] == 0x1C) && (profile[offset+1] == 0x02))
+ if ((profile[offset] == 0x1C) && (profile[offset+1] == 0x02))
break;
offset++;
}
@@ -211,7 +211,7 @@ append_iptc_tag(BYTE *profile, unsigned *profile_size, WORD id, DWORD length, co
// calculate the new buffer size
size_t buffer_size = (5 + *profile_size + length) * sizeof(BYTE);
buffer = (BYTE*)malloc(buffer_size);
- if(!buffer)
+ if (!buffer)
return NULL;
// add the header
diff --git a/plugins/FreeImage/Source/Metadata/TagConversion.cpp b/plugins/FreeImage/Source/Metadata/TagConversion.cpp
index 041ba9a747..7b91598014 100644
--- a/plugins/FreeImage/Source/Metadata/TagConversion.cpp
+++ b/plugins/FreeImage/Source/Metadata/TagConversion.cpp
@@ -39,7 +39,7 @@ ConvertAnyTag(FITAG *tag) {
static std::string buffer;
DWORD i;
- if(!tag)
+ if (!tag)
return NULL;
buffer.erase();
@@ -259,7 +259,7 @@ ConvertExifTag(FITAG *tag) {
char format[MAX_TEXT_EXTENT];
static std::string buffer;
- if(!tag)
+ if (!tag)
return NULL;
buffer.erase();
@@ -993,7 +993,7 @@ ConvertExifGPSTag(FITAG *tag) {
char format[MAX_TEXT_EXTENT];
static std::string buffer;
- if(!tag)
+ if (!tag)
return NULL;
buffer.erase();
diff --git a/plugins/FreeImage/Source/Metadata/TagLib.cpp b/plugins/FreeImage/Source/Metadata/TagLib.cpp
index 123d860041..eff291beab 100644
--- a/plugins/FreeImage/Source/Metadata/TagLib.cpp
+++ b/plugins/FreeImage/Source/Metadata/TagLib.cpp
@@ -1478,14 +1478,14 @@ TagLib::TagLib() {
BOOL TagLib::addMetadataModel(MDMODEL md_model, TagInfo *tag_table) {
// check that the model doesn't already exist
- if((_table_map.find(md_model) == _table_map.end()) && (tag_table != NULL)) {
+ if ((_table_map.find(md_model) == _table_map.end()) && (tag_table != NULL)) {
// add the tag description table
TAGINFO *info_map = new(std::nothrow) TAGINFO();
- if(!info_map) return FALSE;
+ if (!info_map) return FALSE;
for(int i = 0; ; i++) {
- if((tag_table[i].tag == 0) && (tag_table[i].fieldname == NULL))
+ if ((tag_table[i].tag == 0) && (tag_table[i].fieldname == NULL))
break;
(*info_map)[tag_table[i].tag] = &tag_table[i];
}
diff --git a/plugins/FreeImage/Source/Metadata/XTIFF.cpp b/plugins/FreeImage/Source/Metadata/XTIFF.cpp
index c6ec5ba858..bc63cf38b2 100644
--- a/plugins/FreeImage/Source/Metadata/XTIFF.cpp
+++ b/plugins/FreeImage/Source/Metadata/XTIFF.cpp
@@ -123,7 +123,7 @@ tiff_read_geotiff_profile(TIFF *tif, FIBITMAP *dib) {
if(TIFFGetField(tif, fieldInfo->field_tag, &params)) {
// create a tag
FITAG *tag = FreeImage_CreateTag();
- if(!tag)
+ if (!tag)
return;
WORD tag_id = (WORD)fieldInfo->field_tag;
@@ -147,7 +147,7 @@ tiff_read_geotiff_profile(TIFF *tif, FIBITMAP *dib) {
if(TIFFGetField(tif, fieldInfo->field_tag, &tag_count, &data)) {
// create a tag
FITAG *tag = FreeImage_CreateTag();
- if(!tag)
+ if (!tag)
return;
WORD tag_id = (WORD)fieldInfo->field_tag;
@@ -315,7 +315,7 @@ tiff_read_exif_tag(TIFF *tif, TagLib::MDMODEL md_model, FIBITMAP *dib, TagLib& t
// build FreeImage tag from Tiff Tag data we collected
FITAG *fitag = FreeImage_CreateTag();
- if(!fitag) {
+ if (!fitag) {
if(mem_alloc) {
_TIFFfree(raw_data);
}
@@ -514,18 +514,18 @@ tiff_read_exif_tags(TIFF *tif, TagLib::MDMODEL md_model, FIBITMAP *dib) {
// test if tag value is set
// (lifted directly form LibTiff _TIFFWriteDirectory)
- if( fld->field_bit == FIELD_CUSTOM ) {
+ if ( fld->field_bit == FIELD_CUSTOM ) {
int ci, is_set = FALSE;
- for( ci = 0; ci < td->td_customValueCount; ci++ ) {
+ for ( ci = 0; ci < td->td_customValueCount; ci++ ) {
is_set |= (td->td_customValues[ci].info == fld);
}
- if( !is_set ) {
+ if ( !is_set ) {
continue;
}
- } else if(!TIFFFieldSet(tif, fld->field_bit)) {
+ } else if (!TIFFFieldSet(tif, fld->field_bit)) {
continue;
}
@@ -639,7 +639,7 @@ tiff_write_exif_tags(TIFF *tif, TagLib::MDMODEL md_model, FIBITMAP *dib) {
// check for identical formats
// (enum value are the sames between FREE_IMAGE_MDTYPE and TIFFDataType types)
- if((int)tif_tag_type != (int)tag_type) {
+ if ((int)tif_tag_type != (int)tag_type) {
// skip tag or _TIFFmemcpy will fail
continue;
}
diff --git a/plugins/FreeImage/Source/Utilities.h b/plugins/FreeImage/Source/Utilities.h
index bf836e1e87..b743325129 100644
--- a/plugins/FreeImage/Source/Utilities.h
+++ b/plugins/FreeImage/Source/Utilities.h
@@ -174,7 +174,7 @@ MAXMIN(const T* L, long n, T& max, T& min) {
long k1, k2;
i1 = 0; i2 = 0; min = L[0]; max = L[0]; j = 0;
- if((n % 2) != 0) j = 1;
+ if ((n % 2) != 0) j = 1;
for(i = j; i < n; i+= 2) {
k1 = i; k2 = i+1;
x1 = L[k1]; x2 = L[k2];
diff --git a/plugins/FreeImage/Source/Zlib/zutil.h b/plugins/FreeImage/Source/Zlib/zutil.h
index 223a74d3dc..8f33fd3e7d 100644
--- a/plugins/FreeImage/Source/Zlib/zutil.h
+++ b/plugins/FreeImage/Source/Zlib/zutil.h
@@ -219,7 +219,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# include <stdio.h>
extern int ZLIB_INTERNAL z_verbose;
extern void ZLIB_INTERNAL z_error OF((char *m));
-# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
+# define Assert(cond,msg) {if (!(cond)) z_error(msg);}
# define Trace(x) {if (z_verbose>=0) fprintf x ;}
# define Tracev(x) {if (z_verbose>0) fprintf x ;}
# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
diff --git a/plugins/HistoryLinkListPlus/linklist.c b/plugins/HistoryLinkListPlus/linklist.c
index c6625dc933..cd4f59f056 100644
--- a/plugins/HistoryLinkListPlus/linklist.c
+++ b/plugins/HistoryLinkListPlus/linklist.c
@@ -265,7 +265,7 @@ static INT_PTR LinkList_Main(WPARAM wParam,LPARAM lParam)
}
}
actCount++;
- if( ((int)(((float)actCount/histCount)*100.00)) % 10 == 0 )
+ if ( ((int)(((float)actCount/histCount)*100.00)) % 10 == 0 )
SendMessage(hWndProgress, WM_COMMAND, 100, ((int)(((float)actCount/histCount)*100.00)));
hEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hEvent, 0);
diff --git a/plugins/HistoryLinkListPlus/linklist_dlg.c b/plugins/HistoryLinkListPlus/linklist_dlg.c
index 3cd20ace43..c416e0121a 100644
--- a/plugins/HistoryLinkListPlus/linklist_dlg.c
+++ b/plugins/HistoryLinkListPlus/linklist_dlg.c
@@ -246,7 +246,7 @@ INT_PTR WINAPI MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam )
TCHAR filter[40];
// open Search Box
- if( wParam == IDM_SEARCH )
+ if ( wParam == IDM_SEARCH )
{
HWND hWndSearchDlg;
@@ -283,7 +283,7 @@ INT_PTR WINAPI MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam )
}
// view only incoming messages
- else if( wParam == IDM_DIR_IN )
+ else if ( wParam == IDM_DIR_IN )
{
GetFilterText(listMenu, filter, _countof(filter));
SetDlgItemText(hDlg, IDC_STATUS, filter);
diff --git a/plugins/HistoryLinkListPlus/linklist_fct.c b/plugins/HistoryLinkListPlus/linklist_fct.c
index 3c95874e40..ed0816ba1f 100644
--- a/plugins/HistoryLinkListPlus/linklist_fct.c
+++ b/plugins/HistoryLinkListPlus/linklist_fct.c
@@ -141,7 +141,7 @@ int ExtractURI(DBEVENTINFO *dbei, HANDLE hEvent, LISTELEMENT *listStart)
}
if ( !isLink ) {
- for( j=0; j<_countof(hyperlinkSubstrings); j++ )
+ for ( j=0; j<_countof(hyperlinkSubstrings); j++ )
{
if ( _tcsstr(wordsearch+1,hyperlinkSubstrings[j]) )
{
@@ -156,7 +156,7 @@ int ExtractURI(DBEVENTINFO *dbei, HANDLE hEvent, LISTELEMENT *listStart)
isLink = 1; //e-mail addresses
type = LINK_MAIL;
}
- else if( isLink ) {
+ else if ( isLink ) {
type = LINK_URL;
}
@@ -164,11 +164,11 @@ int ExtractURI(DBEVENTINFO *dbei, HANDLE hEvent, LISTELEMENT *listStart)
{
LPTSTR tok_ctx;
- if( (_tcsstr(wordsearch, _T("www.")) != NULL) && (_tcsstr(wordsearch, _T("http://")) == NULL) )
+ if ( (_tcsstr(wordsearch, _T("www.")) != NULL) && (_tcsstr(wordsearch, _T("http://")) == NULL) )
{
_tcsncpy_s(link, _countof(link), _T("http://"), _mstrlen(_T("http://")));
// Link longer than defined max -> cut link to max
- if( (i-wordStart+1) > (int)(LINK_MAX-_mstrlen(_T("http://"))) )
+ if ( (i-wordStart+1) > (int)(LINK_MAX-_mstrlen(_T("http://"))) )
_tcsncpy_s(link + _mstrlen(_T("http://")), _countof(link), word, LINK_MAX - _mstrlen(_T("http://")));
else
_tcsncpy_s(link + _mstrlen(_T("http://")), _countof(link), word, i-wordStart+1);
@@ -373,7 +373,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
{
linePos = GetLastLinePos(listStart);
- if((realListCount - append) == 1)
+ if ((realListCount - append) == 1)
_tcscpy_s(lastDate, _countof(lastDate), actualElement->date);
for(appCount = 1; appCount <= (realListCount - append); appCount++)
@@ -410,7 +410,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
if ( (params & WLL_IN) && (actualElement->direction == DIRECTION_IN) )
filter1 = 1;
- else if( (params & WLL_OUT) && (actualElement->direction == DIRECTION_OUT) )
+ else if ( (params & WLL_OUT) && (actualElement->direction == DIRECTION_OUT) )
filter1 = 1;
if ( (params & WLL_MAIL) && (actualElement->type == LINK_MAIL) )
@@ -435,7 +435,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
CallService(MS_DB_EVENT_GET, (WPARAM)actualElement->hEvent, (LPARAM)&dbe);
dbe.pBlob[dbe.cbBlob] = 0;
msg = DbGetEventTextT(&dbe, CP_ACP);
- if( _tcsstr(msg, searchString) )
+ if ( _tcsstr(msg, searchString) )
filter3 = 1;
free(dbe.pBlob);
@@ -523,7 +523,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
linePos++;
actualElement->linePos = linePos;
actCount++;
- if( hwndProgress && ( ((int)(((float)actCount/listCount)*100.00)) % 10 == 0 ) )
+ if ( hwndProgress && ( ((int)(((float)actCount/listCount)*100.00)) % 10 == 0 ) )
SendMessage(hwndProgress, WM_COMMAND, 100,((int)(((float)actCount/listCount)*100.00)));
}
@@ -531,7 +531,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
}
if ( listCount > 0 )
{
- if((actCount < listCount) && (append == 0) && (options.showLine != 0))
+ if ((actCount < listCount) && (append == 0) && (options.showLine != 0))
DrawLine(hDlg, lineLen);
}
else if ( searchString == NULL )
@@ -857,12 +857,12 @@ void GetListInfo(BYTE params, LISTELEMENT *listStart, LPCTSTR searchString, siz
else
filter3 = 1;
- if((filter1 == 1) && (filter2 == 1) && (filter3 == 1))
+ if ((filter1 == 1) && (filter2 == 1) && (filter3 == 1))
{
(*elementCount)++;
tempLen = _tcslen(actualElement->link);
- if(*maxLen < tempLen)
+ if (*maxLen < tempLen)
*maxLen = tempLen;
}
actualElement = actualElement->nextElement;
@@ -1324,13 +1324,13 @@ BOOL SaveEditAsStream( HWND hDlg )
ofn.lpstrTitle = _T("Save RTF File");
ofn.Flags = OFN_OVERWRITEPROMPT;
// Get a filename or quit
- if( ! GetSaveFileName( &ofn ) )
+ if ( ! GetSaveFileName( &ofn ) )
return FALSE;
// Create the specified file
hFile = CreateFile( szFilename, GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
// Quit if file creation fails
- if( hFile == INVALID_HANDLE_VALUE )
+ if ( hFile == INVALID_HANDLE_VALUE )
return FALSE;
// Pass file handle to callback
// so the callback can do the file write
@@ -1347,7 +1347,7 @@ BOOL SaveEditAsStream( HWND hDlg )
DWORD CALLBACK RTFSaveStreamCallback(DWORD_PTR dwCookie, LPBYTE lpBuffer, LONG lSize, LONG *plRead)
{
// Sanity check...exit if nothing passed
- if( ! lSize )
+ if ( ! lSize )
return 1;
// Initialize "amount read" variable for WriteFile()
*plRead = 0;
diff --git a/plugins/HistorySweeperLight/historysweeperlight.h b/plugins/HistorySweeperLight/historysweeperlight.h
index 1943d9b07e..2600cc2d67 100644
--- a/plugins/HistorySweeperLight/historysweeperlight.h
+++ b/plugins/HistorySweeperLight/historysweeperlight.h
@@ -23,7 +23,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MIRANDA_VER 0x0A00
-#define _USE_32BIT_TIME_T
+#if !defined( _WIN64 )
+ #define _USE_32BIT_TIME_T
+#endif
#include <windows.h>
#include <commctrl.h>
diff --git a/plugins/IEView/HTMLBuilder.cpp b/plugins/IEView/HTMLBuilder.cpp
index 7c83609eea..9fa9e24824 100644
--- a/plugins/IEView/HTMLBuilder.cpp
+++ b/plugins/IEView/HTMLBuilder.cpp
@@ -258,7 +258,7 @@ wchar_t *HTMLBuilder::getContactName(HANDLE hContact, const char* szProto) {
if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
if (ci.type == CNFT_ASCIIZ) {
if (ci.pszVal) {
- if(!wcscmp((wchar_t *)ci.pszVal, TranslateW(L"'(Unknown Contact)'"))) {
+ if (!wcscmp((wchar_t *)ci.pszVal, TranslateW(L"'(Unknown Contact)'"))) {
ci.dwFlag &= ~CNF_UNICODE;
if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
szName = Utils::convertToWCS((char *)ci.pszVal);
diff --git a/plugins/IEView/Options.cpp b/plugins/IEView/Options.cpp
index afd577bf89..9ab5bfe63c 100644
--- a/plugins/IEView/Options.cpp
+++ b/plugins/IEView/Options.cpp
@@ -1689,7 +1689,7 @@ void Options::setEmbedsize(int size){
DBWriteContactSettingDword(NULL, ieviewModuleName, "Embedsize", (DWORD) size);
}
-int Options::getEmbedsize(){
+int Options::getEmbedsize() {
return DBGetContactSettingDword(NULL, ieviewModuleName, "Embedsize", 0);
}
diff --git a/plugins/IEView/SRMMHTMLBuilder.cpp b/plugins/IEView/SRMMHTMLBuilder.cpp
index f142cf3028..303cae44e1 100644
--- a/plugins/IEView/SRMMHTMLBuilder.cpp
+++ b/plugins/IEView/SRMMHTMLBuilder.cpp
@@ -104,7 +104,7 @@ char *SRMMHTMLBuilder::timestampToString(DWORD dwFlags, time_t check) {
dbtts.cbDest = 70;;
dbtts.szDest = str;
szResult[0] = '\0';
- if(!(dwFlags & SMF_LOG_SHOWDATES)) {
+ if (!(dwFlags & SMF_LOG_SHOWDATES)) {
dbtts.szFormat = (char *)"s";
}
else {
diff --git a/plugins/IEView/TabSRMMHTMLBuilder.cpp b/plugins/IEView/TabSRMMHTMLBuilder.cpp
index 42bc5fc2c7..78d00177a8 100644
--- a/plugins/IEView/TabSRMMHTMLBuilder.cpp
+++ b/plugins/IEView/TabSRMMHTMLBuilder.cpp
@@ -168,7 +168,7 @@ char *TabSRMMHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int isG
dbtts.cbDest = 70;;
dbtts.szDest = str;
- if(!isGroupBreak || !(dwFlags & MWF_LOG_SHOWDATES)) {
+ if (!isGroupBreak || !(dwFlags & MWF_LOG_SHOWDATES)) {
dbtts.szFormat = (dwFlags & MWF_LOG_SHOWSECONDS) ? (char *)"s" : (char *)"t";
szResult[0] = '\0';
}
diff --git a/plugins/Import/mirabilis.c b/plugins/Import/mirabilis.c
index 79a07f1546..8d4577acd6 100644
--- a/plugins/Import/mirabilis.c
+++ b/plugins/Import/mirabilis.c
@@ -245,7 +245,7 @@ static int GetHighestIndexEntry(void)
DWORD ofs;
ofs=*(PDWORD)(pIdx+12);
- for(;;) {
+ for (;;) {
entry=(struct TIdxIndexEntry*)(pIdx+ofs);
if(entry->entryIdLow==(DWORD)-2) return ((struct TIdxDatEntry*)entry)->entryId;
if(entry->ofsHigher>=0xF0000000) ofs=entry->ofsInHere;
@@ -257,7 +257,7 @@ static int GetIdDatOfs(DWORD id)
{
struct TIdxIndexEntry *entry;
DWORD ofs = *(PDWORD)(pIdx+12);
- for(;;) {
+ for (;;) {
entry=(struct TIdxIndexEntry*)(pIdx+ofs);
if(entry->entryIdLow==(DWORD)-2) {
if(entry->entryIdHigh==id) return ((struct TIdxDatEntry*)entry)->datOfs;
@@ -390,7 +390,7 @@ DWORD ReadPropertyBlock(DWORD dwOffset, char* SearchWord, int* nSearchResult)
if ( SearchWord ) {
// Is this the property we are searching for?
- if(!lstrcmpA((char*)(pDat+nameOfs),SearchWord)){
+ if (!lstrcmpA((char*)(pDat+nameOfs),SearchWord)) {
*nSearchResult = 1;
return dwOffset;
} }
@@ -486,10 +486,10 @@ DWORD FindMyDetails(void)
DWORD dwOffset = GetIdDatOfs(1005);
if (!dwOffset) return 0;
- if(*(PDWORD)(pDat+dwOffset+0x08) != 1005) return 0;
- if(*(PBYTE)(pDat+dwOffset+0x0C) != 0xE4) return 0;
- if(*(int*)(pDat+dwOffset+0x1e) != 'USER') return 0;
- if(*(PDWORD)(pDat+dwOffset+0x22) != 6) return 0;
+ if (*(PDWORD)(pDat+dwOffset+0x08) != 1005) return 0;
+ if (*(PBYTE)(pDat+dwOffset+0x0C) != 0xE4) return 0;
+ if (*(int*)(pDat+dwOffset+0x1e) != 'USER') return 0;
+ if (*(PDWORD)(pDat+dwOffset+0x22) != 6) return 0;
return dwOffset;
}
@@ -528,7 +528,7 @@ DWORD FindGroupList(DWORD dwOffset)
dwOffset += 0x04; // ++ UNKNOWN ++
dwPhoneEntries = *(PDWORD)(pDat+dwOffset); // Phonebook starts here
dwOffset += 0x04;
- for(n = 0;n<dwPhoneEntries;n++){
+ for(n = 0;n<dwPhoneEntries;n++) {
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
@@ -598,7 +598,7 @@ DWORD FindGroupList(DWORD dwOffset)
dwOffset += 0x08;
dwPhoneEntries = *(PDWORD)(pDat+dwOffset); // Phonebook
dwOffset += 0x04;
- for(n = 0;n<dwPhoneEntries;n++){
+ for(n = 0;n<dwPhoneEntries;n++) {
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
@@ -650,8 +650,8 @@ char* GetGroupName(DWORD dwGroupID)
switch (dwDBVersion) {
case DBV99A:
case DBV99B:
- for (n = 0; n < dwGroups; n++){
- if (dwGroupID == *(PDWORD)(pDat + dwOffset)){
+ for (n = 0; n < dwGroups; n++) {
+ if (dwGroupID == *(PDWORD)(pDat + dwOffset)) {
if (*(PWORD)(pDat + dwOffset + 4) > 1)
return 6 + (char*)(pDat + dwOffset);
@@ -666,10 +666,10 @@ char* GetGroupName(DWORD dwGroupID)
case DBV2000A:
case DBV2000B:
case DBV2001A:
- for (n = 0; n < dwGroups; n++){
- if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupID", &nSearchResult)){
+ for (n = 0; n < dwGroups; n++) {
+ if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupID", &nSearchResult)) {
if (nSearchResult) {
- if (dwGroupID == *(PDWORD)(pDat + tmpOfs + 1)){
+ if (dwGroupID == *(PDWORD)(pDat + tmpOfs + 1)) {
strGroupName = 3 + (char*)(pDat + ReadPropertyBlock(dwOffset, "GroupName", &nSearchResult));
if (nSearchResult) {
if ((DWORD)*(strGroupName - 2) > 1)
@@ -746,7 +746,7 @@ int ImportGroups()
switch (nFormat) {
case ENTRYV99A:
case ENTRYV99B:
- for (n = 0; n < dwGroups; n++){
+ for (n = 0; n < dwGroups; n++) {
if (*(PWORD)(pDat+dwOffset+4) > 1) {
if ( CreateGroup(DBVT_ASCIIZ, (char*)(pDat + dwOffset) + 6, NULL ))
nImported++;
@@ -759,8 +759,8 @@ int ImportGroups()
case ENTRYV2001A:
case ENTRYV2001B:
case ENTRYV2002A:
- for (n = 0; n < dwGroups; n++){
- if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupName", &nSearchResult)){
+ for (n = 0; n < dwGroups; n++) {
+ if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupName", &nSearchResult)) {
if (nSearchResult) {
if (CreateGroup( DBVT_ASCIIZ, (char*)(pDat + tmpOfs + 3), NULL ))
nImported++;
diff --git a/plugins/Import/mirandahistory.c b/plugins/Import/mirandahistory.c
index 232d295f8d..ba7a923df7 100644
--- a/plugins/Import/mirandahistory.c
+++ b/plugins/Import/mirandahistory.c
@@ -92,7 +92,7 @@ static PBYTE ReadHistoryLines(FILE *fp,int *cbBlob)
blob=(char*)realloc(blob,*cbBlob+1);
lstrcpy(blob+ofs,str);
}
- if(*cbBlob) {
+ if (*cbBlob) {
(*cbBlob)--;
blob[*cbBlob-1]=0;
}
@@ -150,7 +150,7 @@ static void OldMirandaHistoryImport(HWND hdlgProgress)
tmEventTime.tm_mon=atoi(timeofs+10)-1;
tmEventTime.tm_year=atoi(timeofs+13)-1900;
dbei.timestamp=mktime(&tmEventTime)+_timezone;
- if(!(importOptions&historyTypeToOption[type])) continue;
+ if (!(importOptions&historyTypeToOption[type])) continue;
hContact=HistoryImportFindContact(hdlgProgress,uin,importOptions&IOPT_ADDUNKNOWN);
if(hContact==INVALID_HANDLE_VALUE) break;
dbei.flags=issent(type)?DBEF_SENT:DBEF_READ;
diff --git a/plugins/JSON/Source/JSONChildren.h b/plugins/JSON/Source/JSONChildren.h
index acc9a712a2..d7a38bb9dc 100644
--- a/plugins/JSON/Source/JSONChildren.h
+++ b/plugins/JSON/Source/JSONChildren.h
@@ -74,7 +74,7 @@ public:
}
//clears (and deletes) everything from the vector and sets it's size to 0
- inline void clear(){
+ inline void clear() {
if (array){ //don't bother clearing anything if there is nothing in it
JSON_ASSERT(mycapacity != 0, JSON_TEXT("mycapacity is not zero, but array is null"));
deleteAll();
@@ -204,7 +204,7 @@ public:
}
//shrinks the array to only as large as it needs to be to hold everything within it
- inline void shrink(){
+ inline void shrink() {
if (mysize == 0){ //size is zero, we should completely free the array
libjson_free<JSONNode*>(array); //free does checks for a null pointer, so don't bother checking
array = 0;
diff --git a/plugins/JSON/Source/JSONDebug.h b/plugins/JSON/Source/JSONDebug.h
index cace9b5c8e..faadd5f07a 100644
--- a/plugins/JSON/Source/JSONDebug.h
+++ b/plugins/JSON/Source/JSONDebug.h
@@ -14,7 +14,7 @@
#ifdef JSON_SAFE
#define JSON_ASSERT_SAFE(condition, msg, code)\
{\
- if (!(condition)){\
+ if (!(condition)) {\
JSON_FAIL(msg);\
code\
}\
@@ -44,7 +44,7 @@
#ifdef JSON_SAFE
#define JSON_ASSERT_SAFE(condition, msg, code)\
{\
- if (!(condition)){\
+ if (!(condition)) {\
code\
}\
}
diff --git a/plugins/JSON/Source/JSONIterators.cpp b/plugins/JSON/Source/JSONIterators.cpp
index 5b140d9b17..a22db2af71 100644
--- a/plugins/JSON/Source/JSONIterators.cpp
+++ b/plugins/JSON/Source/JSONIterators.cpp
@@ -17,7 +17,7 @@ JSONNode::json_iterator JSONNode::find(const json_string & name_t){
JSON_CHECK_INTERNAL();
JSON_ASSERT(type() == JSON_NODE, JSON_TEXT("finding a non-iteratable node"));
makeUniqueInternal();
- if (JSONNode ** res = internal -> at(name_t)){
+ if (JSONNode ** res = internal -> at(name_t)) {
return ptr_to_json_iterator(res);
}
return end();
@@ -28,7 +28,7 @@ JSONNode::json_iterator JSONNode::find(const json_string & name_t){
JSON_CHECK_INTERNAL();
JSON_ASSERT(type() == JSON_NODE, JSON_TEXT("finding a non-iteratable node"));
makeUniqueInternal();
- if (JSONNode ** res = internal -> at_nocase(name_t)){
+ if (JSONNode ** res = internal -> at_nocase(name_t)) {
return ptr_to_json_iterator(res);
}
return end();
@@ -71,7 +71,7 @@ JSONNode::json_iterator JSONNode::insert(json_iterator pos, const JSONNode & x){
JSON_CHECK_INTERNAL();
JSON_ASSERT(type() == JSON_NODE || type() == JSON_ARRAY, JSON_TEXT("erasing a non-iteratable node"));
JSON_ASSERT_UNIQUE("insert 1");
- if (json_iterator_ptr(pos) >= internal -> Children.end()){
+ if (json_iterator_ptr(pos) >= internal -> Children.end()) {
internal -> push_back(x);
return end() - 1;
}
@@ -104,7 +104,7 @@ JSONNode::json_iterator JSONNode::insertFFF(json_iterator pos, JSONNode ** const
JSONNode::const_iterator JSONNode::find(const json_string & name_t) const {
JSON_CHECK_INTERNAL();
JSON_ASSERT(type() == JSON_NODE, JSON_TEXT("finding a non-iteratable node"));
- if (JSONNode ** res = internal -> at(name_t)){
+ if (JSONNode ** res = internal -> at(name_t)) {
return JSONNode::const_iterator(res);
}
return JSONNode::const_iterator(internal -> end());
@@ -114,7 +114,7 @@ JSONNode::json_iterator JSONNode::insertFFF(json_iterator pos, JSONNode ** const
JSONNode::const_iterator JSONNode::find_nocase(const json_string & name_t) const {
JSON_CHECK_INTERNAL();
JSON_ASSERT(type() == JSON_NODE, JSON_TEXT("finding a non-iteratable node"));
- if (JSONNode ** res = internal -> at_nocase(name_t)){
+ if (JSONNode ** res = internal -> at_nocase(name_t)) {
return JSONNode::const_iterator(res);
}
return JSONNode::const_iterator(internal -> end());
@@ -153,7 +153,7 @@ JSONNode::json_iterator JSONNode::insertFFF(json_iterator pos, JSONNode ** const
JSON_CHECK_INTERNAL();
JSON_ASSERT(type() == JSON_NODE || type() == JSON_ARRAY, JSON_TEXT("erasing a non-iteratable node"));
JSON_ASSERT_UNIQUE("insert 1");
- if (pos.it < internal -> Children.begin()){
+ if (pos.it < internal -> Children.begin()) {
internal -> push_front(x);
return rend() - 1;
}
diff --git a/plugins/JSON/Source/JSONMemory.h b/plugins/JSON/Source/JSONMemory.h
index 4797bd619f..24c1eee6cf 100644
--- a/plugins/JSON/Source/JSONMemory.h
+++ b/plugins/JSON/Source/JSONMemory.h
@@ -77,7 +77,7 @@
#include <map>
class JSONNode;
struct auto_expand {
- auto_expand(void) : mymap(){}
+ auto_expand(void) : mymap() {}
~auto_expand(void){ purge(); }
void purge(void);
inline void clear(void){ purge(); mymap.clear(); }
@@ -91,7 +91,7 @@
};
struct auto_expand_node {
- auto_expand_node(void) : mymap(){}
+ auto_expand_node(void) : mymap() {}
~auto_expand_node(void){ purge(); }
void purge(void);
inline void clear(void){ purge(); mymap.clear(); }
@@ -109,7 +109,7 @@ template <typename T>
class json_auto {
public:
json_auto(void) : ptr(0){}
- json_auto(size_t count) : ptr(json_malloc<T>(count)){}
+ json_auto(size_t count) : ptr(json_malloc<T>(count)) {}
~json_auto(void){
libjson_free<T>(ptr);
}
diff --git a/plugins/JSON/Source/JSONNode.cpp b/plugins/JSON/Source/JSONNode.cpp
index f4ced9a478..ac6106b261 100644
--- a/plugins/JSON/Source/JSONNode.cpp
+++ b/plugins/JSON/Source/JSONNode.cpp
@@ -16,7 +16,7 @@
#endif
#define IMPLEMENT_CTOR(type)\
- JSONNode::JSONNode(const json_string & name_t, type value_t) : internal(internalJSONNode::newInternal()){\
+ JSONNode::JSONNode(const json_string & name_t, type value_t) : internal(internalJSONNode::newInternal()) {\
internal -> Set(value_t);\
internal -> setname(name_t);\
incAllocCount();\
@@ -24,7 +24,7 @@
IMPLEMENT_FOR_ALL_TYPES(IMPLEMENT_CTOR)
#ifndef JSON_LIBRARY
- JSONNode::JSONNode(const json_string & name_t, const json_char * value_t) : internal(internalJSONNode::newInternal()){
+ JSONNode::JSONNode(const json_string & name_t, const json_char * value_t) : internal(internalJSONNode::newInternal()) {
internal -> Set(json_string(value_t));
internal -> setname(name_t);
incAllocCount();
@@ -103,7 +103,7 @@ void JSONNode::cast(char newtype){
#ifdef JSON_REF_COUNT
void JSONNode::merge(JSONNode & other){
#else
-void JSONNode::merge(JSONNode &){
+void JSONNode::merge(JSONNode &) {
#endif
JSON_CHECK_INTERNAL();
#ifdef JSON_REF_COUNT
@@ -125,9 +125,9 @@ void JSONNode::merge(JSONNode &){
}
//different just to supress the warning
- void JSONNode::merge(unsigned int num, ...){
+ void JSONNode::merge(unsigned int num, ...) {
#else
- void JSONNode::merge(unsigned int, ...){
+ void JSONNode::merge(unsigned int, ...) {
#endif
JSON_CHECK_INTERNAL();
#ifdef JSON_REF_COUNT
@@ -153,7 +153,7 @@ JSONNode JSONNode::duplicate(void) const {
JSONNode & JSONNode::at(json_index_t pos){
JSON_CHECK_INTERNAL();
- if (pos >= internal -> size()){
+ if (pos >= internal -> size()) {
JSON_FAIL(JSON_TEXT("at() out of bounds"));
throw std::out_of_range(EMPTY_STRING2);
}
@@ -162,7 +162,7 @@ JSONNode & JSONNode::at(json_index_t pos){
const JSONNode & JSONNode::at(json_index_t pos) const {
JSON_CHECK_INTERNAL();
- if (pos >= internal -> size()){
+ if (pos >= internal -> size()) {
JSON_FAIL(JSON_TEXT("at() const out of bounds"));
throw std::out_of_range(EMPTY_STRING2);
}
@@ -186,7 +186,7 @@ JSONNode & JSONNode::at(const json_string & name_t){
JSON_CHECK_INTERNAL();
JSON_ASSERT(type() == JSON_NODE, JSON_TEXT("at a non-iteratable node"));
makeUniqueInternal();
- if (JSONNode ** res = internal -> at(name_t)){
+ if (JSONNode ** res = internal -> at(name_t)) {
return *(*res);
}
JSON_FAIL(json_string(JSON_TEXT("at could not find child by name: ")) + name_t);
@@ -196,7 +196,7 @@ JSONNode & JSONNode::at(const json_string & name_t){
const JSONNode & JSONNode::at(const json_string & name_t) const {
JSON_CHECK_INTERNAL();
JSON_ASSERT(type() == JSON_NODE, JSON_TEXT("at a non-iteratable node"));
- if (JSONNode ** res = internal -> at(name_t)){
+ if (JSONNode ** res = internal -> at(name_t)) {
return *(*res);
}
JSON_FAIL(json_string(JSON_TEXT("at const could not find child by name: ")) + name_t);
@@ -208,7 +208,7 @@ const JSONNode & JSONNode::at(const json_string & name_t) const {
JSON_CHECK_INTERNAL();
JSON_ASSERT(type() == JSON_NODE, JSON_TEXT("at a non-iteratable node"));
makeUniqueInternal();
- if (JSONNode ** res = internal -> at_nocase(name_t)){
+ if (JSONNode ** res = internal -> at_nocase(name_t)) {
return *(*res);
}
JSON_FAIL(json_string(JSON_TEXT("at_nocase could not find child by name: ")) + name_t);
@@ -218,7 +218,7 @@ const JSONNode & JSONNode::at(const json_string & name_t) const {
const JSONNode & JSONNode::at_nocase(const json_string & name_t) const {
JSON_CHECK_INTERNAL();
JSON_ASSERT(type() == JSON_NODE, JSON_TEXT("at a non-iteratable node"));
- if (JSONNode ** res = internal -> at_nocase(name_t)){
+ if (JSONNode ** res = internal -> at_nocase(name_t)) {
return *(*res);
}
JSON_FAIL(json_string(JSON_TEXT("at_nocase const could not find child by name: ")) + name_t);
@@ -240,7 +240,7 @@ const JSONNode & JSONNode::at(const json_string & name_t) const {
JSONNode JSON_PTR_LIB JSONNode::pop_back(json_index_t pos){
JSON_CHECK_INTERNAL();
- if (pos >= internal -> size()){
+ if (pos >= internal -> size()) {
JSON_FAIL(JSON_TEXT("pop_back out of bounds"));
throw std::out_of_range(EMPTY_STRING2);
}
@@ -259,7 +259,7 @@ JSONNode JSON_PTR_LIB JSONNode::pop_back(const json_string & name_t){
#ifdef JSON_LIBRARY
return internal -> pop_back(name_t);
#else
- if (JSONNode * res = internal -> pop_back(name_t)){
+ if (JSONNode * res = internal -> pop_back(name_t)) {
auto_delete temp(res);
return *(temp.mynode);
}
@@ -275,7 +275,7 @@ JSONNode JSON_PTR_LIB JSONNode::pop_back(const json_string & name_t){
#ifdef JSON_LIBRARY
return internal -> pop_back_nocase(name_t);
#else
- if (JSONNode * res = internal -> pop_back_nocase(name_t)){
+ if (JSONNode * res = internal -> pop_back_nocase(name_t)) {
auto_delete temp(res);
return *(temp.mynode);
}
diff --git a/plugins/JSON/Source/JSONNode.h b/plugins/JSON/Source/JSONNode.h
index b4fad7573c..36ebcd6145 100644
--- a/plugins/JSON/Source/JSONNode.h
+++ b/plugins/JSON/Source/JSONNode.h
@@ -443,7 +443,7 @@ JSON_PRIVATE
static JSONNode * newJSONNode(const JSONNode & orig JSON_MUTEX_COPY_DECL2);
static JSONNode * newJSONNode(internalJSONNode * internal_t);
//used by JSONWorker
- JSONNode(const json_string & unparsed) : internal(internalJSONNode::newInternal(unparsed)){ //root, specialized because it can only be array or node
+ JSONNode(const json_string & unparsed) : internal(internalJSONNode::newInternal(unparsed)) { //root, specialized because it can only be array or node
incAllocCount();
}
JSONNode(internalJSONNode * internal_t) : internal(internal_t){ //do not increment anything, this is only used in one case and it's already taken care of
@@ -484,7 +484,7 @@ JSON_PRIVATE
file because they are inlined.
*/
-inline JSONNode::JSONNode(char mytype) : internal(internalJSONNode::newInternal(mytype)){
+inline JSONNode::JSONNode(char mytype) : internal(internalJSONNode::newInternal(mytype)) {
JSON_ASSERT((mytype == JSON_NULL) ||
(mytype == JSON_STRING) ||
(mytype == JSON_NUMBER) ||
@@ -494,7 +494,7 @@ inline JSONNode::JSONNode(char mytype) : internal(internalJSONNode::newInternal(
incAllocCount();
}
-inline JSONNode::JSONNode(const JSONNode & orig): internal(orig.internal -> incRef()){
+inline JSONNode::JSONNode(const JSONNode & orig): internal(orig.internal -> incRef()) {
incAllocCount();
}
@@ -521,7 +521,7 @@ inline bool JSONNode::empty(void) const {
inline void JSONNode::clear(void){
JSON_CHECK_INTERNAL();
- if (!empty()){
+ if (!empty()) {
makeUniqueInternal();
internal -> Children.clear();
}
@@ -713,7 +713,7 @@ inline void JSONNode::decRef(void){ //decrements internal's counter, deletes it
JSON_CHECK_INTERNAL();
#ifdef JSON_REF_COUNT
internal -> decRef();
- if (internal -> hasNoReferences()){
+ if (internal -> hasNoReferences()) {
internalJSONNode::deleteInternal(internal);
}
#else
@@ -722,7 +722,7 @@ inline void JSONNode::decRef(void){ //decrements internal's counter, deletes it
}
#ifdef JSON_REF_COUNT
- inline void JSONNode::makeUniqueInternal(){ //makes internal it's own
+ inline void JSONNode::makeUniqueInternal() { //makes internal it's own
JSON_CHECK_INTERNAL();
internal = internal -> makeUnique(); //might return itself or a new one that's exactly the same
}
diff --git a/plugins/JSON/Source/JSONNode_Mutex.cpp b/plugins/JSON/Source/JSONNode_Mutex.cpp
index 0f0dbe5d7b..f047f58403 100644
--- a/plugins/JSON/Source/JSONNode_Mutex.cpp
+++ b/plugins/JSON/Source/JSONNode_Mutex.cpp
@@ -73,14 +73,14 @@ void JSONNode::lock(int thread){
//make sure that the same thread isn't locking it more than once (possible due to complex ref counting)
std::map<int, std::map<void *, unsigned int> >::iterator it = threadlocks.find(thread);
- if (it == threadlocks.end()){
+ if (it == threadlocks.end()) {
std::map<void *, unsigned int> newthread;
newthread[thislock] = 1;
threadlocks.insert(std::pair<int, std::map<void *, unsigned int> >(thread, newthread));
} else { //this thread already has some things locked, check if the current mutex is
std::map<void *, unsigned int> & newthread = it -> second;
std::map<void *, unsigned int>::iterator locker = newthread.find(thislock);
- if (locker == newthread.end()){ //current mutex is not locked, set it to locked
+ if (locker == newthread.end()) { //current mutex is not locked, set it to locked
newthread.insert(std::pair<void *, unsigned int>(thislock, 1));
} else { //it's already locked, don't relock it
++(locker -> second);
@@ -133,7 +133,7 @@ void internalJSONNode::_set_mutex(void * mutex, bool unset){
if (mutex){
#ifdef JSON_MUTEX_MANAGE
std::map<void *, unsigned int>::iterator it = mutex_manager.find(mutex);
- if (it == mutex_manager.end()){
+ if (it == mutex_manager.end()) {
mutex_manager.insert(std::pair<void *, unsigned int>(mutex, 1));
} else {
++it -> second;
@@ -168,7 +168,7 @@ void internalJSONNode::_unset_mutex(void){
if (mylock){
mut.push_back(JSON_NEW(JSONNode(JSON_TEXT("this"), (long)mylock)));
std::map<void *, unsigned int>::iterator it = mutex_manager.find(mylock);
- if (it == mutex_manager.end()){
+ if (it == mutex_manager.end()) {
mut.push_back(JSON_NEW(JSONNode(JSON_TEXT("references"), JSON_TEXT("error"))));
} else {
mut.push_back(JSON_NEW(JSONNode(JSON_TEXT("references"), it -> second)));
diff --git a/plugins/JSON/Source/JSONWorker.cpp b/plugins/JSON/Source/JSONWorker.cpp
index 093d9a75b2..245e1568dc 100644
--- a/plugins/JSON/Source/JSONWorker.cpp
+++ b/plugins/JSON/Source/JSONWorker.cpp
@@ -3,7 +3,7 @@
#ifdef JSON_VALIDATE
JSONNode JSONWorker::validate(const json_string & json){
JSONNode res = parse(json);
- if (!res.validate()){
+ if (!res.validate()) {
throw std::invalid_argument(EMPTY_STRING2);
}
return JSONNode(true, res); //forces it to simply return the original interal, even with ref counting off
@@ -23,14 +23,14 @@ JSONNode JSONWorker::parse(const json_string & json){
json_char firstchar = s.ptr[0];
json_string _comment;
json_char * runner = s.ptr;
- if (firstchar == '\5'){ //multiple comments will be consolidated into one
+ if (firstchar == '\5') { //multiple comments will be consolidated into one
newcomment:
- while(*(++runner) != '\5'){
+ while(*(++runner) != '\5') {
JSON_ASSERT(*runner, JSON_TEXT("Removing white space failed"));
_comment += *runner;
}
firstchar = *(++runner); //step past the trailing tag
- if (firstchar == '\5'){
+ if (firstchar == '\5') {
_comment += '\n';
goto newcomment;
}
@@ -43,13 +43,13 @@ JSONNode JSONWorker::parse(const json_string & json){
case '{':
case '[':
#if defined JSON_DEBUG || defined JSON_SAFE
- if (firstchar == '['){
- if (lastchar != ']'){
+ if (firstchar == '[') {
+ if (lastchar != ']') {
JSON_FAIL(JSON_TEXT("Missing final ]"));
break;
}
} else {
- if (lastchar != '}'){
+ if (lastchar != '}') {
JSON_FAIL(JSON_TEXT("Missing final }"));
break;
}
@@ -70,7 +70,7 @@ JSONNode JSONWorker::parse(const json_string & json){
#define QUOTECASE()\
case JSON_TEXT('\"'):\
- while (*(++p) != JSON_TEXT('\"')){\
+ while (*(++p) != JSON_TEXT('\"')) {\
JSON_ASSERT_SAFE(*p, JSON_TEXT("Null terminator inside of a quotation"), return json_string::npos;);\
}\
break;
@@ -88,7 +88,7 @@ JSONNode JSONWorker::parse(const json_string & json){
case left: {\
size_t brac = 1;\
while (brac){\
- switch (*(++p)){\
+ switch (*(++p)) {\
case right:\
--brac;\
break;\
@@ -122,7 +122,7 @@ size_t JSONWorker::FindNextRelevant(json_char ch, const json_string & value_t, c
#define AND_RUNNER ,runner
inline void SingleLineComment(const json_char * & p, json_char * & runner){
COMMENT_DELIMITER();
- while((*(++p)) && (*p != JSON_TEXT('\n'))){
+ while((*(++p)) && (*p != JSON_TEXT('\n'))) {
*runner++ = *p;
}
COMMENT_DELIMITER();
@@ -154,9 +154,9 @@ inline void SingleLineComment(const json_char * & p){
case JSON_TEXT('\r'): //defined as white space
break;
case JSON_TEXT('/'): //a C comment
- if (*(++p) == JSON_TEXT('*')){ //a multiline comment
+ if (*(++p) == JSON_TEXT('*')) { //a multiline comment
COMMENT_DELIMITER();
- while ((*(++p) != JSON_TEXT('*')) || (*(p + 1) != JSON_TEXT('/'))){
+ while ((*(++p) != JSON_TEXT('*')) || (*(p + 1) != JSON_TEXT('/'))) {
JSON_ASSERT_SAFE(*p, JSON_TEXT("Null terminator inside of a multiline quote"), COMMENT_DELIMITER(); goto endofloop;);
*runner++ = *p;
}
@@ -171,7 +171,7 @@ inline void SingleLineComment(const json_char * & p){
break;
case JSON_TEXT('\"'): //a quote
*runner++ = JSON_TEXT('\"');
- while(*(++p) != JSON_TEXT('\"')){ //find the end of the quotation, as white space is preserved within it
+ while(*(++p) != JSON_TEXT('\"')) { //find the end of the quotation, as white space is preserved within it
JSON_ASSERT_SAFE(*p, JSON_TEXT("Null terminator inside of a quotation"), goto endofloop;);
switch(*p){
case JSON_TEXT('\\'):
@@ -214,8 +214,8 @@ json_string JSONWorker::RemoveWhiteSpaceAndComments(const json_string & value_t)
case JSON_TEXT('\r'): //defined as white space
break;
case JSON_TEXT('/'): //a C comment
- if (*(++p) == JSON_TEXT('*')){ //a multiline comment
- while ((*(++p) != JSON_TEXT('*')) || (*(p + 1) != JSON_TEXT('/'))){
+ if (*(++p) == JSON_TEXT('*')) { //a multiline comment
+ while ((*(++p) != JSON_TEXT('*')) || (*(p + 1) != JSON_TEXT('/'))) {
JSON_ASSERT_SAFE(*p, JSON_TEXT("Null terminator inside of a multiline quote"), goto endofloop;);
}
++p;
@@ -228,7 +228,7 @@ json_string JSONWorker::RemoveWhiteSpaceAndComments(const json_string & value_t)
break;
case JSON_TEXT('\"'): //a quote
result += JSON_TEXT('\"');
- while(*(++p) != JSON_TEXT('\"')){ //find the end of the quotation, as white space is preserved within it
+ while(*(++p) != JSON_TEXT('\"')) { //find the end of the quotation, as white space is preserved within it
JSON_ASSERT(*p, JSON_TEXT("Null terminator inside of a quotation"));
switch(*p){
case JSON_TEXT('\\'):
@@ -269,11 +269,11 @@ json_string JSONWorker::RemoveWhiteSpaceAndComments(const json_string & value_t)
json_string JSONWorker::UTF(const json_char * & pos){
json_string result;
unsigned json_char first = UTF8(pos);
- if ((*(pos + 1) == '\\') && (*(pos + 2) == 'u')){
+ if ((*(pos + 1) == '\\') && (*(pos + 2) == 'u')) {
pos += 2;
unsigned json_char second = UTF8(pos);
//surrogate pair, not two characters
- if ((first > 0xD800) && (first < 0xDBFF) && (second > 0xDC00) && (second < 0xDFFF)){
+ if ((first > 0xD800) && (first < 0xDBFF) && (second > 0xDC00) && (second < 0xDFFF)) {
result += SurrogatePair(first, second);
} else {
result += first;
@@ -564,7 +564,7 @@ json_string JSONWorker::UnfixString(const json_string & value_t, bool flag){
res += JSON_TEXT("\\\'");
break;
default:
- /*if (((unsigned json_char)(*p) < 32) || ((unsigned json_char)(*p) > 126)){
+ /*if (((unsigned json_char)(*p) < 32) || ((unsigned json_char)(*p) > 126)) {
//res += toUTF8((unsigned json_char)(*p));
} else*/ {
res += *p;
@@ -587,13 +587,13 @@ inline void JSONWorker::NewNode(const internalJSONNode * parent, const json_stri
#ifdef JSON_COMMENTS
const json_char * runner = (array) ? value.c_str() : name.c_str();
json_string _comment;
- if (*runner == '\5'){ //multiple comments will be consolidated into one
+ if (*runner == '\5') { //multiple comments will be consolidated into one
newcomment:
- while(*(++runner) != '\5'){
+ while(*(++runner) != '\5') {
JSON_ASSERT(*runner, JSON_TEXT("Removing white space failed"));
_comment += *runner;
}
- if (*(++runner) == '\5'){ //step past the trailing tag
+ if (*(++runner) == '\5') { //step past the trailing tag
_comment += '\n';
goto newcomment;
}
diff --git a/plugins/JSON/Source/JSONWriter.cpp b/plugins/JSON/Source/JSONWriter.cpp
index 9b53689002..ce040f57f3 100644
--- a/plugins/JSON/Source/JSONWriter.cpp
+++ b/plugins/JSON/Source/JSONWriter.cpp
@@ -117,13 +117,13 @@ json_string internalJSONNode::Write(unsigned int indent, bool arrayChild){
const bool formatted = indent != 0xFFFFFFFF;
#ifndef JSON_PREPARSE
- if (!(formatted || fetched)){ //It's not formatted or fetched, just do a raw dump
+ if (!(formatted || fetched)) { //It's not formatted or fetched, just do a raw dump
return WriteComment(indent) + WriteName(false, arrayChild) + _string;
}
#endif
//It's either formatted or fetched
- switch (type()){
+ switch (type()) {
case JSON_NODE: //got members, write the members
Fetch();
return WriteComment(indent) + WriteName(formatted, arrayChild) + JSON_TEXT("{") + WriteChildren(indent) + JSON_TEXT("}");
diff --git a/plugins/JSON/Source/JSON_Base64.cpp b/plugins/JSON/Source/JSON_Base64.cpp
index fcde330b1a..fdf7930208 100644
--- a/plugins/JSON/Source/JSON_Base64.cpp
+++ b/plugins/JSON/Source/JSON_Base64.cpp
@@ -50,13 +50,13 @@ json_string JSONBase64::json_encode64(const unsigned char * binary, size_t bytes
}
inline json_char toBinary(json_char c){
- if (c == JSON_TEXT('+')){
+ if (c == JSON_TEXT('+')) {
return JSON_TEXT('>');
- } else if (c == JSON_TEXT('/')){
+ } else if (c == JSON_TEXT('/')) {
return JSON_TEXT('?');
- } else if (c < JSON_TEXT(':')){
+ } else if (c < JSON_TEXT(':')) {
return c + JSON_TEXT('\x04');
- } else if (c < JSON_TEXT('[')){
+ } else if (c < JSON_TEXT('[')) {
return c - JSON_TEXT('\x41');
}
return c - 71;
@@ -97,10 +97,10 @@ std::string JSONBase64::json_decode64(const json_string & encoded){
//now do the ones that might have padding, the first two characters can not be padding, so do them quickly
const char second = toBinary(runner[1]);
result += (toBinary(runner[0]) << 2) + ((second & 0x30) >> 4);
- if (runner[2] != '='){ //not two = pads
+ if (runner[2] != '=') { //not two = pads
const char third = toBinary(runner[2]);
result += ((second & 0xf) << 4) + ((third & 0x3c) >> 2);
- if (runner[3] != '='){ //no padding
+ if (runner[3] != '=') { //no padding
result += ((third & 0x3) << 6) + toBinary(runner[3]);
}
}
diff --git a/plugins/JSON/Source/NumberToString.h b/plugins/JSON/Source/NumberToString.h
index a1ea2d4d3c..a5e93d4302 100644
--- a/plugins/JSON/Source/NumberToString.h
+++ b/plugins/JSON/Source/NumberToString.h
@@ -84,7 +84,7 @@ public:
#endif
//strip the trailing zeros
for(json_char * pos = &result[0]; *pos; ++pos){
- if (*pos == '.'){ //only care about after the decimal
+ if (*pos == '.') { //only care about after the decimal
for(json_char * runner = pos + 1; *runner; ++runner){
if (*runner != JSON_TEXT('0')) pos = runner + 1;
}
diff --git a/plugins/JSON/Source/internalJSONNode.cpp b/plugins/JSON/Source/internalJSONNode.cpp
index 2651394a8a..626546586c 100644
--- a/plugins/JSON/Source/internalJSONNode.cpp
+++ b/plugins/JSON/Source/internalJSONNode.cpp
@@ -32,7 +32,7 @@ internalJSONNode::internalJSONNode(const internalJSONNode & orig) :
#ifdef JSON_MUTEX_CALLBACKS
_set_mutex(orig.mylock, false);
#endif
- if (!orig.Children.empty()){
+ if (!orig.Children.empty()) {
Children.reserve(orig.Children.size());
json_foreach(orig.Children, myrunner){
Children.push_back(JSONNode::newJSONNode((*myrunner) -> duplicate()));
@@ -61,7 +61,7 @@ internalJSONNode::internalJSONNode(const json_string & unparsed) : _type(), _nam
initializeValid(0){
incinternalAllocCount();
- switch (unparsed[0]){
+ switch (unparsed[0]) {
case JSON_TEXT('{'): //node
_type = JSON_NODE;
#ifdef JSON_PREPARSE
@@ -89,7 +89,7 @@ internalJSONNode::internalJSONNode(const json_string & name_t, const json_string
incinternalAllocCount();
- if (value_t.empty()){
+ if (value_t.empty()) {
_type = JSON_NULL;
#ifdef JSON_VALIDATE
isValid = true;
@@ -196,7 +196,7 @@ void internalJSONNode::FetchNumber(void) const {
#ifndef JSON_PREPARSE
void internalJSONNode::Fetch(void) const {
if (fetched) return;
- switch (type()){
+ switch (type()) {
case JSON_STRING:
FetchString();
break;
@@ -288,7 +288,7 @@ bool internalJSONNode::IsEqualTo(const internalJSONNode * val) const {
Fetch();
val -> Fetch();
#endif
- switch (type()){
+ switch (type()) {
case JSON_STRING:
return val -> _string == _string;
case JSON_NUMBER:
@@ -358,7 +358,7 @@ JSONNode * internalJSONNode::pop_back(json_index_t pos){
}
JSONNode * internalJSONNode::pop_back(const json_string & name_t){
- if (JSONNode ** res = at(name_t)){
+ if (JSONNode ** res = at(name_t)) {
JSONNode * result = *res;
Children.erase(res);
return result;
@@ -368,7 +368,7 @@ JSONNode * internalJSONNode::pop_back(const json_string & name_t){
#ifdef JSON_CASE_INSENSITIVE_FUNCTIONS
JSONNode * internalJSONNode::pop_back_nocase(const json_string & name_t){
- if (JSONNode ** res = at_nocase(name_t)){
+ if (JSONNode ** res = at_nocase(name_t)) {
JSONNode * result = *res;
Children.erase(res);
return result;
@@ -392,9 +392,9 @@ JSONNode ** internalJSONNode::at(const json_string & name_t){
const json_char c_one = *ch_one;
const json_char c_two = *ch_two;
if (c_one != c_two){
- if ((c_two > 64) && (c_two < 91)){ //A - Z
+ if ((c_two > 64) && (c_two < 91)) { //A - Z
if (c_one != (json_char)(c_two + 32)) return false;
- } else if ((c_two > 96) && (c_two < 123)){ //a - z
+ } else if ((c_two > 96) && (c_two < 123)) { //a - z
if (c_one != (json_char)(c_two - 32)) return false;
} else { //not a letter, so return false
return false;
@@ -434,7 +434,7 @@ JSONNode ** internalJSONNode::at(const json_string & name_t){
(*myrunner) -> internal -> Fetch();
#endif
if ((*myrunner) -> type() == JSON_NULL) return false;
- } else if (!((*myrunner) -> internal -> isValid)){
+ } else if (!((*myrunner) -> internal -> isValid)) {
JSON_FAIL(_name + JSON_TEXT(" is null and not valid"));
return false;
}
@@ -477,7 +477,7 @@ JSONNode ** internalJSONNode::at(const json_string & name_t){
dumpage.push_back(JSON_NEW(JSONNode(JSON_TEXT("_type"), JSON_TEXT(#ty))));\
break;
- switch(type()){
+ switch(type()) {
DUMPCASE(JSON_NULL)
DUMPCASE(JSON_STRING)
DUMPCASE(JSON_NUMBER)
diff --git a/plugins/JSON/Source/internalJSONNode.h b/plugins/JSON/Source/internalJSONNode.h
index 8667e3fbbb..9e9f9de983 100644
--- a/plugins/JSON/Source/internalJSONNode.h
+++ b/plugins/JSON/Source/internalJSONNode.h
@@ -290,7 +290,7 @@ inline json_string internalJSONNode::as_string(void) const {
inline long internalJSONNode::as_int(void) const {
Fetch();
- switch(type()){
+ switch(type()) {
case JSON_NULL:
return 0;
case JSON_BOOL:
@@ -305,7 +305,7 @@ inline long internalJSONNode::as_int(void) const {
inline json_number internalJSONNode::as_float(void) const {
Fetch();
- switch(type()){
+ switch(type()) {
case JSON_NULL:
return (json_number)0.0;
case JSON_BOOL:
@@ -317,7 +317,7 @@ inline json_number internalJSONNode::as_float(void) const {
inline bool internalJSONNode::as_bool(void) const {
Fetch();
- switch(type()){
+ switch(type()) {
case JSON_NUMBER:
return _value._number != 0.0f;
case JSON_NULL:
diff --git a/plugins/JSON/miminterface.cpp b/plugins/JSON/miminterface.cpp
index 30ccb9a69c..b6fbf4ce88 100644
--- a/plugins/JSON/miminterface.cpp
+++ b/plugins/JSON/miminterface.cpp
@@ -55,7 +55,7 @@ extern "C" {
return 0;
}
- int GetInterface(WPARAM wParam, LPARAM lParam) {
+ INT_PTR GetInterface(WPARAM wParam, LPARAM lParam) {
LPJSONSERVICEINTERFACE lpJSI=(LPJSONSERVICEINTERFACE)wParam;
memset(lpJSI,0,sizeof(JSONSERVICEINTERFACE));
@@ -247,7 +247,7 @@ WRAPPER_21(EQUAL,json_equal,JSONNODE*,JSONNODE*);
pluginLink=link;
mir_getMMI(&mmi);
- s_services[ciServices++]=CreateServiceFunction(MS_JSON_GETINTERFACE,GetInterface);
+ s_services[ciServices++] = CreateServiceFunction(MS_JSON_GETINTERFACE,GetInterface);
CSF(FREE);
CSF(DELETE);
diff --git a/plugins/KeyboardNotify/EnumProc.cpp b/plugins/KeyboardNotify/EnumProc.cpp
index a225bd0a03..7a5a23f0e3 100644
--- a/plugins/KeyboardNotify/EnumProc.cpp
+++ b/plugins/KeyboardNotify/EnumProc.cpp
@@ -62,7 +62,7 @@ void LoadProcsLibrary(void)
lpfVDMEnumTaskWOWEx = (INT (WINAPI *)(DWORD, TASKENUMPROCEX, LPARAM)) GetProcAddress(hInstLib2, "VDMEnumTaskWOWEx");
} else {
- if(!(hInstLib = LoadLibraryA("Kernel32.DLL")))
+ if (!(hInstLib = LoadLibraryA("Kernel32.DLL")))
return;
if (bWindowsNT && !(hInstLib2 = LoadLibraryA("VDMDBG.DLL")))
diff --git a/plugins/KeyboardNotify/flash.cpp b/plugins/KeyboardNotify/flash.cpp
index fd3815d0b1..aa0014a329 100644
--- a/plugins/KeyboardNotify/flash.cpp
+++ b/plugins/KeyboardNotify/flash.cpp
@@ -108,7 +108,7 @@ FLASHING_SEQUENCE *getCustomSeq(void)
customStr[0] = _T('\0');
- if(!DBGetContactSetting(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", wCustomTheme), &dbv)) {
+ if (!DBGetContactSetting(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", wCustomTheme), &dbv)) {
wcscpy(customStr, dbv.pwszVal);
DBFreeVariant(&dbv);
}
diff --git a/plugins/KeyboardNotify/ignore.cpp b/plugins/KeyboardNotify/ignore.cpp
index ededae2c84..97988f59a5 100644
--- a/plugins/KeyboardNotify/ignore.cpp
+++ b/plugins/KeyboardNotify/ignore.cpp
@@ -309,7 +309,7 @@ INT_PTR CALLBACK DlgProcIgnoreOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
if(hItem == NULL)
break;
- if(!(hitFlags & CLCHT_ONITEMEXTRA))
+ if (!(hitFlags & CLCHT_ONITEMEXTRA))
break;
if(nm->iColumn == IGNOREEVENT_MAX) { //ignore all
for(iImage=0; iImage < IGNOREEVENT_MAX; iImage++)
diff --git a/plugins/KeyboardNotify/keyboard.cpp b/plugins/KeyboardNotify/keyboard.cpp
index cb77a88827..df1033fce7 100644
--- a/plugins/KeyboardNotify/keyboard.cpp
+++ b/plugins/KeyboardNotify/keyboard.cpp
@@ -46,9 +46,11 @@ typedef struct _KEYBOARD_INDICATOR_PARAMETERS {
void outportb(UINT portid, BYTE value)
{
+ #if !defined( _WIN64 )
__asm mov edx,portid
__asm mov al,value
__asm out dx,al
+ #endif
}
diff --git a/plugins/KeyboardNotify/main.cpp b/plugins/KeyboardNotify/main.cpp
index fbadbf7e19..ff131f0c89 100644
--- a/plugins/KeyboardNotify/main.cpp
+++ b/plugins/KeyboardNotify/main.cpp
@@ -698,7 +698,7 @@ BOOL contactCheckProtocol(char *szProto, HANDLE hContact, WORD eventType)
BOOL checkStatus(char *szProto)
{
- if(!szProto)
+ if (!szProto)
return checkGlobalStatus();
return isStatusEnabled(CallProtoService(szProto, PS_GETSTATUS, 0, 0));
@@ -710,7 +710,7 @@ BOOL checkXstatus(char *szProto)
unsigned int i; int status=0;
ICQ_CUSTOM_STATUS xstatus={0};
- if(!szProto)
+ if (!szProto)
return checkGlobalXstatus();
for(i=0; i < ProtoList.protoCount; i++)
@@ -762,7 +762,7 @@ static int PluginMessageEventHook(WPARAM wParam, LPARAM lParam)
// ** Checks for pending events. If it finds any, it pings the FlashThread to keep the LEDs flashing.
// **
-static VOID CALLBACK ReminderTimer(HWND hwnd, UINT message, UINT idEvent, DWORD dwTime)
+static VOID CALLBACK ReminderTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime)
{
int nIndex;
CLISTEVENT *pCLEvent;
@@ -791,23 +791,19 @@ static VOID CALLBACK ReminderTimer(HWND hwnd, UINT message, UINT idEvent, DWORD
// Support for third-party plugins and mBot's scripts
-static int EnableService(WPARAM wParam, LPARAM lParam)
+static INT_PTR EnableService(WPARAM wParam, LPARAM lParam)
{
bFlashingEnabled = TRUE;
-
return 0;
}
-
-static int DisableService(WPARAM wParam, LPARAM lParam)
+static INT_PTR DisableService(WPARAM wParam, LPARAM lParam)
{
bFlashingEnabled = FALSE;
-
return 0;
}
-
-static int StartBlinkService(WPARAM wParam, LPARAM lParam)
+static INT_PTR StartBlinkService(WPARAM wParam, LPARAM lParam)
{
nExternCount += (unsigned int)wParam;
if (bFlashOnOther && checkNotifyOptions() && checkGlobalStatus() && checkGlobalXstatus()) {
@@ -819,8 +815,7 @@ static int StartBlinkService(WPARAM wParam, LPARAM lParam)
return 0;
}
-
-static int EventsWereOpenedService(WPARAM wParam, LPARAM lParam)
+static INT_PTR EventsWereOpenedService(WPARAM wParam, LPARAM lParam)
{
if ((unsigned int)wParam > nExternCount)
nExternCount = 0;
@@ -831,7 +826,7 @@ static int EventsWereOpenedService(WPARAM wParam, LPARAM lParam)
}
-static int IsFlashingActiveService(WPARAM wParam, LPARAM lParam)
+static INT_PTR IsFlashingActiveService(WPARAM wParam, LPARAM lParam)
{
if (!bReminderDisabled)
return 0;
@@ -987,9 +982,9 @@ void GetWindowsVersion(void)
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- if(!(bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) &osvi))) {
+ if (!(bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) &osvi))) {
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- if(!GetVersionEx((OSVERSIONINFO *)&osvi))
+ if (!GetVersionEx((OSVERSIONINFO *)&osvi))
osvi.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS;
}
bWindowsNT = osvi.dwPlatformId==VER_PLATFORM_WIN32_NT;
diff --git a/plugins/KeyboardNotify/options.cpp b/plugins/KeyboardNotify/options.cpp
index d415862503..993f9e119d 100644
--- a/plugins/KeyboardNotify/options.cpp
+++ b/plugins/KeyboardNotify/options.cpp
@@ -1116,7 +1116,8 @@ void exportThemes(const TCHAR *filename)
void importThemes(const TCHAR *filename, BOOL overrideExisting)
{
- int i, status=0;
+ int status=0;
+ size_t i;
FILE *fImport;
TCHAR buffer[MAX_PATH+1], theme[MAX_PATH+1], *str;
@@ -1428,7 +1429,8 @@ INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
case WM_INITDIALOG:
{
- unsigned int i, j;
+ unsigned int i;
+ WPARAM j;
int imageCount;
HICON hIconAux;
HIMAGELIST hImageList;
diff --git a/plugins/KeyboardNotify/protolist.h b/plugins/KeyboardNotify/protolist.h
index f48f64d126..5a08d929da 100644
--- a/plugins/KeyboardNotify/protolist.h
+++ b/plugins/KeyboardNotify/protolist.h
@@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
typedef struct {
- unsigned int count;
+ UINT_PTR count;
BOOL *enabled;
} XSTATUS_INFO;
diff --git a/plugins/KeyboardNotify/trigger.cpp b/plugins/KeyboardNotify/trigger.cpp
index 2f07230696..df3d7daaf3 100644
--- a/plugins/KeyboardNotify/trigger.cpp
+++ b/plugins/KeyboardNotify/trigger.cpp
@@ -57,7 +57,7 @@ int getCustomNro(DWORD actionID, HWND hwndDlg, int nItems)
return DEF_SETTING_CUSTOMTHEME;
}
-static BOOL CALLBACK DlgProcOptsActionKbdNotify(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK DlgProcOptsActionKbdNotify(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv;
DWORD actionID;
diff --git a/plugins/LangMan/langpack.c b/plugins/LangMan/langpack.c
index 6ce827c71a..2c517137d7 100644
--- a/plugins/LangMan/langpack.c
+++ b/plugins/LangMan/langpack.c
@@ -54,10 +54,10 @@ static void CleanupAuthors(char *szAuthors)
char *p,*p2;
/* remove trailing dot (if any) */
p=&szAuthors[lstrlenA(szAuthors)-1];
- if(*p=='.') *p='\0';
+ if (*p=='.') *p='\0';
/* remove any extra info in parentheses, which is ok
* but makes the list very long for some packs */
- for(;;) {
+ for (;;) {
p=strchr(szAuthors,'(');
p2=strchr(szAuthors,')');
if(p==NULL || p2==NULL) {
@@ -65,7 +65,7 @@ static void CleanupAuthors(char *szAuthors)
p2=strchr(szAuthors,']');
if(p==NULL || p2==NULL) break;
}
- if(*(p-1)==' ') --p;
+ if (*(p-1)==' ') --p;
MoveMemory(p,p2+1,lstrlenA(p2+1)+1);
}
}
@@ -105,7 +105,7 @@ static void CleanupEmail(char *szAuthorEmail)
/* lower case */
CharLowerA(szAuthorEmail);
/* 'none' specified */
- if(!lstrcmpiA(szAuthorEmail,"none")) szAuthorEmail[0]='\0';
+ if (!lstrcmpiA(szAuthorEmail,"none")) szAuthorEmail[0]='\0';
}
static void CleanupLastModifiedUsing(char *szLastModifiedUsing,int nSize)
@@ -127,7 +127,7 @@ static void CleanupLastModifiedUsing(char *szLastModifiedUsing,int nSize)
p=strstr(szLastModifiedUsing," v0.");
if(p!=NULL) MoveMemory(p+1,p+2,lstrlenA(p+2)+1);
/* default if empty */
- if(!szLastModifiedUsing[0]) {
+ if (!szLastModifiedUsing[0]) {
lstrcpynA(szLastModifiedUsing,MIRANDANAME" ",nSize);
CallService(MS_SYSTEM_GETVERSIONTEXT,nSize-lstrlenA(szLastModifiedUsing),(LPARAM)szLastModifiedUsing+lstrlenA(szLastModifiedUsing));
}
@@ -190,7 +190,7 @@ static BOOL LoadPackData(LANGPACK_INFO *pack,BOOL fEnabledPacks,const char *pszF
lstrcpynA(pack->szLastModifiedUsing, pszColon+1, sizeof(pack->szLastModifiedUsing)); /* buffer safe */
else if ( !lstrcmpA(line, "Authors")) {
buf=pack->szAuthors+lstrlenA(pack->szAuthors); /* allow multiple tags */
- if((sizeof(pack->szAuthors)-lstrlenA(pack->szAuthors))>0) /* buffer safe */
+ if ((sizeof(pack->szAuthors)-lstrlenA(pack->szAuthors))>0) /* buffer safe */
mir_snprintf(buf,sizeof(pack->szAuthors)-lstrlenA(pack->szAuthors),(pack->szAuthors[0]=='\0')?"%s":" %s",pszColon+1);
} else if ( !lstrcmpA(line, "Author-email") && !pack->szAuthorEmail[0])
lstrcpynA(pack->szAuthorEmail, pszColon+1, sizeof(pack->szAuthorEmail)); /* buffer safe */
@@ -213,7 +213,7 @@ static BOOL LoadPackData(LANGPACK_INFO *pack,BOOL fEnabledPacks,const char *pszF
CleanupEmail(pack->szAuthorEmail);
CleanupLastModifiedUsing(pack->szLastModifiedUsing,sizeof(pack->szLastModifiedUsing));
/* codepage */
- if(!(pack->flags&LPF_NOLOCALE))
+ if (!(pack->flags&LPF_NOLOCALE))
if(GetLocaleInfoA(pack->Locale,LOCALE_IDEFAULTANSICODEPAGE,line,6))
pack->codepage=(WORD)atoi(line); /* CP_ACP on error */
/* language */
@@ -223,14 +223,14 @@ static BOOL LoadPackData(LANGPACK_INFO *pack,BOOL fEnabledPacks,const char *pszF
lstrcpyA(pack->szLanguage,szLanguageA); /* buffer safe */
#endif
/* ensure the pack always has a language name */
- if(!pack->szLanguage[0] && !GetLocaleInfo(pack->Locale,LOCALE_SENGLANGUAGE,pack->szLanguage,SIZEOF(pack->szLanguage))) {
+ if (!pack->szLanguage[0] && !GetLocaleInfo(pack->Locale,LOCALE_SENGLANGUAGE,pack->szLanguage,SIZEOF(pack->szLanguage))) {
TCHAR *p;
lstrcpyn(pack->szLanguage,pack->szFileName,SIZEOF(pack->szLanguage)); /* buffer safe */
p=_tcsrchr(pack->szLanguage,_T('.'));
if(p!=NULL) *p='\0';
}
/* ensure the pack always has a filelisting name */
- if(!pack->szFLName[0])
+ if (!pack->szFLName[0])
lstrcatA(lstrcpyA(pack->szFLName,szLanguageA)," Language Pack"); /* buffer safe */
fclose(fp);
return TRUE;
@@ -242,11 +242,11 @@ BOOL GetPackPath(TCHAR *pszPath,int nSize,BOOL fEnabledPacks,const TCHAR *pszFil
{
TCHAR *p;
/* main path */
- if(!GetModuleFileName(NULL,pszPath,nSize)) return FALSE;
+ if (!GetModuleFileName(NULL,pszPath,nSize)) return FALSE;
p=_tcsrchr(pszPath,_T('\\'));
if(p!=NULL) *(p+1)=_T('\0');
/* subdirectory */
- if(!fEnabledPacks) {
+ if (!fEnabledPacks) {
if(nSize<(lstrlen(pszPath)+10)) return FALSE;
lstrcat(pszPath,_T("Plugins\\Language\\"));
}
@@ -274,18 +274,18 @@ BOOL EnumPacks(ENUM_PACKS_CALLBACK callback,const TCHAR *pszFilePattern,const ch
if(hFind!=INVALID_HANDLE_VALUE) {
do {
if(wfd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) continue;
- if((lstrlen(wfd.cFileName)<4) || wfd.cFileName[lstrlen(wfd.cFileName)-4]!=_T('.')) continue;
+ if ((lstrlen(wfd.cFileName)<4) || wfd.cFileName[lstrlen(wfd.cFileName)-4]!=_T('.')) continue;
/* get data */
ZeroMemory(&pack,sizeof(pack));
lstrcpy(pack.szFileName,CharLower(wfd.cFileName)); /* buffer safe */
if(LoadPackData(&pack,TRUE,pszFileVersionHeader)) {
pack.ftFileDate=wfd.ftLastWriteTime;
/* enabled? */
- if(!fPackFound) pack.flags|=LPF_ENABLED;
+ if (!fPackFound) pack.flags|=LPF_ENABLED;
fPackFound=TRUE;
/* callback */
if(callback!=NULL) res=callback(&pack,wParam,lParam);
- if(!res) { FindClose(hFind); return FALSE; }
+ if (!res) { FindClose(hFind); return FALSE; }
}
} while(FindNextFile(hFind,&wfd));
FindClose(hFind);
@@ -311,9 +311,9 @@ BOOL EnumPacks(ENUM_PACKS_CALLBACK callback,const TCHAR *pszFilePattern,const ch
}
}
pack.flags=LPF_NOLOCALE|LPF_DEFAULT;
- if(!fPackFound) pack.flags|=LPF_ENABLED;
+ if (!fPackFound) pack.flags|=LPF_ENABLED;
/* callback */
- if(!callback(&pack,wParam,lParam)) return FALSE;
+ if (!callback(&pack,wParam,lParam)) return FALSE;
}
/* disabled packs */
@@ -331,7 +331,7 @@ BOOL EnumPacks(ENUM_PACKS_CALLBACK callback,const TCHAR *pszFilePattern,const ch
fPackFound=TRUE;
/* callback */
if(callback!=NULL) res=callback(&pack,wParam,lParam);
- if(!res) { FindClose(hFind); return FALSE; }
+ if (!res) { FindClose(hFind); return FALSE; }
}
} while(FindNextFile(hFind,&wfd));
FindClose(hFind);
@@ -343,14 +343,14 @@ BOOL EnumPacks(ENUM_PACKS_CALLBACK callback,const TCHAR *pszFilePattern,const ch
BOOL IsPluginIncluded(const LANGPACK_INFO *pack,char *pszFileBaseName)
{
char *p;
- if(!lstrcmpiA(pszFileBaseName,"png2dib") || !lstrcmpiA(pszFileBaseName,"loadavatars"))
+ if (!lstrcmpiA(pszFileBaseName,"png2dib") || !lstrcmpiA(pszFileBaseName,"loadavatars"))
return TRUE; /* workaround: does not need no translation */
for(p=(char*)pack->szPluginsIncluded;;) {
p=strstr(p,CharLowerA(pszFileBaseName));
if(p==NULL) return FALSE;
if(p==pack->szPluginsIncluded || *(p-1)==' ' || *(p-1)==',') {
p+=lstrlenA(pszFileBaseName)+1;
- if(*p==',' || *p==' ' || *p==0) return TRUE;
+ if (*p==',' || *p==' ' || *p==0) return TRUE;
}
else p+=lstrlenA(pszFileBaseName)+1;
}
@@ -377,7 +377,7 @@ BOOL EnablePack(const LANGPACK_INFO *pack,const TCHAR *pszFilePattern)
/* move file */
if(GetPackPath(szFrom,SIZEOF(szFrom),TRUE,wfd.cFileName))
if(GetPackPath(szDest,SIZEOF(szDest),FALSE,wfd.cFileName))
- if(!MoveFile(szFrom,szDest) && GetLastError()==ERROR_ALREADY_EXISTS) {
+ if (!MoveFile(szFrom,szDest) && GetLastError()==ERROR_ALREADY_EXISTS) {
DeleteFile(szDest);
MoveFile(szFrom,szDest);
}
@@ -403,7 +403,7 @@ void CorrectPacks(const TCHAR *pszFilePattern,BOOL fDisableAll)
WIN32_FIND_DATA wfd;
/* main path */
- if(!GetModuleFileName(NULL,szDir,SIZEOF(szDir))) return;
+ if (!GetModuleFileName(NULL,szDir,SIZEOF(szDir))) return;
pszFile=_tcsrchr(szDir,_T('\\'));
if(pszFile!=NULL) *pszFile=_T('\0');
@@ -415,12 +415,12 @@ void CorrectPacks(const TCHAR *pszFilePattern,BOOL fDisableAll)
if(wfd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) continue;
if(lstrlen(wfd.cFileName)<4 || wfd.cFileName[lstrlen(wfd.cFileName)-4]!=_T('.')) continue;
/* ensure dir exists */
- if(!fDirCreated && GetPackPath(szFrom,SIZEOF(szFrom),FALSE,NULL))
+ if (!fDirCreated && GetPackPath(szFrom,SIZEOF(szFrom),FALSE,NULL))
fDirCreated=CreateDirectory(szFrom,NULL);
/* move file */
if(GetPackPath(szDest,SIZEOF(szDest),FALSE,wfd.cFileName)) {
mir_sntprintf(szFrom,SIZEOF(szFrom),_T("%s\\Plugins\\%s"),szDir,wfd.cFileName);
- if(!MoveFile(szFrom,szDest) && GetLastError()==ERROR_ALREADY_EXISTS) {
+ if (!MoveFile(szFrom,szDest) && GetLastError()==ERROR_ALREADY_EXISTS) {
DeleteFile(szDest);
MoveFile(szFrom,szDest);
}
@@ -437,14 +437,14 @@ void CorrectPacks(const TCHAR *pszFilePattern,BOOL fDisableAll)
if(wfd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) continue;
if(lstrlen(wfd.cFileName)<4 || wfd.cFileName[lstrlen(wfd.cFileName)-4]!=_T('.')) continue;
/* skip first file */
- if(!fDisableAll) { fDisableAll=TRUE; continue; }
+ if (!fDisableAll) { fDisableAll=TRUE; continue; }
/* ensure dir exists */
- if(!fDirCreated && GetPackPath(szFrom,SIZEOF(szFrom),FALSE,NULL))
+ if (!fDirCreated && GetPackPath(szFrom,SIZEOF(szFrom),FALSE,NULL))
fDirCreated=CreateDirectory(szFrom,NULL);
/* move file */
if(GetPackPath(szFrom,SIZEOF(szFrom),TRUE,wfd.cFileName))
if(GetPackPath(szDest,SIZEOF(szDest),FALSE,wfd.cFileName)) {
- if(!MoveFile(szFrom,szDest) && GetLastError()==ERROR_ALREADY_EXISTS) {
+ if (!MoveFile(szFrom,szDest) && GetLastError()==ERROR_ALREADY_EXISTS) {
DeleteFile(szDest);
MoveFile(szFrom,szDest);
}
diff --git a/plugins/LangMan/options.c b/plugins/LangMan/options.c
index 487461a2d2..37bc03f003 100644
--- a/plugins/LangMan/options.c
+++ b/plugins/LangMan/options.c
@@ -71,10 +71,10 @@ static HIMAGELIST CreateRadioImages(COLORREF clrBk,COLORREF clrText)
if(hTheme!=NULL) {
SetRect(&rc,0,0,size.cx,size.cy);
/* unchecked */
- if(!pfnDrawThemeBackground(hTheme,hdc,BP_RADIOBUTTON,RBS_UNCHECKEDNORMAL,&rc,NULL)) {
+ if (!pfnDrawThemeBackground(hTheme,hdc,BP_RADIOBUTTON,RBS_UNCHECKEDNORMAL,&rc,NULL)) {
/* checked */
OffsetRect(&rc,size.cx,0);
- if(!pfnDrawThemeBackground(hTheme,hdc,BP_RADIOBUTTON,RBS_CHECKEDNORMAL,&rc,NULL))
+ if (!pfnDrawThemeBackground(hTheme,hdc,BP_RADIOBUTTON,RBS_CHECKEDNORMAL,&rc,NULL))
himl=ImageList_Create(size.cx,size.cy,ILC_COLOR32|ILC_MASK,3,0);
}
pfnCloseThemeData(hTheme);
@@ -157,7 +157,7 @@ static void CleanupPluginName(char *szShortName)
int len;
/* strip-off anything in brackets */
for(p=szShortName;*p!='\0';++p)
- if(*p=='(' || *p=='[') {
+ if (*p=='(' || *p=='[') {
*p='\0';
break;
}
@@ -181,7 +181,7 @@ static void DisplayNotIncludedPlugins(HWND hwndListBox,const LANGPACK_INFO *pack
PLUGININFO *(__cdecl *MirandaPluginInfo)(DWORD);
/* enum plugins */
- if(!(pack->flags&LPF_DEFAULT) && GetModuleFileName(NULL,szDir,SIZEOF(szDir))) {
+ if (!(pack->flags&LPF_DEFAULT) && GetModuleFileName(NULL,szDir,SIZEOF(szDir))) {
p=_tcsrchr(szDir,_T('\\'));
if(p!=NULL) *p=_T('\0');
mir_sntprintf(szSearch,SIZEOF(szSearch),_T("%s\\Plugins\\*.dll"),szDir);
@@ -192,7 +192,7 @@ static void DisplayNotIncludedPlugins(HWND hwndListBox,const LANGPACK_INFO *pack
SendMessage(hwndListBox,LB_INITSTORAGE,128,lstrlenA(pack->szPluginsIncluded)); /* speed up */
do {
if(wfd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) continue;
- if((lstrlen(wfd.cFileName)<4) || (wfd.cFileName[lstrlen(wfd.cFileName)-4]!=_T('.'))) continue;
+ if ((lstrlen(wfd.cFileName)<4) || (wfd.cFileName[lstrlen(wfd.cFileName)-4]!=_T('.'))) continue;
/* file name */
lstrcpy(szSearch,wfd.cFileName); /* buffer safe */
p=_tcsrchr(szSearch,_T('.'));
@@ -233,7 +233,7 @@ static void DisplayNotIncludedPlugins(HWND hwndListBox,const LANGPACK_INFO *pack
}
}
/* all are included? */
- if(!SendMessage(hwndListBox,LB_GETCOUNT,0,0))
+ if (!SendMessage(hwndListBox,LB_GETCOUNT,0,0))
SendMessage(hwndListBox,LB_ADDSTRING,0,(LPARAM)TranslateT("All installed plugins are included."));
}
@@ -243,12 +243,12 @@ static void DisplayPackInfo(HWND hwndDlg,const LANGPACK_INFO *pack)
SendDlgItemMessage(hwndDlg,IDC_LANGNOTINCLUDED,LB_RESETCONTENT,0,0);
DisplayNotIncludedPlugins(GetDlgItem(hwndDlg,IDC_LANGNOTINCLUDED),pack);
/* locale string */
- if(!(pack->flags&LPF_NOLOCALE)) {
+ if (!(pack->flags&LPF_NOLOCALE)) {
TCHAR szLocaleName[128];
szLocaleName[0]=_T('\0');
/* can't use LOCALE_SNAME as it is not present on pre WinVista */
- if(!GetLocaleInfo(pack->Locale,LOCALE_SISO639LANGNAME,szLocaleName,SIZEOF(szLocaleName))) { /* Win98/NT4+ */
- if(!GetLocaleInfo(pack->Locale,LOCALE_SLANGUAGE,szLocaleName,SIZEOF(szLocaleName))) /* not unique! */
+ if (!GetLocaleInfo(pack->Locale,LOCALE_SISO639LANGNAME,szLocaleName,SIZEOF(szLocaleName))) { /* Win98/NT4+ */
+ if (!GetLocaleInfo(pack->Locale,LOCALE_SLANGUAGE,szLocaleName,SIZEOF(szLocaleName))) /* not unique! */
szLocaleName[0]=_T('\0');
} else {
if(GetLocaleInfo(pack->Locale,LOCALE_SISO3166CTRYNAME,&szLocaleName[3],SIZEOF(szLocaleName)-3)) /* Win98/NT4+ */
@@ -256,7 +256,7 @@ static void DisplayPackInfo(HWND hwndDlg,const LANGPACK_INFO *pack)
}
/* add some note if its incompatible */
if(szLocaleName[0]) {
- if(!IsValidLocale(pack->Locale,LCID_INSTALLED)) {
+ if (!IsValidLocale(pack->Locale,LCID_INSTALLED)) {
TCHAR *pszIncompat;
pszIncompat=TranslateT("(incompatible)");
szLocaleName[SIZEOF(szLocaleName)-lstrlen(pszIncompat)-1]=0;
@@ -278,7 +278,7 @@ static void DisplayPackInfo(HWND hwndDlg,const LANGPACK_INFO *pack)
/* version */
SetDlgItemTextA(hwndDlg,IDC_LANGVERSION,pack->szVersion);
if(pack->szVersion[0] && pack->szFLName[0]) {
- if(!IsWindowVisible(GetDlgItem(hwndDlg,IDC_LANGVERSIONLABEL))) {
+ if (!IsWindowVisible(GetDlgItem(hwndDlg,IDC_LANGVERSIONLABEL))) {
ShowWindow(GetDlgItem(hwndDlg,IDC_LANGVERSIONLABEL),SW_SHOW);
ShowWindow(GetDlgItem(hwndDlg,IDC_LANGVERSION),SW_SHOW);
}
@@ -311,7 +311,7 @@ static void DeletePackFile(HWND hwndDlg,HWND hwndList,int iItem,LANGPACK_INFO *p
szFileName[lstrlen(szFileName)+1]=_T('\0');
sfo.pFrom=szFileName;
/* ask to delete file */
- if(!SHFileOperation(&sfo) && !sfo.fAnyOperationsAborted) {
+ if (!SHFileOperation(&sfo) && !sfo.fAnyOperationsAborted) {
LVITEM lvi;
int nCount;
lvi.iItem=iItem;
@@ -342,7 +342,7 @@ static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack,WPARAM wParam,LPARAM lPar
CopyMemory(pack2,pack,sizeof(LANGPACK_INFO));
/* country flag icon */
lvi.mask=LVIF_TEXT|LVIF_PARAM|LVIF_STATE;
- if((HIMAGELIST)lParam!=NULL) {
+ if ((HIMAGELIST)lParam!=NULL) {
HICON hIcon;
if(pack->flags&LPF_DEFAULT)
hIcon=(HICON)CallService(MS_FLAGS_CREATEMERGEDFLAGICON,CTRY_UNITED_STATES,CTRY_UNITED_KINGDOM);
@@ -350,7 +350,7 @@ static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack,WPARAM wParam,LPARAM lPar
int countryId=0xFFFF; /* Unknown */
TCHAR szBuf[6];
/* get country id from locale */
- if(!(pack->flags&LPF_NOLOCALE))
+ if (!(pack->flags&LPF_NOLOCALE))
if(GetLocaleInfo(pack->Locale,LOCALE_ICOUNTRY,szBuf,SIZEOF(szBuf)))
countryId=_ttoi(szBuf);
hIcon=(HICON)CallService(MS_FLAGS_LOADFLAGICON,countryId,0);
@@ -429,7 +429,7 @@ static INT_PTR CALLBACK LangOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA
case M_SHOWFILECOL:
{ HWND hwndList;
hwndList=GetDlgItem(hwndDlg,IDC_LANGLIST);
- if((BOOL)lParam && ListView_GetItemCount(hwndList)>1) {
+ if ((BOOL)lParam && ListView_GetItemCount(hwndList)>1) {
LVCOLUMN lvc;
LVITEM lvi;
LANGPACK_INFO *pack;
@@ -502,7 +502,7 @@ static INT_PTR CALLBACK LangOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA
hti.iItem=ListView_GetNextItem((HWND)wParam,-1,LVNI_SELECTED);
if(hti.iItem!=-1)
break;
- if(!ListView_GetItemRect((HWND)wParam,hti.iItem,&rc,LVIR_SELECTBOUNDS))
+ if (!ListView_GetItemRect((HWND)wParam,hti.iItem,&rc,LVIR_SELECTBOUNDS))
break;
hti.pt.x=rc.left+(rc.right-rc.left)/2;
hti.pt.y=rc.top+(rc.bottom-rc.top)/2;
@@ -517,10 +517,10 @@ static INT_PTR CALLBACK LangOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA
lvi.iItem=hti.iItem;
lvi.iSubItem=0;
lvi.mask=LVIF_PARAM;
- if(!ListView_GetItem((HWND)wParam,&lvi)) break;
+ if (!ListView_GetItem((HWND)wParam,&lvi)) break;
pack=(LANGPACK_INFO*)lvi.lParam;
/* context menu */
- if(!(pack->flags&LPF_DEFAULT)) {
+ if (!(pack->flags&LPF_DEFAULT)) {
hContextMenu=CreatePopupMenu();
if(hContextMenu!=NULL) {
AppendMenu(hContextMenu,MF_STRING,2,TranslateT("&Remove..."));
@@ -553,7 +553,7 @@ static INT_PTR CALLBACK LangOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA
}
case LVN_ITEMCHANGED:
{ NMLISTVIEW *nmlv=(NMLISTVIEW*)lParam;
- if(!(nmlv->uChanged&LVIF_STATE)) break;
+ if (!(nmlv->uChanged&LVIF_STATE)) break;
/* display info and check radio item */
if(nmlv->uNewState&LVIS_SELECTED && !(nmlv->uOldState&LVIS_SELECTED)) {
ListView_SetItemState(nmhdr->hwndFrom,nmlv->iItem,INDEXTOSTATEIMAGEMASK(2),LVIS_STATEIMAGEMASK);
@@ -588,7 +588,7 @@ static INT_PTR CALLBACK LangOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA
lvi.mask=LVIF_PARAM;
if(ListView_GetItem(nmhdr->hwndFrom,&lvi)) {
pack=(LANGPACK_INFO*)lvi.lParam;
- if(!(pack->flags&LPF_DEFAULT))
+ if (!(pack->flags&LPF_DEFAULT))
DeletePackFile(hwndDlg,nmhdr->hwndFrom,iItem,pack);
}
break;
diff --git a/plugins/LangMan/utils.c b/plugins/LangMan/utils.c
index e727df2427..c4ca4a8a6b 100644
--- a/plugins/LangMan/utils.c
+++ b/plugins/LangMan/utils.c
@@ -49,7 +49,7 @@ void ShowInfoMessage(BYTE flags,const char *pszTitle,const char *pszTextFmt,...)
msn.szInfo=(char*)szText;
msn.uTimeout=30000; /* max timeout */
msn.dwInfoFlags=flags;
- if(!CallServiceSync(MS_CLIST_SYSTRAY_NOTIFY,0,(LPARAM)&msn))
+ if (!CallServiceSync(MS_CLIST_SYSTRAY_NOTIFY,0,(LPARAM)&msn))
return; /* success */
}
diff --git a/plugins/ListeningTo/players/foo_mlt/foo_mlt.cpp b/plugins/ListeningTo/players/foo_mlt/foo_mlt.cpp
index 8b2d2a262e..59b6ba3168 100644
--- a/plugins/ListeningTo/players/foo_mlt/foo_mlt.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/foo_mlt.cpp
@@ -374,7 +374,7 @@ public:
}
void on_quit()
{
- if(!g_off && FindWindow(MIRANDA_WINDOWCLASS, NULL) != NULL)
+ if (!g_off && FindWindow(MIRANDA_WINDOWCLASS, NULL) != NULL)
SendData(L"0\\0foobar2000\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0");
}
};
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/cfg_var.cpp b/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/cfg_var.cpp
index b374014164..ad00db236f 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/cfg_var.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/cfg_var.cpp
@@ -9,7 +9,7 @@ void cfg_var_reader::config_read_file(stream_reader * p_stream,abort_callback &
for(cfg_var_reader * walk = g_list; walk != NULL; walk = walk->m_next) {
vars.set(walk->m_guid,walk);
}
- for(;;) {
+ for (;;) {
GUID guid;
t_uint32 size;
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/config_object.cpp b/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/config_object.cpp
index 8de3814e54..76ba27d35a 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/config_object.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/config_object.cpp
@@ -184,7 +184,7 @@ void config_object_impl::set_data(stream_reader * p_stream,abort_callback & p_ab
m_data.set_size(0);
enum {delta = 1024};
t_uint8 buffer[delta];
- for(;;)
+ for (;;)
{
t_size delta_done = p_stream->read(buffer,delta,p_abort);
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/filesystem.cpp b/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/filesystem.cpp
index 5cc6879cea..a3c0405e9e 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/filesystem.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/filesystem.cpp
@@ -615,7 +615,7 @@ void stream_reader::read_string_ex(pfc::string_base & p_out,t_size p_bytes,abort
pfc::array_t<char> temp;
t_size allocWalk = expBase;
t_size done = 0;
- for(;;) {
+ for (;;) {
const t_size target = pfc::min_t(allocWalk, p_bytes);
temp.set_size(target);
read_object(temp.get_ptr() + done, target - done, p_abort);
@@ -640,7 +640,7 @@ void stream_reader::read_string_raw(pfc::string_base & p_out,abort_callback & p_
enum {delta = 256};
char buffer[delta];
p_out.reset();
- for(;;) {
+ for (;;) {
t_size delta_done;
delta_done = read(buffer,delta,p_abort);
p_out.add_string(buffer,delta_done);
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/filesystem_helper.h b/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/filesystem_helper.h
index 5e6769ea9c..5c537e67b7 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/filesystem_helper.h
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/filesystem_helper.h
@@ -662,5 +662,5 @@ private:
#define FB2K_RETRY_ON_SHARING_VIOLATION(OP, ABORT, TIMEOUT) \
{ \
pfc::lores_timer timer; timer.start(); \
- for(;;) try { {OP;} break; } catch(exception_io_sharing_violation) { if (timer.query() > TIMEOUT) throw; ABORT.sleep(0.01); } \
+ for (;;) try { {OP;} break; } catch(exception_io_sharing_violation) { if (timer.query() > TIMEOUT) throw; ABORT.sleep(0.01); } \
}
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/input.cpp b/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/input.cpp
index 2e9dd0aca6..3af8caaa65 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/input.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/input.cpp
@@ -203,7 +203,7 @@ void input_entry::g_open_for_info_write(service_ptr_t<input_info_writer> & p_ins
void input_entry::g_open_for_info_write_timeout(service_ptr_t<input_info_writer> & p_instance,service_ptr_t<file> p_filehint,const char * p_path,abort_callback & p_abort,double p_timeout,bool p_from_redirect) {
pfc::lores_timer timer;
timer.start();
- for(;;) {
+ for (;;) {
try {
g_open_for_info_write(p_instance,p_filehint,p_path,p_abort,p_from_redirect);
break;
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/metadb_handle_list.cpp b/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/metadb_handle_list.cpp
index eeffb79aa2..eb68fff666 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/metadb_handle_list.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/metadb_handle_list.cpp
@@ -101,7 +101,7 @@ namespace {
pfc::string8_fastalloc temp; temp.prealloc(512);
const t_size total = m_items.get_size();
- for(;;) {
+ for (;;) {
const t_size index = (*m_walk)++;
if (index >= total) break;
m_out[index].index = index;
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/tag_processor_id3v2.cpp b/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/tag_processor_id3v2.cpp
index 516bf3750d..384bb812b1 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/tag_processor_id3v2.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/SDK/tag_processor_id3v2.cpp
@@ -46,7 +46,7 @@ void tag_processor_id3v2::g_remove_ex(tag_write_callback & p_callback,const serv
t_size tag_processor_id3v2::g_multiskip(const service_ptr_t<file> & p_file,t_filesize & p_size_skipped,abort_callback & p_abort) {
t_filesize offset = 0;
t_size count = 0;
- for(;;) {
+ for (;;) {
t_filesize delta;
g_skip_at(p_file, offset, delta, p_abort);
if (delta == 0) break;
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/ProfileCache.h b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/ProfileCache.h
index 4425097c87..05497ce011 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/ProfileCache.h
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/ProfileCache.h
@@ -31,7 +31,7 @@ namespace ProfileCache {
throw;
}
pfc::array_t<t_uint8> buffer; buffer.set_size(64*1024);
- for(;;) {
+ for (;;) {
t_size delta = buffer.get_size();
delta = fRemote->read(buffer.get_ptr(), delta, abort);
fLocal->write(buffer.get_ptr(), delta, abort);
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/ThreadUtils.h b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/ThreadUtils.h
index 2b42213ba5..bc20bd2298 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/ThreadUtils.h
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/ThreadUtils.h
@@ -28,7 +28,7 @@ namespace ThreadUtils {
static void WaitAbortable_MsgLoop(HANDLE ev, abort_callback & abort) {
const HANDLE handles[2] = {ev, abort.get_abort_event()};
- for(;;) {
+ for (;;) {
SetLastError(0);
const DWORD status = MsgWaitForMultipleObjects(2, handles, FALSE, INFINITE, QS_ALLEVENTS);
switch(status) {
@@ -54,7 +54,7 @@ namespace ThreadUtils {
pfc::array_t<HANDLE> handles; handles.set_size(evCount + 1);
handles[0] = abort.get_abort_event();
pfc::memcpy_t(handles.get_ptr() + 1, ev, evCount);
- for(;;) {
+ for (;;) {
SetLastError(0);
const DWORD status = MsgWaitForMultipleObjects(handles.get_count(), handles.get_ptr(), FALSE, INFINITE, QS_ALLEVENTS);
switch(status) {
@@ -84,7 +84,7 @@ namespace ThreadUtils {
PFC_ASSERT( timeout != INFINITE );
const DWORD entry = GetTickCount();
const HANDLE handles[1] = {abort.get_abort_event()};
- for(;;) {
+ for (;;) {
const DWORD done = GetTickCount() - entry;
if (done >= timeout) return;
SetLastError(0);
@@ -106,7 +106,7 @@ namespace ThreadUtils {
PFC_ASSERT( timeout != INFINITE );
const DWORD entry = GetTickCount();
const HANDLE handles[2] = {ev, abort.get_abort_event()};
- for(;;) {
+ for (;;) {
const DWORD done = GetTickCount() - entry;
if (done >= timeout) return false;
SetLastError(0);
@@ -246,7 +246,7 @@ namespace ThreadUtils {
TRACK_CALL_TEXT("CSingleThreadWrapper entry");
try {
TBase instance;
- for(;;) {
+ for (;;) {
command_ptr cmd;
if (processMsgs) m_commands.Get_MsgLoop(cmd, m_threadAbort);
else m_commands.Get(cmd, m_threadAbort);
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/cue_creator.cpp b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/cue_creator.cpp
index 048700ec94..8752c12472 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/cue_creator.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/cue_creator.cpp
@@ -28,7 +28,7 @@ static bool is_meta_same_everywhere(const cue_creator::t_entry_list & p_list,con
iter = p_list.first();
if (!iter.is_valid()) return false;
if (!iter->m_infos.meta_format(p_meta,reference)) return false;
- for(;iter.is_valid();++iter)
+ for (;iter.is_valid();++iter)
{
if (!iter->m_infos.meta_format(p_meta,temp)) return false;
if (strcmp(temp,reference)!=0) return false;
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/file_info_const_impl.cpp b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/file_info_const_impl.cpp
index 41e2e1560d..5e20ea177e 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/file_info_const_impl.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/file_info_const_impl.cpp
@@ -182,7 +182,7 @@ void file_info_const_impl::copy(const file_info & p_source)
{
// profiler(file_info_const_impl__copy__pass2);
t_size index;
- for( index = 0; index < m_meta_count; index ++ )
+ for ( index = 0; index < m_meta_count; index ++ )
{
t_size val; const t_size val_max = p_source.meta_enum_value_count(index);
@@ -204,12 +204,12 @@ void file_info_const_impl::copy(const file_info & p_source)
else
{
meta[index].m_valuemap = valuemap;
- for( val = 0; val < val_max ; val ++ )
+ for ( val = 0; val < val_max ; val ++ )
*(valuemap ++ ) = stringbuffer_append(stringbuffer, p_source.meta_enum_value(index,val) );
}
}
- for( index = 0; index < m_info_count; index ++ )
+ for ( index = 0; index < m_info_count; index ++ )
{
const char * name = p_source.info_enum_name(index);
const char * name_opt = optimize_infoname(name);
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/filetimetools.cpp b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/filetimetools.cpp
index 0d38e95e50..a5a9068b06 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/filetimetools.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/filetimetools.cpp
@@ -31,7 +31,7 @@ t_filetimestamp foobar2000_io::filetimestamp_from_string(const char * date) {
t_size remaining = strlen(date);
SYSTEMTIME st = {};
st.wDay = 1; st.wMonth = 1;
- for(;;) {
+ for (;;) {
#define ADVANCE(n) { PFC_ASSERT( remaining >= n); date += n; remaining -= n; }
#define ADVANCE_TEST(n) { if (remaining < n) throw exception_time_error(); }
#define PARSE(var, digits) { ADVANCE_TEST(digits); var = (WORD) ParseDateElem(date, digits); ADVANCE(digits) ; }
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/listview_helper.cpp b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/listview_helper.cpp
index c434405c26..28eee6ff6f 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/listview_helper.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/listview_helper.cpp
@@ -138,7 +138,7 @@ static bool ProbeColumn(HWND view, int index) {
int ListView_GetColumnCount(HWND listView) {
if (!ProbeColumn(listView, 0)) return 0;
int hi = 1;
- for(;;) {
+ for (;;) {
if (!ProbeColumn(listView, hi)) break;
hi <<= 1;
if (hi <= 0) {
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/text_file_loader.cpp b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/text_file_loader.cpp
index ec63ff4039..b88403a352 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/text_file_loader.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/text_file_loader.cpp
@@ -48,7 +48,7 @@ namespace text_file_loader
mem.set_size(delta);
- for(;;)
+ for (;;)
{
done = p_file->read(mem.get_ptr(),delta,p_abort);
if (done > 0)
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/wildcard.cpp b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/wildcard.cpp
index c97eee4338..6021e4e569 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/wildcard.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/helpers/wildcard.cpp
@@ -2,7 +2,7 @@
static bool test_recur(const char * fn,const char * rm,bool b_sep)
{
- for(;;)
+ for (;;)
{
if ((b_sep && *rm==';') || *rm==0) return *fn==0;
else if (*rm=='*')
diff --git a/plugins/ListeningTo/players/foo_mlt/foobar2000/shared/shared.h b/plugins/ListeningTo/players/foo_mlt/foobar2000/shared/shared.h
index 5d57dbc921..ce91ae029c 100644
--- a/plugins/ListeningTo/players/foo_mlt/foobar2000/shared/shared.h
+++ b/plugins/ListeningTo/players/foo_mlt/foobar2000/shared/shared.h
@@ -814,7 +814,7 @@ private:
static bool IsPointInsideControl(const POINT& pt, HWND wnd) {
HWND walk = WindowFromPoint(pt);
- for(;;) {
+ for (;;) {
if (walk == NULL) return false;
if (walk == wnd) return true;
if (GetWindowLong(walk,GWL_STYLE) & WS_POPUP) return false;
diff --git a/plugins/ListeningTo/players/foo_mlt/pfc/array.h b/plugins/ListeningTo/players/foo_mlt/pfc/array.h
index 9e5c10359c..0ad6be2499 100644
--- a/plugins/ListeningTo/players/foo_mlt/pfc/array.h
+++ b/plugins/ListeningTo/players/foo_mlt/pfc/array.h
@@ -224,7 +224,7 @@ namespace pfc {
template<typename t_array1, typename t_array2>
static int compare(const t_array1 & p_array1, const t_array2 & p_array2) {
t_size walk = 0;
- for(;;) {
+ for (;;) {
if (walk >= p_array1.get_size() && walk >= p_array2.get_size()) return 0;
else if (walk >= p_array1.get_size()) return -1;
else if (walk >= p_array2.get_size()) return 1;
diff --git a/plugins/ListeningTo/players/foo_mlt/pfc/avltree.h b/plugins/ListeningTo/players/foo_mlt/pfc/avltree.h
index ff273719e2..930e003212 100644
--- a/plugins/ListeningTo/players/foo_mlt/pfc/avltree.h
+++ b/plugins/ListeningTo/players/foo_mlt/pfc/avltree.h
@@ -43,10 +43,10 @@ namespace pfc {
t_rawptr step(bool direction) throw() {
t_self* walk = this;
- for(;;) {
+ for (;;) {
t_self* t = walk->child(direction);
if (t != NULL) return t->peakchild(!direction);
- for(;;) {
+ for (;;) {
t = walk->m_parent;
if (t == NULL) return NULL;
if (t->which_child(walk) != direction) return t;
@@ -56,7 +56,7 @@ namespace pfc {
}
t_rawptr peakchild(bool direction) throw() {
t_self* walk = this;
- for(;;) {
+ for (;;) {
t_rawptr next = walk->child(direction);
if (next == NULL) return walk;
walk = next;
diff --git a/plugins/ListeningTo/players/foo_mlt/pfc/base64.cpp b/plugins/ListeningTo/players/foo_mlt/pfc/base64.cpp
index ce1c36e97a..c2a7db0f12 100644
--- a/plugins/ListeningTo/players/foo_mlt/pfc/base64.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/pfc/base64.cpp
@@ -48,7 +48,7 @@ namespace pfc {
{
const t_size max = textLen - 4;
t_size textWalk = 0;
- for(; textWalk < max; textWalk ++) {
+ for (; textWalk < max; textWalk ++) {
const t_uint8 v = alphabetRev[(t_uint8)text[textWalk]];
if (v == 0xFF) throw pfc::exception_invalid_params();
bitWriter::set_bits(reinterpret_cast<t_uint8*>(out),outWritePtr,v,6);
@@ -57,7 +57,7 @@ namespace pfc {
t_uint8 temp[3];
t_size tempWritePtr = 0;
- for(; textWalk < textLen; textWalk ++) {
+ for (; textWalk < textLen; textWalk ++) {
const char c = text[textWalk];
if (c == '=') break;
const t_uint8 v = alphabetRev[(t_uint8)c];
@@ -65,7 +65,7 @@ namespace pfc {
bitWriter::set_bits(temp,tempWritePtr,v,6);
tempWritePtr += 6;
}
- for(; textWalk < textLen; textWalk ++) {
+ for (; textWalk < textLen; textWalk ++) {
if (text[textWalk] != '=') throw pfc::exception_invalid_params();
}
memcpy(reinterpret_cast<t_uint8*>(out) + (outWritePtr/8), temp, tempWritePtr/8);
diff --git a/plugins/ListeningTo/players/foo_mlt/pfc/guid.cpp b/plugins/ListeningTo/players/foo_mlt/pfc/guid.cpp
index ed0fc02080..c90a9eac08 100644
--- a/plugins/ListeningTo/players/foo_mlt/pfc/guid.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/pfc/guid.cpp
@@ -41,7 +41,7 @@ unsigned GUID_from_text::read_dword(const char * ptr)
void GUID_from_text::read_bytes(BYTE * out,unsigned num,const char * ptr)
{
- for(;num;num--)
+ for (;num;num--)
{
*out = read_byte(ptr);
out++;ptr+=2;
diff --git a/plugins/ListeningTo/players/foo_mlt/pfc/iterators.h b/plugins/ListeningTo/players/foo_mlt/pfc/iterators.h
index 5455990cc4..bc68c65f41 100644
--- a/plugins/ListeningTo/players/foo_mlt/pfc/iterators.h
+++ b/plugins/ListeningTo/players/foo_mlt/pfc/iterators.h
@@ -86,7 +86,7 @@ namespace pfc {
static int compare(const t_list1 & p_list1, const t_list2 p_list2) {
typename t_list1::const_iterator iter1 = p_list1.first();
typename t_list2::const_iterator iter2 = p_list2.first();
- for(;;) {
+ for (;;) {
if (iter1.is_empty() && iter2.is_empty()) return 0;
else if (iter1.is_empty()) return -1;
else if (iter2.is_empty()) return 1;
@@ -103,7 +103,7 @@ namespace pfc {
static bool listEquals(const t_list1 & p_list1, const t_list2 & p_list2) {
typename t_list1::const_iterator iter1 = p_list1.first();
typename t_list2::const_iterator iter2 = p_list2.first();
- for(;;) {
+ for (;;) {
if (iter1.is_empty() && iter2.is_empty()) return true;
else if (iter1.is_empty() || iter2.is_empty()) return false;
else if (*iter1 != *iter2) return false;
diff --git a/plugins/ListeningTo/players/foo_mlt/pfc/other.cpp b/plugins/ListeningTo/players/foo_mlt/pfc/other.cpp
index 4db4b59011..fcb5a07b4c 100644
--- a/plugins/ListeningTo/players/foo_mlt/pfc/other.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/pfc/other.cpp
@@ -37,7 +37,7 @@ namespace pfc {
if (p_delta<0)
{
- for(;p_delta<0;p_delta++)
+ for (;p_delta<0;p_delta++)
{
t_size idx;
for(idx=1;idx<count;idx++)
@@ -52,7 +52,7 @@ namespace pfc {
}
else
{
- for(;p_delta>0;p_delta--)
+ for (;p_delta>0;p_delta--)
{
t_size idx;
for(idx=count-2;(int)idx>=0;idx--)
diff --git a/plugins/ListeningTo/players/foo_mlt/pfc/pathUtils.cpp b/plugins/ListeningTo/players/foo_mlt/pfc/pathUtils.cpp
index 84e5156c51..e936e656fa 100644
--- a/plugins/ListeningTo/players/foo_mlt/pfc/pathUtils.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/pfc/pathUtils.cpp
@@ -105,7 +105,7 @@ string replaceIllegalNameChars(string fn, bool allowWC) {
bool isInsideDirectory(pfc::string directory, pfc::string inside) {
//not very efficient
string walk = inside;
- for(;;) {
+ for (;;) {
walk = getParent(walk);
if (walk == "") return false;
if (equals(directory,walk)) return true;
diff --git a/plugins/ListeningTo/players/foo_mlt/pfc/primitives.h b/plugins/ListeningTo/players/foo_mlt/pfc/primitives.h
index dbdc8bc160..77444e8b67 100644
--- a/plugins/ListeningTo/players/foo_mlt/pfc/primitives.h
+++ b/plugins/ListeningTo/players/foo_mlt/pfc/primitives.h
@@ -368,7 +368,7 @@ namespace pfc {
t_size subtract_sorted_lists_calculate_count(const t_source1 & p_source1, const t_source2 & p_source2) {
t_size walk1 = 0, walk2 = 0, walk_out = 0;
const t_size max1 = p_source1.get_size(), max2 = p_source2.get_size();
- for(;;) {
+ for (;;) {
int state;
if (walk1 < max1 && walk2 < max2) {
state = pfc::compare_t(p_source1[walk1],p_source2[walk2]);
@@ -393,7 +393,7 @@ namespace pfc {
p_destination.set_size(subtract_sorted_lists_calculate_count(p_source1,p_source2));
t_size walk1 = 0, walk2 = 0, walk_out = 0;
const t_size max1 = p_source1.get_size(), max2 = p_source2.get_size();
- for(;;) {
+ for (;;) {
int state;
if (walk1 < max1 && walk2 < max2) {
state = pfc::compare_t(p_source1[walk1],p_source2[walk2]);
@@ -416,7 +416,7 @@ namespace pfc {
t_size merge_sorted_lists_calculate_count(const t_source1 & p_source1, const t_source2 & p_source2) {
t_size walk1 = 0, walk2 = 0, walk_out = 0;
const t_size max1 = p_source1.get_size(), max2 = p_source2.get_size();
- for(;;) {
+ for (;;) {
int state;
if (walk1 < max1 && walk2 < max2) {
state = pfc::compare_t(p_source1[walk1],p_source2[walk2]);
@@ -441,7 +441,7 @@ namespace pfc {
p_destination.set_size(merge_sorted_lists_calculate_count(p_source1,p_source2));
t_size walk1 = 0, walk2 = 0, walk_out = 0;
const t_size max1 = p_source1.get_size(), max2 = p_source2.get_size();
- for(;;) {
+ for (;;) {
int state;
if (walk1 < max1 && walk2 < max2) {
state = pfc::compare_t(p_source1[walk1],p_source2[walk2]);
diff --git a/plugins/ListeningTo/players/foo_mlt/pfc/string.cpp b/plugins/ListeningTo/players/foo_mlt/pfc/string.cpp
index a1506128e4..9b235c5845 100644
--- a/plugins/ListeningTo/players/foo_mlt/pfc/string.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/pfc/string.cpp
@@ -315,7 +315,7 @@ int strcmp_ex(const char* p1,t_size n1,const char* p2,t_size n2)
{
t_size idx = 0;
n1 = strlen_max(p1,n1); n2 = strlen_max(p2,n2);
- for(;;)
+ for (;;)
{
if (idx == n1 && idx == n2) return 0;
else if (idx == n1) return -1;//end of param1
@@ -384,7 +384,7 @@ t_int64 atoi64_ex(const char * src,t_size len)
int stricmp_ascii_ex(const char * const s1,t_size const len1,const char * const s2,t_size const len2) throw() {
t_size walk1 = 0, walk2 = 0;
- for(;;) {
+ for (;;) {
char c1 = (walk1 < len1) ? s1[walk1] : 0;
char c2 = (walk2 < len2) ? s2[walk2] : 0;
c1 = ascii_tolower(c1); c2 = ascii_tolower(c2);
@@ -397,7 +397,7 @@ int stricmp_ascii_ex(const char * const s1,t_size const len1,const char * const
}
int stricmp_ascii(const char * s1,const char * s2) throw() {
- for(;;) {
+ for (;;) {
char c1 = ascii_tolower(*s1), c2 = ascii_tolower(*s2);
if (c1<c2) return -1;
else if (c1>c2) return 1;
@@ -441,7 +441,7 @@ format_hex::format_hex(t_uint64 p_val,unsigned p_width)
if (n > 16 - p_width) n = 16 - p_width;
char * out = m_buffer;
- for(;n<16;n++)
+ for (;n<16;n++)
*(out++) = temp[n];
*out = 0;
}
@@ -469,7 +469,7 @@ format_hex_lowercase::format_hex_lowercase(t_uint64 p_val,unsigned p_width)
if (n > 16 - p_width) n = 16 - p_width;
char * out = m_buffer;
- for(;n<16;n++)
+ for (;n<16;n++)
*(out++) = temp[n];
*out = 0;
}
@@ -497,7 +497,7 @@ format_uint::format_uint(t_uint64 val,unsigned p_width,unsigned p_base)
char * out = m_buffer;
- for(;n<max_width;n++)
+ for (;n<max_width;n++)
*(out++) = temp[n];
*out = 0;
}
@@ -544,7 +544,7 @@ format_int::format_int(t_int64 p_val,unsigned p_width,unsigned p_base)
if (neg) *(out++) = '-';
- for(;n<max_width;n++)
+ for (;n<max_width;n++)
*(out++) = temp[n];
*out = 0;
}
@@ -799,7 +799,7 @@ void stringToLowerAppend(string_base & out, const char * src, t_size len) {
}
int stringCompareCaseInsensitiveEx(string_part_ref s1, string_part_ref s2) {
t_size w1 = 0, w2 = 0;
- for(;;) {
+ for (;;) {
unsigned c1, c2; t_size d1, d2;
d1 = utf8_decode_char(s1.m_ptr + w1, c1, s1.m_len - w1);
d2 = utf8_decode_char(s2.m_ptr + w2, c2, s2.m_len - w2);
@@ -815,7 +815,7 @@ int stringCompareCaseInsensitiveEx(string_part_ref s1, string_part_ref s2) {
}
}
int stringCompareCaseInsensitive(const char * s1, const char * s2) {
- for(;;) {
+ for (;;) {
unsigned c1, c2; t_size d1, d2;
d1 = utf8_decode_char(s1,c1);
d2 = utf8_decode_char(s2,c2);
@@ -902,7 +902,7 @@ void urlEncodeAppendRaw(pfc::string_base & out, const char * in, t_size inSize)
}
}
void urlEncodeAppend(pfc::string_base & out, const char * in) {
- for(;;) {
+ for (;;) {
const char c = *(in++);
if (c == 0) break;
else if (c == ' ') out.add_byte('+');
diff --git a/plugins/ListeningTo/players/foo_mlt/pfc/string.h b/plugins/ListeningTo/players/foo_mlt/pfc/string.h
index e9c7ed0f0b..e5bb47011f 100644
--- a/plugins/ListeningTo/players/foo_mlt/pfc/string.h
+++ b/plugins/ListeningTo/players/foo_mlt/pfc/string.h
@@ -38,7 +38,7 @@ namespace pfc {
void add_char(t_uint32 c);//adds unicode char to the string
void add_byte(char c) {add_string(&c,1);}
- void add_chars(t_uint32 p_char,t_size p_count) {for(;p_count;p_count--) add_char(p_char);}
+ void add_chars(t_uint32 p_char,t_size p_count) {for (;p_count;p_count--) add_char(p_char);}
protected:
string_receiver() {}
~string_receiver() {}
@@ -777,7 +777,7 @@ namespace pfc {
void splitStringEx(t_output & p_output, const t_splitCheck & p_check, const char * p_string, t_size p_stringLen = ~0) {
t_size walk = 0, splitBase = 0;
const t_size max = strlen_max(p_string,p_stringLen);
- for(;walk < max;) {
+ for (;walk < max;) {
t_size delta = p_check(p_string + walk,max - walk);
if (delta > 0) {
if (walk > splitBase) p_output(p_string + splitBase, walk - splitBase);
@@ -880,7 +880,7 @@ namespace pfc {
}
template<typename t_out> void splitStringByLines(t_out & out, const char * str) {
- for(;;) {
+ for (;;) {
const char * next = strchr(str, '\n');
if (next == NULL) {
out += string_part(str, strlen(str)); break;
@@ -892,7 +892,7 @@ namespace pfc {
}
}
template<typename t_out> void splitStringByChar(t_out & out, const char * str, char c) {
- for(;;) {
+ for (;;) {
const char * next = strchr(str, c);
if (next == NULL) {
out += string_part(str, strlen(str)); break;
diff --git a/plugins/ListeningTo/players/foo_mlt/pfc/stringNew.cpp b/plugins/ListeningTo/players/foo_mlt/pfc/stringNew.cpp
index f6652ee5f4..1e469a02a2 100644
--- a/plugins/ListeningTo/players/foo_mlt/pfc/stringNew.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/pfc/stringNew.cpp
@@ -38,7 +38,7 @@ bool string::startsWith(char c) const {
bool string::startsWith(string s) const {
const char * walk = ptr();
const char * subWalk = s.ptr();
- for(;;) {
+ for (;;) {
if (*subWalk == 0) return true;
if (*walk != *subWalk) return false;
walk++; subWalk++;
@@ -66,7 +66,7 @@ char string::lastChar() const {
string string::replace(stringp strOld, stringp strNew) const {
t_size walk = 0;
string ret;
- for(;;) {
+ for (;;) {
t_size next = indexOf(strOld, walk);
if (next == ~0) {
ret += subString(walk); break;
diff --git a/plugins/ListeningTo/players/foo_mlt/pfc/stringNew.h b/plugins/ListeningTo/players/foo_mlt/pfc/stringNew.h
index 2b93528e8e..121221e738 100644
--- a/plugins/ListeningTo/players/foo_mlt/pfc/stringNew.h
+++ b/plugins/ListeningTo/players/foo_mlt/pfc/stringNew.h
@@ -238,7 +238,7 @@ namespace pfc {
string acc;
if (iter.is_valid()) {
acc = *iter;
- for(++iter; iter.is_valid(); ++iter) {
+ for (++iter; iter.is_valid(); ++iter) {
acc = acc + separator + *iter;
}
}
diff --git a/plugins/ListeningTo/players/foo_mlt/pfc/string_conv.cpp b/plugins/ListeningTo/players/foo_mlt/pfc/string_conv.cpp
index 77b2deed59..52280337c6 100644
--- a/plugins/ListeningTo/players/foo_mlt/pfc/string_conv.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/pfc/string_conv.cpp
@@ -131,7 +131,7 @@ namespace pfc {
t_size estimate_utf8_to_wide(const char * p_in) {
t_size inptr = 0;
t_size retval = 1;//1 for null terminator
- for(;;) {
+ for (;;) {
unsigned newchar = 0;
t_size delta = utf8_decode_char(p_in + inptr,newchar);
if (delta == 0 || newchar == 0) break;
diff --git a/plugins/ListeningTo/players/foo_mlt/pfc/utf8.cpp b/plugins/ListeningTo/players/foo_mlt/pfc/utf8.cpp
index 81b37d21b9..58663abbf2 100644
--- a/plugins/ListeningTo/players/foo_mlt/pfc/utf8.cpp
+++ b/plugins/ListeningTo/players/foo_mlt/pfc/utf8.cpp
@@ -12,7 +12,7 @@ t_size utf8_char_len_from_header(char p_c) throw()
t_uint8 c = (t_uint8)p_c;
t_size cnt = 0;
- for(;;)
+ for (;;)
{
if ((p_c & mask_tab[cnt])==val_tab[cnt]) break;
if (++cnt>=6) return 0;
@@ -34,7 +34,7 @@ t_size utf8_decode_char(const char *p_utf8,unsigned & wide) throw() {
unsigned res=0;
unsigned n;
unsigned cnt=0;
- for(;;)
+ for (;;)
{
if ((*utf8&mask_tab[cnt])==val_tab[cnt]) break;
if (++cnt>=max) return 0;
@@ -82,7 +82,7 @@ t_size utf8_decode_char(const char *p_utf8,unsigned & wide,t_size max) throw()
unsigned res=0;
unsigned n;
unsigned cnt=0;
- for(;;)
+ for (;;)
{
if ((*utf8&mask_tab[cnt])==val_tab[cnt]) break;
if (++cnt>=max) return 0;
@@ -224,7 +224,7 @@ t_size utf8_char_len(const char * s,t_size max) throw()
t_size skip_utf8_chars(const char * ptr,t_size count) throw()
{
t_size num = 0;
- for(;count && ptr[num];count--)
+ for (;count && ptr[num];count--)
{
t_size d = utf8_char_len(ptr+num);
if (d<=0) break;
@@ -295,7 +295,7 @@ t_size strlen_utf8(const char * p,t_size num) throw()
unsigned w;
t_size d;
t_size ret = 0;
- for(;num;)
+ for (;num;)
{
d = utf8_decode_char(p,w);
if (w==0 || d<=0) break;
diff --git a/plugins/ListeningTo/players/winamp_mlt/wa_ipc.h b/plugins/ListeningTo/players/winamp_mlt/wa_ipc.h
index 7e1f75d22b..73082908c0 100644
--- a/plugins/ListeningTo/players/winamp_mlt/wa_ipc.h
+++ b/plugins/ListeningTo/players/winamp_mlt/wa_ipc.h
@@ -1632,7 +1632,7 @@ typedef struct {
**
** (5.5+)
** If you pass 1 in wParam then you will have zero returned if a language pack is in use.
-** if(!SendMessage(hwnd_winamp,WM_WA_IPC,1,IPC_GETLANGUAGEPACKINSTANCE)){
+** if (!SendMessage(hwnd_winamp,WM_WA_IPC,1,IPC_GETLANGUAGEPACKINSTANCE)) {
** // winamp is currently using a language pack
** }
**
@@ -1753,7 +1753,7 @@ typedef struct {
** information about it such as the name of the skin file.
**
** if(uMsg == WM_WA_IPC && lParam == IPC_GETSKININFO){
-** if(is_our_skin()){
+** if(is_our_skin()) {
** return is_our_skin_name();
** }
** }
@@ -2059,7 +2059,7 @@ typedef struct {
**
** BOOL CALLBACK enumWndProc(HWND hwnd, LPARAM lParam){
**
-** if(SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)hwnd,IPC_FF_ISMAINWND)){
+** if(SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)hwnd,IPC_FF_ISMAINWND)) {
** // do processing in here
** // or continue the enum for other main windows (if they exist)
** // and just comment out the line below
diff --git a/plugins/MenuItemEx/main.c b/plugins/MenuItemEx/main.c
index 00c3019ca6..6bce1486b3 100644
--- a/plugins/MenuItemEx/main.c
+++ b/plugins/MenuItemEx/main.c
@@ -327,7 +327,7 @@ BOOL isMetaContact(HANDLE hContact) {
char *proto;
if(bMetaContacts) {
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if( lstrcmpA(proto,"MetaContacts") == 0 ) {
+ if ( lstrcmpA(proto,"MetaContacts") == 0 ) {
return TRUE;
}
}
@@ -362,7 +362,7 @@ void GetID(HANDLE hContact,LPSTR szProto,LPSTR szID)
*szID='\0';
- if( uID && DBGetContactSetting(hContact, szProto, uID ,&dbv_uniqueid)==0 ) {
+ if ( uID && DBGetContactSetting(hContact, szProto, uID ,&dbv_uniqueid)==0 ) {
if (dbv_uniqueid.type ==DBVT_DWORD)
wsprintfA(szID, "%u", dbv_uniqueid.dVal);
else if (dbv_uniqueid.type ==DBVT_WORD)
@@ -384,7 +384,7 @@ int StatusMsgExists(HANDLE hContact)
int i;
module = (LPSTR) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if(!module) return 0;
+ if (!module) return 0;
for(i = 0; i < SIZEOF(statusMsg); i++) {
if (statusMsg[i].flag & 8)
@@ -408,7 +408,7 @@ BOOL IPExists(HANDLE hContact)
DWORD mIP,rIP;
szProto = (LPSTR) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if(!szProto) return 0;
+ if (!szProto) return 0;
mIP = DBGetContactSettingDword(hContact, szProto, "IP", 0);
rIP = DBGetContactSettingDword(hContact, szProto, "RealIP", 0);
@@ -422,7 +422,7 @@ BOOL MirVerExists(HANDLE hContact)
BOOL ret=0;
szProto = (LPSTR) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if(!szProto) return 0;
+ if (!szProto) return 0;
msg = DBGetString(hContact,szProto,"MirVer");
if(msg) {
@@ -439,8 +439,8 @@ void getIP(HANDLE hContact,LPSTR szProto,LPSTR szIP)
char szrIP[64]={0};
DWORD mIP = DBGetContactSettingDword(hContact, szProto, "IP", 0);
DWORD rIP = DBGetContactSettingDword(hContact, szProto, "RealIP", 0);
- if( mIP ) wsprintfA(szmIP, "External IP: %d.%d.%d.%d\r\n", mIP>>24,(mIP>>16)&0xFF,(mIP>>8)&0xFF,mIP&0xFF);
- if( rIP ) wsprintfA(szrIP, "Internal IP: %d.%d.%d.%d\r\n", rIP>>24,(rIP>>16)&0xFF,(rIP>>8)&0xFF,rIP&0xFF);
+ if ( mIP ) wsprintfA(szmIP, "External IP: %d.%d.%d.%d\r\n", mIP>>24,(mIP>>16)&0xFF,(mIP>>8)&0xFF,mIP&0xFF);
+ if ( rIP ) wsprintfA(szrIP, "Internal IP: %d.%d.%d.%d\r\n", rIP>>24,(rIP>>16)&0xFF,(rIP>>8)&0xFF,rIP&0xFF);
strcpy(szIP,szrIP);
strcat(szIP,szmIP);
}
@@ -450,7 +450,7 @@ LPSTR getMirVer(HANDLE hContact)
LPSTR szProto, msg;
szProto = (LPSTR) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if(!szProto) return NULL;
+ if (!szProto) return NULL;
msg = DBGetString(hContact,szProto,"MirVer");
if(msg) {
@@ -646,12 +646,12 @@ void ModifyCopyID(CLISTMENUITEM *cli, HANDLE hContact, BOOL bShowID, BOOL bTrimI
if(isMetaContact(hContact)) {
hC = getMostOnline(hContact);
- if( !hContact ) hC = getDefaultContact(hContact);
+ if ( !hContact ) hC = getDefaultContact(hContact);
hContact = hC;
}
szProto = (LPSTR) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if(!szProto) {
+ if (!szProto) {
HideItem(cli,hmenuCopyID);
return;
}
@@ -696,7 +696,7 @@ void ModifyStatusMsg(CLISTMENUITEM *cli,HANDLE hContact)
cli->flags|=CMIM_ICON;
szProto = (LPSTR) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if(!szProto) {
+ if (!szProto) {
HideItem(cli,hmenuStatusMsg);
return;
}
@@ -718,7 +718,7 @@ void ModifyCopyIP(CLISTMENUITEM *cli,HANDLE hContact)
cli->flags |= CMIM_ICON;
szProto = (LPSTR) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if(!szProto) {
+ if (!szProto) {
HideItem(cli,hmenuCopyIP);
return;
}
@@ -745,7 +745,7 @@ void ModifyCopyMirVer(CLISTMENUITEM *cli,HANDLE hContact)
mir_free(msg);
}
}
- if(!cli->hIcon) cli->hIcon = hIcon[0];
+ if (!cli->hIcon) cli->hIcon = hIcon[0];
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hmenuCopyMirVer,(LPARAM)cli);
}
@@ -759,7 +759,7 @@ INT_PTR onCopyID(WPARAM wparam,LPARAM lparam)
hContact = (HANDLE)wparam;
if(isMetaContact(hContact)) {
hC = getMostOnline(hContact);
- if( !hContact ) hC = getDefaultContact(hContact);
+ if ( !hContact ) hC = getDefaultContact(hContact);
hContact = hC;
}
if ((szProto = (LPSTR) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0)) == NULL)
@@ -796,7 +796,7 @@ INT_PTR onCopyStatusMsg(WPARAM wparam,LPARAM lparam)
DWORD flags=DBGetContactSettingDword(NULL,VISPLG,"flags",vf_default);
module = (LPSTR) CallService(MS_PROTO_GETCONTACTBASEPROTO, wparam, 0);
- if(!module) return 0;
+ if (!module) return 0;
buffer[0]=0;
for(i = 0; i < SIZEOF(statusMsg); i++) {
@@ -1039,12 +1039,12 @@ int BuildMenu(WPARAM wparam,LPARAM lparam)
}
else HideItem(&miPROTO,hmenuProto);
- if((bShowAll || flags & VF_ADD) && bIsOnline && (bMir_08 ? IsAccountEnabled( pa ) : TRUE))
+ if ((bShowAll || flags & VF_ADD) && bIsOnline && (bMir_08 ? IsAccountEnabled( pa ) : TRUE))
ShowItem(&miADD,hmenuAdded);
else
HideItem(&miADD,hmenuAdded);
- if((bShowAll || flags & VF_REQ) && bIsOnline && (bMir_08 ? IsAccountEnabled( pa ) : TRUE))
+ if ((bShowAll || flags & VF_REQ) && bIsOnline && (bMir_08 ? IsAccountEnabled( pa ) : TRUE))
ShowItem(&miREQ,hmenuAuthReq);
else
HideItem(&miREQ,hmenuAuthReq);
@@ -1055,22 +1055,22 @@ int BuildMenu(WPARAM wparam,LPARAM lparam)
}
else HideItem(&miCID,hmenuCopyID);
- if((bShowAll || flags&VF_RECV) && DirectoryExists((HANDLE)wparam)) ShowItem(&miRECV,hmenuRecvFiles);
+ if ((bShowAll || flags&VF_RECV) && DirectoryExists((HANDLE)wparam)) ShowItem(&miRECV,hmenuRecvFiles);
else HideItem(&miRECV,hmenuRecvFiles);
- if((bShowAll || flags&VF_STAT) && StatusMsgExists((HANDLE)wparam)){
+ if ((bShowAll || flags&VF_STAT) && StatusMsgExists((HANDLE)wparam)) {
ShowItem(&miSTAT,hmenuStatusMsg);
ModifyStatusMsg(&miSTAT,(HANDLE)wparam);
}
else HideItem(&miSTAT,hmenuStatusMsg);
- if((bShowAll || flags&VF_CIP) && IPExists((HANDLE)wparam)){
+ if ((bShowAll || flags&VF_CIP) && IPExists((HANDLE)wparam)) {
ShowItem(&miCIP,hmenuCopyIP);
ModifyCopyIP(&miCIP,(HANDLE)wparam);
}
else HideItem(&miCIP,hmenuCopyIP);
- if((bShowAll || flags&VF_CMV) && MirVerExists((HANDLE)wparam)){
+ if ((bShowAll || flags&VF_CMV) && MirVerExists((HANDLE)wparam)) {
ShowItem(&miCMV,hmenuCopyMirVer);
ModifyCopyMirVer(&miCMV,(HANDLE)wparam);
}
@@ -1119,7 +1119,7 @@ static int TabsrmmButtonPressed(WPARAM wParam, LPARAM lParam)
{
CustomButtonClickData *cbcd=(CustomButtonClickData *)lParam;
- if(!strcmp(cbcd->pszModule, MODULENAME) && cbcd->dwButtonId == 0)
+ if (!strcmp(cbcd->pszModule, MODULENAME) && cbcd->dwButtonId == 0)
onRecvFiles(wParam, 0);
return 0;
diff --git a/plugins/MetaContacts/addto.c b/plugins/MetaContacts/addto.c
index 3fcfcd2a62..f6ef14529b 100644
--- a/plugins/MetaContacts/addto.c
+++ b/plugins/MetaContacts/addto.c
@@ -61,7 +61,7 @@ int FillList(HWND list, BOOL sort)
while(hMetaUser) // The DB is searched through, to get all the metacontacts
{
- if((metaID=DBGetContactSettingDword(hMetaUser,META_PROTO,META_ID,(DWORD)-1))==(DWORD)-1)
+ if ((metaID=DBGetContactSettingDword(hMetaUser,META_PROTO,META_ID,(DWORD)-1))==(DWORD)-1)
{
// This isn't a MetaContact, go to the next
hMetaUser = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hMetaUser,0);
@@ -257,13 +257,13 @@ INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
HANDLE hMeta, hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
int item; // Get the index of the selected metacontact
- if((item = SendMessage(GetDlgItem(hwndDlg, IDC_METALIST),LB_GETCURSEL, 0, 0))==-1)
+ if ((item = SendMessage(GetDlgItem(hwndDlg, IDC_METALIST),LB_GETCURSEL, 0, 0))==-1)
return IDOK == MessageBox(hwndDlg,Translate("Please select a MetaContact"),Translate("No MetaContact selected"),MB_ICONHAND);
hMeta = (HANDLE)SendMessage(GetDlgItem(hwndDlg, IDC_METALIST), LB_GETITEMDATA, (WPARAM)item, 0);
{
- if(!Meta_Assign(hContact,hMeta, FALSE))
+ if (!Meta_Assign(hContact,hMeta, FALSE))
{
MessageBox(hwndDlg, Translate("Assignment to the MetaContact failed."), Translate("Assignment failure"),MB_ICONERROR);
}
diff --git a/plugins/MetaContacts/edit.c b/plugins/MetaContacts/edit.c
index 9a5f55d920..f477d825dc 100644
--- a/plugins/MetaContacts/edit.c
+++ b/plugins/MetaContacts/edit.c
@@ -222,7 +222,7 @@ void ApplyChanges(CHANGES *chg)
AI.format = PA_FORMAT_UNKNOWN;
strcpy(AI.filename, "X");
- if((int)CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
+ if ((int)CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
DBWriteContactSettingString(chg->hMeta, "ContactPhoto", "File",AI.filename);
}
@@ -388,7 +388,7 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
switch(LOWORD(wParam)) // hit control
{
case IDC_LST_CONTACTS: // did we hit our ListView contorl?
- if(((LPNMHDR)lParam)->code == NM_CLICK) {
+ if (((LPNMHDR)lParam)->code == NM_CLICK) {
hwnd = GetDlgItem(hwndDlg, IDC_LST_CONTACTS);
sel=SendMessage(hwnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED|LVNI_SELECTED); // return item selected
// enable buttons
@@ -404,7 +404,7 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
EnableWindow(hwnd, (sel != -1) && (sel < changes.num_contacts - 1));
/*
// custom draw stuff - change colour of listview things - doesn't affect selection :(
- } else if(((LPNMHDR)lParam)->code == NM_CUSTOMDRAW) {
+ } else if (((LPNMHDR)lParam)->code == NM_CUSTOMDRAW) {
SetWindowLong(hwndDlg, DWL_MSGRESULT, (LONG)ProcessCustomDraw(lParam));
return TRUE;
*/
diff --git a/plugins/MetaContacts/meta_api.c b/plugins/MetaContacts/meta_api.c
index bf3aed5d2f..6a8781f6e1 100644
--- a/plugins/MetaContacts/meta_api.c
+++ b/plugins/MetaContacts/meta_api.c
@@ -88,7 +88,7 @@ INT_PTR MetaAPI_SetDefaultContactNum(WPARAM wParam, LPARAM lParam) {
DWORD num_contacts = DBGetContactSettingDword((HANDLE)wParam, META_PROTO, "NumContacts", -1);
if(num_contacts == -1)
return 1;
- if((DWORD)lParam >= num_contacts || (DWORD)lParam < 0)
+ if ((DWORD)lParam >= num_contacts || (DWORD)lParam < 0)
return 1;
if(DBWriteContactSettingDword((HANDLE)wParam, META_PROTO, "Default", (DWORD)lParam))
return 1;
@@ -120,7 +120,7 @@ INT_PTR MetaAPI_SetDefaultContact(WPARAM wParam, LPARAM lParam) {
INT_PTR MetaAPI_ForceSendContactNum(WPARAM wParam, LPARAM lParam) {
HANDLE hContact = Meta_GetContactHandle((HANDLE)wParam, (int)lParam);
HANDLE hMeta = (HANDLE)DBGetContactSettingDword(hContact, META_PROTO, "Handle", 0);
- if(!hContact || !hMeta || hMeta != (HANDLE)wParam || DBGetContactSettingByte(hMeta, META_PROTO, "ForceDefault", 0))
+ if (!hContact || !hMeta || hMeta != (HANDLE)wParam || DBGetContactSettingByte(hMeta, META_PROTO, "ForceDefault", 0))
return 1;
DBWriteContactSettingDword(hMeta, META_PROTO, "ForceSend", (DWORD)hContact);
@@ -136,7 +136,7 @@ INT_PTR MetaAPI_ForceSendContactNum(WPARAM wParam, LPARAM lParam) {
INT_PTR MetaAPI_ForceSendContact(WPARAM wParam, LPARAM lParam) {
HANDLE hContact = (HANDLE)lParam;
HANDLE hMeta = (HANDLE)DBGetContactSettingDword(hContact, META_PROTO, "Handle", 0);
- if(!hContact || !hMeta || hMeta != (HANDLE)wParam || DBGetContactSettingByte(hMeta, META_PROTO, "ForceDefault", 0))
+ if (!hContact || !hMeta || hMeta != (HANDLE)wParam || DBGetContactSettingByte(hMeta, META_PROTO, "ForceDefault", 0))
return 1;
DBWriteContactSettingDword(hMeta, META_PROTO, "ForceSend", (DWORD)hContact);
@@ -182,7 +182,7 @@ INT_PTR MetaAPI_GetForceState(WPARAM wParam, LPARAM lParam) {
HANDLE hMeta = (HANDLE)wParam;
HANDLE hContact;
- if(!hMeta) return 0;
+ if (!hMeta) return 0;
if(DBGetContactSettingByte(hMeta, META_PROTO, "ForceDefault", 0)) {
if(lParam) *(DWORD *)lParam = DBGetContactSettingDword((HANDLE)wParam, META_PROTO, "Default", -1);
@@ -191,7 +191,7 @@ INT_PTR MetaAPI_GetForceState(WPARAM wParam, LPARAM lParam) {
hContact = (HANDLE)DBGetContactSettingDword(hMeta, META_PROTO, "ForceSend", 0);
- if(!hContact) {
+ if (!hContact) {
if(lParam) *(DWORD *)lParam = -1;
} else {
if(lParam) *(DWORD *)lParam = (DWORD)Meta_GetContactNumber(hContact);
diff --git a/plugins/MetaContacts/meta_main.c b/plugins/MetaContacts/meta_main.c
index eea5e0666e..2de31f978a 100644
--- a/plugins/MetaContacts/meta_main.c
+++ b/plugins/MetaContacts/meta_main.c
@@ -187,7 +187,7 @@ int __declspec(dllexport)Load(PLUGINLINK *link)
char *proto;
while(hContact != NULL) {
//proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if(!DBGetContactSetting(hContact, "Protocol", "p", &dbv)) {
+ if (!DBGetContactSetting(hContact, "Protocol", "p", &dbv)) {
proto = dbv.pszVal;
if (proto && !lstrcmp( META_PROTO, proto)) {
DBWriteContactSettingWord(hContact, META_PROTO, "Status", ID_STATUS_OFFLINE);
@@ -218,7 +218,7 @@ int __declspec(dllexport)Load(PLUGINLINK *link)
// that metacontacts: have the correct number of subcontacts, and have reasonable defaults
if(Meta_SetHandles()) {
// error - db corruption
- if(!DBGetContactSettingByte(0, META_PROTO, "DisabledMessageShown", 0)) {
+ if (!DBGetContactSettingByte(0, META_PROTO, "DisabledMessageShown", 0)) {
MessageBox(0, Translate("Error - Database corruption.\nPlugin disabled."), Translate("MetaContacts"), MB_OK | MB_ICONERROR);
DBWriteContactSettingByte(0, META_PROTO, "DisabledMessageShown", 1);
}
diff --git a/plugins/MetaContacts/meta_menu.c b/plugins/MetaContacts/meta_menu.c
index 36caabffa7..37ceb1116a 100644
--- a/plugins/MetaContacts/meta_menu.c
+++ b/plugins/MetaContacts/meta_menu.c
@@ -43,7 +43,7 @@ INT_PTR Meta_Convert(WPARAM wParam,LPARAM lParam)
// Get some information about the selected contact.
// proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0);
- if(!DBGetContactSettingStringUtf((HANDLE)wParam,"CList","Group",&dbv)) {
+ if (!DBGetContactSettingStringUtf((HANDLE)wParam,"CList","Group",&dbv)) {
group = _strdup(dbv.pszVal);
DBFreeVariant(&dbv);
}
@@ -70,14 +70,14 @@ INT_PTR Meta_Convert(WPARAM wParam,LPARAM lParam)
}
// Assign the contact to the MetaContact just created (and make default).
- if(!Meta_Assign((HANDLE)wParam,hMetaContact,TRUE)) {
+ if (!Meta_Assign((HANDLE)wParam,hMetaContact,TRUE)) {
MessageBox(0,Translate("There was a problem in assigning the contact to the MetaContact"),Translate("Error"),MB_ICONEXCLAMATION);
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hMetaContact, 0);
return 0;
}
// hide the contact if clist groups disabled (shouldn't create one anyway since menus disabled)
- if(!Meta_IsEnabled())
+ if (!Meta_IsEnabled())
DBWriteContactSettingByte(hMetaContact, "CList", "Hidden", 1);
}
@@ -153,7 +153,7 @@ void Meta_RemoveContactNumber(HANDLE hMeta, int number) {
hContact = Meta_GetContactHandle(hMeta, number);
// make sure this contact thinks it's part of this metacontact
- if((HANDLE)DBGetContactSettingDword(hContact,META_PROTO,"Handle", 0) == hMeta) {
+ if ((HANDLE)DBGetContactSettingDword(hContact,META_PROTO,"Handle", 0) == hMeta) {
// remove link to meta contact
DBDeleteContactSetting(hContact,META_PROTO,"IsSubcontact");
@@ -231,7 +231,7 @@ void Meta_RemoveContactNumber(HANDLE hMeta, int number) {
AI.format = PA_FORMAT_UNKNOWN;
strcpy(AI.filename, "X");
- if((int)CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
+ if ((int)CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
DBWriteContactSettingString(hMeta, "ContactPhoto", "File",AI.filename);
}
}
@@ -250,9 +250,9 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam)
DWORD metaID;
HANDLE hContact;
- if((metaID=DBGetContactSettingDword((HANDLE)wParam,META_PROTO,META_ID,(DWORD)-1))!=(DWORD)-1)
+ if ((metaID=DBGetContactSettingDword((HANDLE)wParam,META_PROTO,META_ID,(DWORD)-1))!=(DWORD)-1)
{// The wParam is a metacontact
- if(!lParam) { // check from recursion - see second half of this function
+ if (!lParam) { // check from recursion - see second half of this function
if(MessageBox((HWND)CallService(MS_CLUI_GETHWND,0,0),Translate("This will remove the MetaContact permanently.\n\nProceed Anyway?"),
Translate("Are you sure?"),MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2)!=IDYES)
{
@@ -327,7 +327,7 @@ INT_PTR Meta_Default(WPARAM wParam,LPARAM lParam)
{
HANDLE hMeta;
- if((hMeta = (HANDLE)DBGetContactSettingDword((HANDLE)wParam,META_PROTO,"Handle",0)) != 0)
+ if ((hMeta = (HANDLE)DBGetContactSettingDword((HANDLE)wParam,META_PROTO,"Handle",0)) != 0)
{ // the wParam is a subcontact
DBWriteContactSettingDword(hMeta, META_PROTO, "Default", (DWORD)Meta_GetContactNumber((HANDLE)wParam));
NotifyEventHooks(hEventDefaultChanged, (WPARAM)hMeta, (LPARAM)(HANDLE)wParam);
@@ -439,7 +439,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam)
hContact = Meta_GetContactHandle((HANDLE)wParam, i);
proto = _strdup((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0));
- if(!proto)
+ if (!proto)
status = ID_STATUS_OFFLINE;
else
status = DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE);
@@ -513,7 +513,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam)
}
else
{// This is a simple contact
- if(!Meta_IsEnabled())
+ if (!Meta_IsEnabled())
{
// groups disabled - all meta menu options hidden
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
diff --git a/plugins/MetaContacts/meta_options.c b/plugins/MetaContacts/meta_options.c
index 6fd6aa47e5..af23243c5e 100644
--- a/plugins/MetaContacts/meta_options.c
+++ b/plugins/MetaContacts/meta_options.c
@@ -65,7 +65,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
CheckDlgButton(hwndDlg, IDC_CHK_SUBHISTORY, options_changes.subhistory ? TRUE : FALSE);
CheckDlgButton(hwndDlg, IDC_CHK_COPYDATA, options_changes.copydata ? TRUE : FALSE);
- if(!options_changes.subcontact_windows) {
+ if (!options_changes.subcontact_windows) {
hw = GetDlgItem(hwndDlg, IDC_CHK_METAHISTORY);
EnableWindow(hw, FALSE);
} else {
@@ -257,7 +257,7 @@ int Meta_WriteOptions(MetaOptions *opt) {
DBWriteContactSettingByte(NULL, META_PROTO, "MetaMessageIcon", (BYTE)(opt->flash_meta_message_icon ? 1 : 0));
DBWriteContactSettingByte(NULL, META_PROTO, "CopyUserInfo", (BYTE)(opt->copy_userinfo ? 1 : 0));
- if(!opt->subcontact_windows)
+ if (!opt->subcontact_windows)
DBWriteContactSettingByte(NULL, META_PROTO, "MetaHistory", 1);
else
DBWriteContactSettingByte(NULL, META_PROTO, "MetaHistory", (BYTE)(opt->metahistory ? 1 : 0));
@@ -289,7 +289,7 @@ int Meta_ReadOptions(MetaOptions *opt) {
opt->flash_meta_message_icon = (DBGetContactSettingByte(NULL, META_PROTO, "MetaMessageIcon", 1) == 1 ? TRUE : FALSE);
opt->copy_userinfo = (DBGetContactSettingByte(NULL, META_PROTO, "CopyUserInfo", 1) == 1 ? TRUE : FALSE);
- if(!opt->subcontact_windows)
+ if (!opt->subcontact_windows)
opt->metahistory = TRUE;
else
opt->metahistory = (DBGetContactSettingByte(NULL, META_PROTO, "MetaHistory", 1) == 1 ? TRUE : FALSE);
@@ -340,7 +340,7 @@ ProtoStatusPrio *priorities = 0;
int GetRealPriority(char *proto, int status) {
char szSetting[256];
- if(!proto) {
+ if (!proto) {
mir_snprintf(szSetting, 256, "DefaultPrio_%d", status);
return DBGetContactSettingWord(0, META_PROTO, szSetting, GetDefaultPrio(status));
} else {
@@ -401,7 +401,7 @@ void WritePriorities() {
current = priorities + (i + 1);
for(j = ID_STATUS_OFFLINE; j <= ID_STATUS_OUTTOLUNCH; j++) {
mir_snprintf(szSetting, 256, "ProtoPrio_%s%d", pppDesc[i]->szName, j);
- if(!current->def[j - ID_STATUS_OFFLINE])
+ if (!current->def[j - ID_STATUS_OFFLINE])
DBWriteContactSettingWord(0, META_PROTO, szSetting, (WORD)current->prio[j - ID_STATUS_OFFLINE]);
else
DBDeleteContactSetting(0, META_PROTO, szSetting);
@@ -438,7 +438,7 @@ void SetPriority(int proto_index, int status, BOOL def, int prio) {
} else {
current = priorities + (proto_index + 1);
current->def[status - ID_STATUS_OFFLINE] = def;
- if(!def) {
+ if (!def) {
current->prio[status - ID_STATUS_OFFLINE] = prio;
}
}
diff --git a/plugins/MetaContacts/meta_services.c b/plugins/MetaContacts/meta_services.c
index bbf9177132..67644af23c 100644
--- a/plugins/MetaContacts/meta_services.c
+++ b/plugins/MetaContacts/meta_services.c
@@ -90,7 +90,7 @@ INT_PTR Meta_GetCaps(WPARAM wParam,LPARAM lParam)
ret = PF1_IM | PF1_CHAT | PF1_FILESEND | PF1_MODEMSGRECV | PF1_NUMERICUSERID;
break;
case PFLAGNUM_2:
- if(!options.suppress_proto) {
+ if (!options.suppress_proto) {
ret = PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND
| PF2_HEAVYDND | PF2_FREECHAT | PF2_OUTTOLUNCH | PF2_ONTHEPHONE;
}
@@ -264,7 +264,7 @@ INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam)
CCSDATA *ccs = (CCSDATA *) lParam;
HANDLE hMeta;
- if((hMeta = (HANDLE)DBGetContactSettingDword(ccs->hContact,META_PROTO, "Handle", (DWORD)0)) == (DWORD)0) {
+ if ((hMeta = (HANDLE)DBGetContactSettingDword(ccs->hContact,META_PROTO, "Handle", (DWORD)0)) == (DWORD)0) {
return CallService(MS_PROTO_CHAINSEND, wParam, lParam); // Can't find the MetaID of the metacontact linked to
}
@@ -336,7 +336,7 @@ INT_PTR Meta_SendMessage(WPARAM wParam,LPARAM lParam)
DWORD default_contact_number;
- if((default_contact_number = DBGetContactSettingDword(ccs->hContact,META_PROTO,"Default",(DWORD)-1)) == (DWORD)-1)
+ if ((default_contact_number = DBGetContactSettingDword(ccs->hContact,META_PROTO,"Default",(DWORD)-1)) == (DWORD)-1)
{
// This is a simple contact, let through the stack of protocols
// (this should normally not happen, since linked contacts do not appear on the list.)
@@ -350,7 +350,7 @@ INT_PTR Meta_SendMessage(WPARAM wParam,LPARAM lParam)
most_online = Meta_GetMostOnline(ccs->hContact);
//DBEVENTINFO dbei;
- if(!most_online) {
+ if (!most_online) {
DWORD dwThreadId;
HANDLE hEvent;
TFakeAckParams *tfap;
@@ -429,7 +429,7 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam)
PROTORECVEVENT *pre = (PROTORECVEVENT *) ccs->lParam;
HANDLE hMeta;
- if((hMeta = (HANDLE)DBGetContactSettingDword(ccs->hContact,META_PROTO, "Handle", (DWORD)0)) == (DWORD)0) {
+ if ((hMeta = (HANDLE)DBGetContactSettingDword(ccs->hContact,META_PROTO, "Handle", (DWORD)0)) == (DWORD)0) {
CallService(MS_PROTO_CHAINRECV, wParam, (LPARAM)ccs); // Can't find the MetaID of the metacontact linked to
// this contact, let through the protocol chain
return 0;
@@ -444,7 +444,7 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam)
// if meta disabled (now message api) or window open (message api), or using subcontact windows,
// let through but add db event for metacontact history
- if(!Meta_IsEnabled()
+ if (!Meta_IsEnabled()
|| DBGetContactSettingByte(ccs->hContact, META_PROTO, "WindowOpen", 0) == 1
|| options.subcontact_windows)
{
@@ -494,7 +494,7 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam)
}
}
- if(!added) {
+ if (!added) {
// otherwise add raw db event
ZeroMemory(&dbei, sizeof(dbei));
dbei.cbSize = sizeof(dbei);
@@ -571,7 +571,7 @@ INT_PTR Meta_RecvMessage(WPARAM wParam, LPARAM lParam)
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0);
// contact is not a meta proto contact - just leave it
- if(!proto || strcmp(proto, META_PROTO)) {
+ if (!proto || strcmp(proto, META_PROTO)) {
return 0;
}
@@ -629,7 +629,7 @@ int Meta_HandleACK(WPARAM wParam, LPARAM lParam)
return 0; // Can't find the MetaID, let through the protocol chain
- if(!strcmp(ack->szModule, META_PROTO)) {
+ if (!strcmp(ack->szModule, META_PROTO)) {
return 0; // don't rebroadcast our own acks
}
@@ -654,8 +654,8 @@ int Meta_HandleACK(WPARAM wParam, LPARAM lParam)
return 0;
}
- //if(!DBGetContactSetting(AI.hContact, "ContactPhoto", "File", &dbv)) {
- if(!DBGetContactSetting(ack->hContact, "ContactPhoto", "File", &dbv)) {
+ //if (!DBGetContactSetting(AI.hContact, "ContactPhoto", "File", &dbv)) {
+ if (!DBGetContactSetting(ack->hContact, "ContactPhoto", "File", &dbv)) {
DBWriteContactSettingString(hUser, "ContactPhoto", "File", dbv.pszVal);
DBFreeVariant(&dbv);
}
@@ -713,7 +713,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
int meta_id;
while ( hContact != NULL ) {
- if((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1))!=(DWORD)-1) {
+ if ((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1))!=(DWORD)-1) {
Meta_CopyData(hContact);
}
hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
@@ -734,7 +734,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
// from here on, we're just interested in contact settings
if(wParam == 0) return 0;
- if((hMeta=(HANDLE)DBGetContactSettingDword((HANDLE)wParam,META_PROTO,"Handle",0))!=0
+ if ((hMeta=(HANDLE)DBGetContactSettingDword((HANDLE)wParam,META_PROTO,"Handle",0))!=0
&& CallService(MS_DB_CONTACT_IS, (WPARAM)hMeta, 0)) // just to be safe
{ // This contact is attached to a MetaContact.
@@ -742,9 +742,9 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
contact_number = Meta_GetContactNumber((HANDLE)wParam);
if(contact_number == -1) return 0; // exit - db corruption
- if(!meta_group_hack_disabled && !strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "Group") &&
+ if (!meta_group_hack_disabled && !strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "Group") &&
Meta_IsEnabled() && DBGetContactSettingByte((HANDLE)wParam, META_PROTO, "Hidden", 0) == 0 && !Miranda_Terminated()) {
- if((dcws->value.type == DBVT_ASCIIZ || dcws->value.type == DBVT_UTF8) && !Meta_IsHiddenGroup(dcws->value.pszVal)) {
+ if ((dcws->value.type == DBVT_ASCIIZ || dcws->value.type == DBVT_UTF8) && !Meta_IsHiddenGroup(dcws->value.pszVal)) {
// subcontact group reassigned - copy to saved group
MyDBWriteContactSetting((HANDLE)wParam, META_PROTO, "OldCListGroup", &dcws->value);
DBWriteContactSettingString((HANDLE)wParam, "CList", "Group", META_HIDDEN_GROUP);
@@ -755,7 +755,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
} else
// copy IP
- if(!strcmp(dcws->szSetting, "IP")) {
+ if (!strcmp(dcws->szSetting, "IP")) {
if(dcws->value.type == DBVT_DWORD)
DBWriteContactSettingDword(hMeta, META_PROTO, "IP", dcws->value.dVal);
else
@@ -763,7 +763,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
} else
// copy RealIP
- if(!strcmp(dcws->szSetting, "RealIP")) {
+ if (!strcmp(dcws->szSetting, "RealIP")) {
if(dcws->value.type == DBVT_DWORD)
DBWriteContactSettingDword(hMeta, META_PROTO, "RealIP", dcws->value.dVal);
else
@@ -771,7 +771,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
} else
// copy ListeningTo
- if(!strcmp(dcws->szSetting, "ListeningTo")) {
+ if (!strcmp(dcws->szSetting, "ListeningTo")) {
switch(dcws->value.type) {
case DBVT_ASCIIZ:
DBWriteContactSettingString(hMeta, META_PROTO, "ListeningTo", dcws->value.pszVal);
@@ -788,7 +788,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
}
} else
- if(!strcmp(dcws->szSetting, "Nick") && !dcws->value.type == DBVT_DELETED) {
+ if (!strcmp(dcws->szSetting, "Nick") && !dcws->value.type == DBVT_DELETED) {
DBVARIANT dbv;
HANDLE most_online;
@@ -812,21 +812,21 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
return 0;
} else
- if(!strcmp(dcws->szSetting, "IdleTS")) {
+ if (!strcmp(dcws->szSetting, "IdleTS")) {
if(dcws->value.type == DBVT_DWORD)
DBWriteContactSettingDword(hMeta, META_PROTO, "IdleTS", dcws->value.dVal);
else if(dcws->value.type == DBVT_DELETED)
DBWriteContactSettingDword(hMeta, META_PROTO, "IdleTS", 0);
} else
- if(!strcmp(dcws->szSetting, "LogonTS")) {
+ if (!strcmp(dcws->szSetting, "LogonTS")) {
if(dcws->value.type == DBVT_DWORD)
DBWriteContactSettingDword(hMeta, META_PROTO, "LogonTS", dcws->value.dVal);
else if(dcws->value.type == DBVT_DELETED)
DBWriteContactSettingDword(hMeta, META_PROTO, "LogonTS", 0);
} else
- if(!strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "MyHandle")) {
+ if (!strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "MyHandle")) {
HANDLE most_online;
if(dcws->value.type == DBVT_DELETED) {
@@ -856,7 +856,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
return 0;
} else
- if(!strcmp(dcws->szSetting, "Status") && !dcws->value.type == DBVT_DELETED) {
+ if (!strcmp(dcws->szSetting, "Status") && !dcws->value.type == DBVT_DELETED) {
// subcontact changing status
// update subcontact status setting
@@ -869,7 +869,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
DBWriteContactSettingString(hMeta, META_PROTO, buffer, buffer2);
// if the contact was forced, unforce it (which updates status)
- if((HANDLE)DBGetContactSettingDword(hMeta, META_PROTO, "ForceSend", 0) == (HANDLE)wParam) {
+ if ((HANDLE)DBGetContactSettingDword(hMeta, META_PROTO, "ForceSend", 0) == (HANDLE)wParam) {
MetaAPI_UnforceSendContact((WPARAM)hMeta, 0);
} else {
// set status to that of most online contact
@@ -891,7 +891,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
AI.format = PA_FORMAT_UNKNOWN;
strcpy(AI.filename, "X");
- if((int)CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
+ if ((int)CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
DBWriteContactSettingString(hMeta, "ContactPhoto", "File",AI.filename);
}
} else
@@ -904,8 +904,8 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
Meta_CopyData(hMeta);
} else
- if(!meta_group_hack_disabled && !strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "Hidden")) {
- if((dcws->value.type == DBVT_DELETED || DBGetContactSettingByte((HANDLE)wParam, "CList", "Hidden", 0) == 0)
+ if (!meta_group_hack_disabled && !strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "Hidden")) {
+ if ((dcws->value.type == DBVT_DELETED || DBGetContactSettingByte((HANDLE)wParam, "CList", "Hidden", 0) == 0)
&& DBGetContactSettingByte((HANDLE)wParam, META_PROTO, "Hidden", 0) == 1)
{
// a subcontact we hid (e.g. jabber) has been unhidden - hide it again :(
@@ -982,7 +982,7 @@ INT_PTR Meta_UserIsTyping(WPARAM wParam, LPARAM lParam)
HANDLE most_online = Meta_GetMostOnline((HANDLE)wParam);
Meta_CopyContactNick((HANDLE)wParam, most_online);
- if(!most_online) return 0;
+ if (!most_online) return 0;
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online, 0);
if(proto) {
@@ -1007,12 +1007,12 @@ int Meta_ContactIsTyping(WPARAM wParam, LPARAM lParam)
{
HANDLE hMeta;
- if((hMeta = (HANDLE)DBGetContactSettingDword((HANDLE)wParam,META_PROTO,"Handle",(DWORD)0)) != 0
+ if ((hMeta = (HANDLE)DBGetContactSettingDword((HANDLE)wParam,META_PROTO,"Handle",(DWORD)0)) != 0
// check metacontacts enabled
&& Meta_IsEnabled()
)
{ // This contact is attached to a MetaContact.
- if(!options.subcontact_windows) { // we don't want clicking on the clist notification icon to open the metacontact message window
+ if (!options.subcontact_windows) { // we don't want clicking on the clist notification icon to open the metacontact message window
// try to remove any clist events we added for subcontact
CallServiceSync(MS_CLIST_REMOVEEVENT, wParam, (LPARAM) 1);
@@ -1052,7 +1052,7 @@ int Meta_MessageWindowEvent(WPARAM wParam, LPARAM lParam) {
message_window_api_enabled = TRUE;
- if((hMeta = (HANDLE)DBGetContactSettingDword(mwed->hContact, META_PROTO, "Handle", 0)) != 0
+ if ((hMeta = (HANDLE)DBGetContactSettingDword(mwed->hContact, META_PROTO, "Handle", 0)) != 0
|| DBGetContactSettingDword(mwed->hContact, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1)
{
// contact is subcontact of metacontact, or an actual metacontact - record whether window is open or closed
@@ -1064,7 +1064,7 @@ int Meta_MessageWindowEvent(WPARAM wParam, LPARAM lParam) {
}
} else if(mwed->uType == MSG_WINDOW_EVT_CLOSE || mwed->uType == MSG_WINDOW_EVT_CLOSING) {
DBWriteContactSettingByte(mwed->hContact, META_PROTO, "WindowOpen", 0);
- if(!hMeta) { // hMeta is 0 for metacontact (sorry)
+ if (!hMeta) { // hMeta is 0 for metacontact (sorry)
DWORD saved_def;
MetaAPI_UnforceSendContact((WPARAM)mwed->hContact, 0);
@@ -1152,7 +1152,7 @@ int Meta_CListMW_ExtraIconsApply(WPARAM wParam, LPARAM lParam) {
WORD status = DBGetContactSettingWord(most_online_im, proto, "Status", ID_STATUS_OFFLINE);
iec.cbSize = sizeof(iec);
for(i = 0; i < proto_count; i++) {
- if(!strcmp((proto_names + i * 128), proto)) {
+ if (!strcmp((proto_names + i * 128), proto)) {
if(hExtraImage[i * 2 + (status == ID_STATUS_OFFLINE ? 1 : 0)]) {
iec.hImage = hExtraImage[i * 2 + (status == ID_STATUS_OFFLINE ? 1 : 0)];
iec.ColumnType = EXTRA_ICON_ADV2;
@@ -1186,7 +1186,7 @@ int Meta_ClistDoubleClicked(WPARAM wParam, LPARAM lParam) {
char buffer[512];
int caps;
- if(!most_online)
+ if (!most_online)
return 0;
if(options.subcontact_windows) {
@@ -1208,7 +1208,7 @@ int Meta_ClistDoubleClicked(WPARAM wParam, LPARAM lParam) {
// get the contacts messaging capabilities
caps = CallService(buffer, (WPARAM)PFLAGNUM_1, 0);
- if((caps & PF1_IMSEND) || (caps & PF1_CHAT) || (proto && strcmp(proto, "IRC") == 0))
+ if ((caps & PF1_IMSEND) || (caps & PF1_CHAT) || (proto && strcmp(proto, "IRC") == 0))
// let event process normally
return 0;
else {
@@ -1369,7 +1369,7 @@ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam)
HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
int meta_id;
while ( hContact != NULL ) {
- if((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1))!=(DWORD)-1) {
+ if ((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1))!=(DWORD)-1) {
Meta_CopyData(hContact);
}
hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
@@ -1380,7 +1380,7 @@ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam)
InitIcons();
- if(!Meta_IsEnabled())
+ if (!Meta_IsEnabled())
{
// modify main menu item
menu.flags = CMIM_NAME;
@@ -1464,7 +1464,7 @@ INT_PTR Meta_ContactMenuFunc(WPARAM wParam, LPARAM lParam) {
caps = CallService(buffer, (WPARAM)PFLAGNUM_1, 0);
- if((caps & PF1_IMSEND) || (caps & PF1_CHAT) || (proto && strcmp(proto, "IRC") == 0)) {
+ if ((caps & PF1_IMSEND) || (caps & PF1_CHAT) || (proto && strcmp(proto, "IRC") == 0)) {
// set default contact for sending/status and open message window
DBWriteContactSettingDword((HANDLE)wParam, META_PROTO, "Default", (DWORD)(int)lParam);
NotifyEventHooks(hEventDefaultChanged, wParam, (LPARAM)hContact);
@@ -1511,7 +1511,7 @@ INT_PTR Meta_FileResume(WPARAM wParam, LPARAM lParam)
DBFreeVariant(&dbv);
- if(!most_online)
+ if (!most_online)
return 0;
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online, 0);
@@ -1547,7 +1547,7 @@ INT_PTR Meta_FileAllow(WPARAM wParam, LPARAM lParam)
DBFreeVariant(&dbv);
- if(!most_online)
+ if (!most_online)
return 0;
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online, 0);
@@ -1584,7 +1584,7 @@ INT_PTR Meta_FileDeny(WPARAM wParam, LPARAM lParam)
DBFreeVariant(&dbv);
- if(!most_online)
+ if (!most_online)
return 1;
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online, 0);
@@ -1621,7 +1621,7 @@ INT_PTR Meta_FileRecv(WPARAM wParam, LPARAM lParam)
DBFreeVariant(&dbv);
- if(!most_online)
+ if (!most_online)
return 0;
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online, 0);
@@ -1659,7 +1659,7 @@ int Meta_FileCancel(WPARAM wParam, LPARAM lParam)
DBFreeVariant(&dbv);
- if(!most_online)
+ if (!most_online)
return 0;
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online, 0);
@@ -1683,7 +1683,7 @@ INT_PTR Meta_FileSend(WPARAM wParam, LPARAM lParam)
char *proto = 0;
DWORD default_contact_number;
- if((default_contact_number = DBGetContactSettingDword(ccs->hContact,META_PROTO,"Default",(DWORD)-1)) == (DWORD)-1)
+ if ((default_contact_number = DBGetContactSettingDword(ccs->hContact,META_PROTO,"Default",(DWORD)-1)) == (DWORD)-1)
{
// This is a simple contact
// (this should normally not happen, since linked contacts do not appear on the list.)
@@ -1698,7 +1698,7 @@ INT_PTR Meta_FileSend(WPARAM wParam, LPARAM lParam)
most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_1, PF1_FILESEND);
- if(!most_online) {
+ if (!most_online) {
//PUShowMessage("no most online for ft", SM_NOTIFY);
return 0;
}
@@ -1728,7 +1728,7 @@ INT_PTR Meta_GetAwayMsg(WPARAM wParam, LPARAM lParam) {
char *proto = 0;
DWORD default_contact_number;
- if((default_contact_number = DBGetContactSettingDword(ccs->hContact,META_PROTO,"Default",(DWORD)-1)) == (DWORD)-1)
+ if ((default_contact_number = DBGetContactSettingDword(ccs->hContact,META_PROTO,"Default",(DWORD)-1)) == (DWORD)-1)
{
// This is a simple contact
// (this should normally not happen, since linked contacts do not appear on the list.)
@@ -1740,11 +1740,11 @@ INT_PTR Meta_GetAwayMsg(WPARAM wParam, LPARAM lParam) {
most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_1, PF1_MODEMSGRECV);
- if(!most_online)
+ if (!most_online)
return 0;
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online, 0);
- if(!proto) return 0;
+ if (!proto) return 0;
//Meta_CopyContactNick(ccs->hContact, most_online, proto);
@@ -1761,7 +1761,7 @@ INT_PTR Meta_GetAvatarInfo(WPARAM wParam, LPARAM lParam) {
char *proto = 0;
DWORD default_contact_number;
- if((default_contact_number = DBGetContactSettingDword(AI->hContact,META_PROTO,"Default",(DWORD)-1)) == (DWORD)-1)
+ if ((default_contact_number = DBGetContactSettingDword(AI->hContact,META_PROTO,"Default",(DWORD)-1)) == (DWORD)-1)
{
// This is a simple contact
// (this should normally not happen, since linked contacts do not appear on the list.)
@@ -1776,11 +1776,11 @@ INT_PTR Meta_GetAvatarInfo(WPARAM wParam, LPARAM lParam) {
hMeta = AI->hContact;
hSub = Meta_GetMostOnlineSupporting(AI->hContact, PFLAGNUM_4, PF4_AVATARS);
- if(!hSub)
+ if (!hSub)
return GAIR_NOAVATAR;
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hSub, 0);
- if(!proto) return GAIR_NOAVATAR;
+ if (!proto) return GAIR_NOAVATAR;
AI->hContact = hSub;
@@ -1797,7 +1797,7 @@ INT_PTR Meta_GetInfo(WPARAM wParam, LPARAM lParam) {
char *proto = 0;
DWORD default_contact_number;
- if((default_contact_number = DBGetContactSettingDword(ccs->hContact,META_PROTO,"Default",(DWORD)-1)) == (DWORD)-1)
+ if ((default_contact_number = DBGetContactSettingDword(ccs->hContact,META_PROTO,"Default",(DWORD)-1)) == (DWORD)-1)
{
// This is a simple contact
// (this should normally not happen, since linked contacts do not appear on the list.)
@@ -1811,23 +1811,23 @@ INT_PTR Meta_GetInfo(WPARAM wParam, LPARAM lParam) {
most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_4, PF4_AVATARS);
- if(!most_online)
+ if (!most_online)
return 0;
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online, 0);
- if(!proto) return 0;
+ if (!proto) return 0;
AI.cbSize = sizeof(AI);
AI.hContact = ccs->hContact;
AI.format = PA_FORMAT_UNKNOWN;
strcpy(AI.filename, "X");
- if((int)CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
+ if ((int)CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
DBWriteContactSettingString(ccs->hContact, "ContactPhoto", "File",AI.filename);
most_online = Meta_GetMostOnline(ccs->hContact);
Meta_CopyContactNick(ccs->hContact, most_online);
- if(!most_online)
+ if (!most_online)
return 0;
//Meta_CopyContactNick(ccs->hContact, most_online, proto);
diff --git a/plugins/MetaContacts/meta_utils.c b/plugins/MetaContacts/meta_utils.c
index 38a9e69f6c..ccee31e2a5 100644
--- a/plugins/MetaContacts/meta_utils.c
+++ b/plugins/MetaContacts/meta_utils.c
@@ -40,7 +40,7 @@ INT_PTR MyDBGetContactSetting(HANDLE hContact, const char *szModule, const char
static BOOL strsvc, strsvcset = FALSE;
memset(dbv, 0, sizeof(DBVARIANT));
- if(!strsvcset) {strsvc = ServiceExists(MS_DB_CONTACT_GETSETTING_STR); strsvcset = TRUE;}
+ if (!strsvcset) {strsvc = ServiceExists(MS_DB_CONTACT_GETSETTING_STR); strsvcset = TRUE;}
// preserve unicode strings - this service should return other data types unchanged
if(strsvc) return DBGetContactSettingW(hContact, szModule, szSetting, dbv);
@@ -70,10 +70,10 @@ int Meta_EqualDBV(DBVARIANT *dbv, DBVARIANT *id) {
break;
case DBVT_ASCIIZ:
case DBVT_UTF8:
- if(!strcmp(dbv->pszVal,id->pszVal))
+ if (!strcmp(dbv->pszVal,id->pszVal))
return 1;
case DBVT_WCHAR:
- if(!wcscmp(dbv->pwszVal,id->pwszVal))
+ if (!wcscmp(dbv->pwszVal,id->pwszVal))
return 1;
case DBVT_BLOB:
if(dbv->cpbVal == id->cpbVal)
@@ -110,14 +110,14 @@ HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id)
char str[MAXMODULELABELLENGTH];
strcpy(str,protocol);
strcat(str,PS_GETCAPS);
- if(!ServiceExists(str))
+ if (!ServiceExists(str))
return NULL;
field = (char *)CallProtoService(protocol,PS_GETCAPS,PFLAG_UNIQUEIDSETTING,0);
hUser = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
while(hUser)
{ // Scan the database and retrieve the field for each contact
- if(!DBGetContactSetting(hUser,protocol,field,&dbv))
+ if (!DBGetContactSetting(hUser,protocol,field,&dbv))
{
if(dbv.type == id->type)
{ // If the id parameter and the value returned by the DBGetContactSetting
@@ -140,7 +140,7 @@ HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id)
break;
case DBVT_ASCIIZ:
case DBVT_UTF8:
- if(!strcmp(dbv.pszVal,id->pszVal))
+ if (!strcmp(dbv.pszVal,id->pszVal))
{
DBFreeVariant(&dbv);
return hUser;
@@ -151,7 +151,7 @@ HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id)
break;
}
case DBVT_WCHAR:
- if(!wcscmp(dbv.pwszVal,id->pwszVal))
+ if (!wcscmp(dbv.pwszVal,id->pwszVal))
{
DBFreeVariant(&dbv);
return hUser;
@@ -177,7 +177,7 @@ HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id)
} // end switch
} else
DBFreeVariant(&dbv);
- } // end if(!DBGetContactSetting(hUser,protocol,field,&dbv))
+ } // end if (!DBGetContactSetting(hUser,protocol,field,&dbv))
// This contact wasn't the good one, go to the next.
hUser = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hUser,0);
} // end while
@@ -249,15 +249,15 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default)
WORD status;
HANDLE most_online;
- if((metaID=DBGetContactSettingDword(dest,META_PROTO,META_ID,(DWORD)-1))==-1) {
+ if ((metaID=DBGetContactSettingDword(dest,META_PROTO,META_ID,(DWORD)-1))==-1) {
MessageBox(0, Translate("Could not get MetaContact id"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
return FALSE;
}
- if((num_contacts=DBGetContactSettingDword(dest,META_PROTO,"NumContacts",(DWORD)-1))==-1) {
+ if ((num_contacts=DBGetContactSettingDword(dest,META_PROTO,"NumContacts",(DWORD)-1))==-1) {
MessageBox(0, Translate("Could not retreive MetaContact contact count"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
return FALSE;
}
- if(!(proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)src,0))) {
+ if (!(proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)src,0))) {
MessageBox(0, Translate("Could not retreive contact protocol"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
return FALSE;
}
@@ -309,7 +309,7 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default)
DBFreeVariant(&cws.value);
// If we can get the nickname of the subcontact...
- if(!DBGetContactSetting(src,proto,"Nick",&cws.value)) {
+ if (!DBGetContactSetting(src,proto,"Nick",&cws.value)) {
// write the nickname
strcpy(buffer, "Nick");
strcat(buffer, _itoa((int)(num_contacts - 1), buffer2, 10));
@@ -340,7 +340,7 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default)
DBWriteContactSettingString(dest, META_PROTO, buffer, name);
// Get the status
- if(!proto)
+ if (!proto)
status = ID_STATUS_OFFLINE;
else
status = DBGetContactSettingWord(src, proto, "Status", ID_STATUS_OFFLINE);
@@ -373,7 +373,7 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default)
// Add the MetaContactFilter module to the old contact to intercept messages and forward to the new
// metacontact
- if( !CallService( MS_PROTO_ISPROTOONCONTACT, (WPARAM)src, ( LPARAM )META_FILTER ))
+ if ( !CallService( MS_PROTO_ISPROTOONCONTACT, (WPARAM)src, ( LPARAM )META_FILTER ))
CallService( MS_PROTO_ADDTOCONTACT, (WPARAM)src, ( LPARAM )META_FILTER );
// Write the link in the contact
@@ -423,7 +423,7 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default)
AI.format = PA_FORMAT_UNKNOWN;
strcpy(AI.filename, "X");
- if((int)CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
+ if ((int)CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
DBWriteContactSettingString(dest, "ContactPhoto", "File",AI.filename);
}
@@ -469,7 +469,7 @@ HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long ca
char *proto, *most_online_proto;
// you can't get more online than having the default contact ONLINE - so check that first
- if((default_contact_number = DBGetContactSettingDword(hMeta,META_PROTO,"Default",(DWORD)-1)) == (DWORD)-1)
+ if ((default_contact_number = DBGetContactSettingDword(hMeta,META_PROTO,"Default",(DWORD)-1)) == (DWORD)-1)
{
// This is a simple contact - return NULL to signify error.
// (this should normally not happen, since all meta contacts have a default contact)
@@ -489,7 +489,7 @@ HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long ca
return most_online_contact;
// a subcontact is being temporarily 'forced' to do sending
- if((most_online_contact = (HANDLE)DBGetContactSettingDword(hMeta, META_PROTO, "ForceSend", 0))) {
+ if ((most_online_contact = (HANDLE)DBGetContactSettingDword(hMeta, META_PROTO, "ForceSend", 0))) {
caps = proto ? CallProtoService(proto, PS_GETCAPS, (WPARAM)pflagnum, 0) : 0;
if(proto && strcmp(proto, "IRC") == 0) caps |= PF1_IM;
if(proto && (caps & capability) == capability && capability != 0) // capability is 0 when we're working out status
@@ -523,7 +523,7 @@ HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long ca
hContact = Meta_GetContactHandle(hMeta, i);
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if(!proto || CallProtoService(proto, PS_GETSTATUS, 0, 0) < ID_STATUS_ONLINE) // proto offline or connecting
+ if (!proto || CallProtoService(proto, PS_GETSTATUS, 0, 0) < ID_STATUS_ONLINE) // proto offline or connecting
continue;
caps = proto ? CallProtoService(proto, PS_GETCAPS, (WPARAM)pflagnum, 0) : 0;
@@ -611,9 +611,9 @@ BOOL dbv_same(DBVARIANT *dbv1, DBVARIANT *dbv2) {
hContact = Meta_GetContactHandle(hMeta, j);
if(hContact) {
- if(!module) {
+ if (!module) {
used_mod = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if(!used_mod) continue; // next contact
+ if (!used_mod) continue; // next contact
} else
used_mod = module;
@@ -627,14 +627,14 @@ BOOL dbv_same(DBVARIANT *dbv1, DBVARIANT *dbv2) {
if(strcmp(settings[i], "MirVer") == 0) {
if(DBGetContactSettingWord(hContact, used_mod, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
- if(!free || (dbv1.pszVal == NULL || strcmp(dbv1.pszVal, "") == 0 || strlen(dbv1.pszVal) < 2)) {
+ if (!free || (dbv1.pszVal == NULL || strcmp(dbv1.pszVal, "") == 0 || strlen(dbv1.pszVal) < 2)) {
MyDBWriteContactSetting(hMeta, (module ? used_mod : META_PROTO), settings[i], &dbv2);
bDataWritten = TRUE; //only break if found something to copy
}
}
} else {
- if(!free || !dbv_same(&dbv1, &dbv2)) {
+ if (!free || !dbv_same(&dbv1, &dbv2)) {
MyDBWriteContactSetting(hMeta, (module ? used_mod : META_PROTO), settings[i], &dbv2);
if(dbv2.type == DBVT_ASCIIZ || dbv2.type == DBVT_UTF8) {
if(dbv2.pszVal != NULL && strcmp(dbv2.pszVal, "") != 0)
@@ -706,21 +706,21 @@ void CopyStatusData(HANDLE hMeta) {
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if(proto && DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE) == status) {
- if(!bDoneStatus && !MyDBGetContactSetting(hContact, "CList", "StatusMsg", &dbv)) {
+ if (!bDoneStatus && !MyDBGetContactSetting(hContact, "CList", "StatusMsg", &dbv)) {
MyDBWriteContactSetting(hMeta, "CList", "StatusMsg", &dbv);
DBFreeVariant(&dbv);
bDoneStatus = TRUE;
}
- if((!bDoneXStatus) && (!MyDBGetContactSetting(hContact, proto, "XStatusId", &dbv)) && dbv.type != DBVT_DELETED) {
+ if ((!bDoneXStatus) && (!MyDBGetContactSetting(hContact, proto, "XStatusId", &dbv)) && dbv.type != DBVT_DELETED) {
DBWriteContactSettingString(hMeta, META_PROTO, "XStatusProto", proto);
MyDBWriteContactSetting(hMeta, META_PROTO, "XStatusId", &dbv);
DBFreeVariant(&dbv);
- if(!MyDBGetContactSetting(hContact, proto, "XStatusMsg", &dbv)) {
+ if (!MyDBGetContactSetting(hContact, proto, "XStatusMsg", &dbv)) {
MyDBWriteContactSetting(hMeta, META_PROTO, "XStatusMsg", &dbv);
DBFreeVariant(&dbv);
}
- if(!MyDBGetContactSetting(hContact, proto, "XStatusName", &dbv)) {
+ if (!MyDBGetContactSetting(hContact, proto, "XStatusName", &dbv)) {
MyDBWriteContactSetting(hMeta, META_PROTO, "XStatusName", &dbv);
DBFreeVariant(&dbv);
}
@@ -731,8 +731,8 @@ void CopyStatusData(HANDLE hMeta) {
if(bDoneStatus && bDoneXStatus) break;
}
- if(!bDoneStatus) DBDeleteContactSetting(hMeta, "CList", "StatusMsg");
- if(!bDoneXStatus) {
+ if (!bDoneStatus) DBDeleteContactSetting(hMeta, "CList", "StatusMsg");
+ if (!bDoneXStatus) {
DBDeleteContactSetting(hMeta, META_PROTO, "XStatusId");
DBDeleteContactSetting(hMeta, META_PROTO, "XStatusMsg");
DBDeleteContactSetting(hMeta, META_PROTO, "XStatusName");
@@ -773,7 +773,7 @@ int Meta_SetHandles(void) {
BOOL found;
while ( hContact != NULL ) {
- if((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1))!=(DWORD)-1) {
+ if ((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1))!=(DWORD)-1) {
// is a subcontact
// get nick for debug messages
@@ -837,7 +837,7 @@ int Meta_SetHandles(void) {
hContact2 = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact2, 0 );
}
- if(!found) {
+ if (!found) {
// problem - subcontact's meta not found
MessageBox(0, "Subcontact's MetaContact not found - deleting MetaContact data", nick_buffer, MB_OK | MB_ICONERROR);
@@ -855,14 +855,14 @@ int Meta_SetHandles(void) {
CallService(MS_IGNORE_UNIGNORE, (WPARAM)hContact, (WPARAM)IGNOREEVENT_USERONLINE);
} else {
- if(!DBGetContactSettingByte(hContact, META_PROTO, "IsSubcontact", 0))
+ if (!DBGetContactSettingByte(hContact, META_PROTO, "IsSubcontact", 0))
DBWriteContactSettingByte(hContact, META_PROTO, "IsSubcontact", 1);
}
} else
DBDeleteContactSetting(hContact, META_PROTO, "Handle");
- if((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1))!=(DWORD)-1) {
+ if ((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1))!=(DWORD)-1) {
// is a metacontact
// get nick for debug messages
@@ -905,7 +905,7 @@ int Meta_SetHandles(void) {
// loop through one more time - check contact counts match
hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
while ( hContact != NULL ) {
- if((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1))!=(DWORD)-1) {
+ if ((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1))!=(DWORD)-1) {
// get nick for debug messages
strcpy(nick_buffer, Translate("MetaId: "));
strcat(nick_buffer, _itoa(meta_id, buffer2, 10));
@@ -948,7 +948,7 @@ int Meta_HideLinkedContacts(void) {
// ensure the hidden group does not exist (how this occurs i wonder but there have been reports!)
// (sometimes protocol server side groups are to blame - msn and icq)
- if(!meta_group_hack_disabled) do {
+ if (!meta_group_hack_disabled) do {
group_name = (char *)CallService(MS_CLIST_GROUPGETNAME, (WPARAM)hGroup, 0);
if(group_name && !strcmp(group_name, META_HIDDEN_GROUP)) {
// disabled because it shows a message box
@@ -967,11 +967,11 @@ int Meta_HideLinkedContacts(void) {
while ( hContact != NULL ) {
- if((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1))!=(DWORD)-1) {
+ if ((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1))!=(DWORD)-1) {
// is a subcontact
// * ensure filter present
- if( !CallService( MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, ( LPARAM )META_FILTER ))
+ if ( !CallService( MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, ( LPARAM )META_FILTER ))
CallService( MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, ( LPARAM )META_FILTER );
@@ -992,7 +992,7 @@ int Meta_HideLinkedContacts(void) {
num_contacts = DBGetContactSettingDword(hContact2, META_PROTO, "NumContacts", (DWORD)-1);
if(contact_number >= 0 && contact_number < num_contacts) {
- if(!proto)
+ if (!proto)
status = ID_STATUS_OFFLINE;
else
status = DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE);
@@ -1019,7 +1019,7 @@ int Meta_HideLinkedContacts(void) {
DBFreeVariant(&dbv);
} else {
- if(!DBGetContactSetting(hContact, "CList", "MyHandle", &dbv)) {
+ if (!DBGetContactSetting(hContact, "CList", "MyHandle", &dbv)) {
strcpy(buffer, "CListName");
strcat(buffer, _itoa(contact_number, buffer2, 10));
MyDBWriteContactSetting(hContact2, META_PROTO, buffer, &dbv);
@@ -1074,7 +1074,7 @@ int Meta_UnhideLinkedContacts(void) {
hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
}
- if(!CallService(MS_SYSTEM_TERMINATED, 0, 0))
+ if (!CallService(MS_SYSTEM_TERMINATED, 0, 0))
CallService(MS_CLUI_SORTLIST, 0, 0);
return 0;
}
@@ -1107,7 +1107,7 @@ int Meta_HideMetaContacts(int hide) {
hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
}
- if(!CallService(MS_SYSTEM_TERMINATED, 0, 0))
+ if (!CallService(MS_SYSTEM_TERMINATED, 0, 0))
CallService(MS_CLUI_SORTLIST, 0, 0);
return 0;
}
@@ -1131,9 +1131,9 @@ void Meta_RestoreGroup(HANDLE hContact) {
} else {
DBCONTACTWRITESETTING cws;
- if(!DBGetContactSetting(hContact, META_PROTO, "OldCListGroup", &cws.value)) {
+ if (!DBGetContactSetting(hContact, META_PROTO, "OldCListGroup", &cws.value)) {
- if((cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) && !strcmp(cws.value.pszVal, META_HIDDEN_GROUP)) {
+ if ((cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) && !strcmp(cws.value.pszVal, META_HIDDEN_GROUP)) {
DBDeleteContactSetting(hContact, "CList", "Group");
} else {
int hGroup = 1;
@@ -1168,8 +1168,8 @@ void Meta_RestoreGroup(HANDLE hContact) {
}
DBDeleteContactSetting(hContact, META_PROTO, "OldCListGroup");
- if(!DBGetContactSetting(hContact, "CList", "Group", &cws.value)) {
- if((cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) && !strcmp(cws.value.pszVal, META_HIDDEN_GROUP)) {
+ if (!DBGetContactSetting(hContact, "CList", "Group", &cws.value)) {
+ if ((cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) && !strcmp(cws.value.pszVal, META_HIDDEN_GROUP)) {
DBDeleteContactSetting(hContact, "CList", "Group");
}
DBFreeVariant(&cws.value);
@@ -1200,8 +1200,8 @@ void Meta_SetGroup(HANDLE hContact) {
} else {
DBCONTACTWRITESETTING cws;
// save old group and move to invisible group (i.e. non-existent group)
- if(!MyDBGetContactSetting(hContact, "CList", "Group", &cws.value)) {
- if((cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) && !strcmp(cws.value.pszVal, META_HIDDEN_GROUP)) {
+ if (!MyDBGetContactSetting(hContact, "CList", "Group", &cws.value)) {
+ if ((cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) && !strcmp(cws.value.pszVal, META_HIDDEN_GROUP)) {
// it's already in the group (shouldn't be - but maybe a crash)
} else {
cws.szModule = META_PROTO;
@@ -1283,15 +1283,15 @@ int Meta_CopyContactNick(HANDLE hMeta, HANDLE hContact) {
hContact = Meta_GetContactHandle(hMeta, 0);
}
- if(!hContact) return 1;
+ if (!hContact) return 1;
//proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
// read proto direct from db, since we do this on load and other proto plugins may not be loaded yet
- if(!DBGetContactSetting(hContact, "Protocol", "p", &dbv_proto)) {
+ if (!DBGetContactSetting(hContact, "Protocol", "p", &dbv_proto)) {
proto = dbv_proto.pszVal;
if(options.clist_contact_name == CNNT_NICK && proto) {
- if(!MyDBGetContactSetting(hContact, proto, "Nick", &dbv)) {
+ if (!MyDBGetContactSetting(hContact, proto, "Nick", &dbv)) {
MyDBWriteContactSetting(hMeta, META_PROTO, "Nick", &dbv);
DBFreeVariant(&dbv);
//CallService(MS_CLIST_INVALIDATEDISPLAYNAME, (WPARAM)hMeta, 0);
@@ -1518,7 +1518,7 @@ void copyHistory(HANDLE hContactFrom,HANDLE hContactTo)
if (!hContactFrom || !hContactTo) return;
//id = Meta_GetUniqueIdentifier(hContactFrom, &id_length);
- //if(!id) return;
+ //if (!id) return;
progress_dialog = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_COPYPROGRESS), 0, DlgProcNull);
ShowWindow(progress_dialog, SW_SHOW);
@@ -1534,7 +1534,7 @@ void copyHistory(HANDLE hContactFrom,HANDLE hContactTo)
ZeroMemory(&dbei, sizeof(dbei));
dbei.cbSize = sizeof(dbei);
- if((dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == -1)
+ if ((dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == -1)
break;
buffer = mir_realloc(buffer, dbei.cbBlob);// + id_length);
@@ -1584,7 +1584,7 @@ void Meta_RemoveHistory(HANDLE hContactRemoveFrom, HANDLE hContactSource) {
if (!hContactRemoveFrom || !hContactSource) return;
id = Meta_GetUniqueIdentifier(hContactSource, &id_length);
- if(!id) return;
+ if (!id) return;
progress_dialog = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DELPROGRESS), 0, DlgProcNull);
ShowWindow(progress_dialog, SW_SHOW);
@@ -1599,7 +1599,7 @@ void Meta_RemoveHistory(HANDLE hContactRemoveFrom, HANDLE hContactSource) {
ZeroMemory(&dbei, sizeof(dbei));
dbei.cbSize = sizeof(dbei);
- if((dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == -1) {
+ if ((dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == -1) {
break;
}
@@ -1650,7 +1650,7 @@ char *Meta_GetUniqueIdentifier(HANDLE hContact, DWORD *pused) {
id = (char *)mir_alloc(256);
- if(!proto) return 0;
+ if (!proto) return 0;
strncpy(id, proto, 127);
strcat(id, "*"); // seperate proto & proto id with asterisk to make one long comparable string
@@ -1658,7 +1658,7 @@ char *Meta_GetUniqueIdentifier(HANDLE hContact, DWORD *pused) {
used = strlen(id);
field = (char *)CallProtoService(proto,PS_GETCAPS,PFLAG_UNIQUEIDSETTING,0);
- if(!field) return 0;
+ if (!field) return 0;
DBGetContactSetting(hContact,proto,field,&dbv);
switch(dbv.type)
@@ -1683,7 +1683,7 @@ char *Meta_GetUniqueIdentifier(HANDLE hContact, DWORD *pused) {
strncpy(id + used, buff, 256 - used);
if(used) {
*pused = (DWORD)(used + strlen(buff) + 1);
- if(*pused > 256) *pused = 256;
+ if (*pused > 256) *pused = 256;
}
return id;
diff --git a/plugins/MirOTR/MirOTR/dbfilter.cpp b/plugins/MirOTR/MirOTR/dbfilter.cpp
index bfc2f80e9d..aab60e18e5 100644
--- a/plugins/MirOTR/MirOTR/dbfilter.cpp
+++ b/plugins/MirOTR/MirOTR/dbfilter.cpp
@@ -25,7 +25,7 @@ VOID CALLBACK DeleteTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTi
next = DeleteEvents.first;
while (current = next) {
if (difftime(time(0), current->timestamp) < 1) break;
- if(!CallService(MS_DB_EVENT_GET, (WPARAM)current->hDbEvent, (LPARAM)&info)) // && info.flags&DBEF_READ)
+ if (!CallService(MS_DB_EVENT_GET, (WPARAM)current->hDbEvent, (LPARAM)&info)) // && info.flags&DBEF_READ)
{
CallService(MS_DB_EVENT_DELETE, (WPARAM)current->hContact, (LPARAM)current->hDbEvent);
next = current->next;
@@ -44,7 +44,7 @@ VOID CALLBACK DeleteTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTi
// add prefix to sent messages
int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) {
- if(!options.prefix_messages || !lParam) return 0;
+ if (!options.prefix_messages || !lParam) return 0;
HANDLE hContact = (HANDLE)wParam;
DBEVENTINFO *dbei = (DBEVENTINFO *)lParam;
if ((dbei->eventType != EVENTTYPE_MESSAGE) || !(dbei->flags & DBEF_SENT) || (dbei->flags & DBEF_OTR_PREFIXED))
@@ -53,21 +53,21 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) {
return 0; // just to be safe
const char *proto = contact_get_proto(hContact);
- if(!proto ) return 0;
+ if (!proto ) return 0;
if (DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) == 1)
return 0;
if(g_metaproto && strcmp(proto, g_metaproto) == 0) {
hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
- if(!hContact) return 0;
+ if (!hContact) return 0;
proto = contact_get_proto(hContact);
- if(!proto ) return 0;
+ if (!proto ) return 0;
}
ConnContext *context = otrl_context_find_miranda(otr_user_state, hContact);
bool encrypted = otr_context_get_trust(context) != TRUST_NOT_PRIVATE;
- if(!encrypted) return 0;
+ if (!encrypted) return 0;
DBEVENTINFO my_dbei = *dbei; // copy the other event
@@ -178,7 +178,7 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) {
}
int OnDatabaseEventAdded(WPARAM wParam, LPARAM lParam) {
- if(!options.delete_history) return 0;
+ if (!options.delete_history) return 0;
DBEVENTINFO info = {0};
info.cbSize = sizeof(info);
@@ -189,7 +189,7 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) {
static DWORD len = strlen(prefix);
info.cbBlob = lenutf*2;
info.pBlob = (PBYTE)mir_alloc(info.cbBlob);
- if(!CallService(MS_DB_EVENT_GET, (WPARAM)lParam, (LPARAM)&info)) {
+ if (!CallService(MS_DB_EVENT_GET, (WPARAM)lParam, (LPARAM)&info)) {
if(info.eventType == EVENTTYPE_MESSAGE) {
HANDLE hContact = (HANDLE)wParam, hSub;
if(options.bHaveMetaContacts && (hSub = (HANDLE)CallService
@@ -249,13 +249,13 @@ int WindowEvent(WPARAM wParam, LPARAM lParam) {
}
if(mwd->uType != MSG_WINDOW_EVT_OPEN) return 0;
- if(!options.bHaveSRMMIcons) return 0;
+ if (!options.bHaveSRMMIcons) return 0;
HANDLE hContact = mwd->hContact, hTemp;
if(options.bHaveMetaContacts && (hTemp = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
hContact = hTemp;
- if(!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME))
+ if (!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME))
return 0;
lib_cs_lock();
diff --git a/plugins/MirOTR/MirOTR/entities.cpp b/plugins/MirOTR/MirOTR/entities.cpp
index ce11fe3bec..ae2335bc01 100644
--- a/plugins/MirOTR/MirOTR/entities.cpp
+++ b/plugins/MirOTR/MirOTR/entities.cpp
@@ -327,7 +327,7 @@ static _Bool parse_entity(const char *current, char **to,
const char **from, size_t maxlen)
{
const char *end = (const char *)memchr(current, ';', maxlen);
- if(!end) return 0;
+ if (!end) return 0;
if(current[1] == '#')
{
@@ -367,7 +367,7 @@ static _Bool parse_entity(const char *current, char **to,
size_t decode_html_entities_utf8(char *dest, const char *src, size_t len)
{
- if(!src) src = dest;
+ if (!src) src = dest;
char *to = dest;
const char *from = src;
diff --git a/plugins/MirOTR/MirOTR/options.cpp b/plugins/MirOTR/MirOTR/options.cpp
index 1109a8fffd..f8d1dba7a1 100644
--- a/plugins/MirOTR/MirOTR/options.cpp
+++ b/plugins/MirOTR/MirOTR/options.cpp
@@ -88,7 +88,7 @@ void LoadOptions() {
options.autoshow_verify = (DBGetContactSettingByte(0, MODULENAME, "AutoShowVerify", 1) == 1);
DBVARIANT dbv;
- if(!DBGetContactSettingUTF8String(0, MODULENAME, "Prefix", &dbv)) {
+ if (!DBGetContactSettingUTF8String(0, MODULENAME, "Prefix", &dbv)) {
strncpy(options.prefix, dbv.pszVal, OPTIONS_PREFIXLEN);
options.prefix[OPTIONS_PREFIXLEN-1] = 0;
DBFreeVariant(&dbv);
diff --git a/plugins/MirOTR/MirOTR/otr.cpp b/plugins/MirOTR/MirOTR/otr.cpp
index c094314d56..dfc5575fa4 100644
--- a/plugins/MirOTR/MirOTR/otr.cpp
+++ b/plugins/MirOTR/MirOTR/otr.cpp
@@ -268,7 +268,7 @@ extern "C" {
TCHAR buff[512];
mir_sntprintf(buff, 512, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT((HANDLE)opdata));
//MessageBox(0, buff, Translate("OTR Information"), MB_OK);
- if(!Miranda_Terminated()) {
+ if (!Miranda_Terminated()) {
ShowMessage((HANDLE)opdata, buff);
}
@@ -283,7 +283,7 @@ extern "C" {
TrustLevel trusted = otr_context_get_trust(context);
SetEncryptionStatus((HANDLE)opdata, trusted);
TCHAR buff[1024];
- if(!is_reply) {
+ if (!is_reply) {
if(trusted == TRUST_PRIVATE) {
mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_CONTINUE_OTR), contact_get_nameT((HANDLE)opdata));
} else if (trusted == TRUST_UNVERIFIED) {
diff --git a/plugins/MirOTR/MirOTR/svcs_menu.cpp b/plugins/MirOTR/MirOTR/svcs_menu.cpp
index 83ef6cd660..712ea4d5b6 100644
--- a/plugins/MirOTR/MirOTR/svcs_menu.cpp
+++ b/plugins/MirOTR/MirOTR/svcs_menu.cpp
@@ -9,9 +9,9 @@ HANDLE hMenuBuildEvent, hStopItem, hStartItem;
int StartOTR(HANDLE hContact) {
const char *proto = contact_get_proto(hContact);
- if(!proto) return 1; // error
+ if (!proto) return 1; // error
char *uname = contact_get_id(hContact);
- if(!uname) return 1; // error
+ if (!uname) return 1; // error
DWORD pol = DBGetContactSettingDword(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY);
if(pol == CONTACT_DEFAULT_POLICY) pol = options.default_policy;
@@ -74,9 +74,9 @@ int otr_disconnect_contact(HANDLE hContact) {
}
const char *proto = contact_get_proto(hContact);
- if(!proto) return 1; // error
+ if (!proto) return 1; // error
char *uname = contact_get_id(hContact);
- if(!uname) return 1; // error
+ if (!uname) return 1; // error
lib_cs_lock();
otrl_message_disconnect(otr_user_state, &ops, hContact, proto, proto, uname);
@@ -164,14 +164,14 @@ int SVC_PrebuildContactMenu(WPARAM wParam, LPARAM lParam) {
const char *proto = contact_get_proto(hContact);
DWORD pol = CONTACT_DEFAULT_POLICY;
- if(!proto || DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) == 1) {
+ if (!proto || DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) == 1) {
goto hide_all;
}
if(proto && g_metaproto && strcmp(proto, g_metaproto) == 0) {
// make menu act as per most online subcontact
hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
- if(!hContact)
+ if (!hContact)
goto hide_all;
proto = contact_get_proto(hContact);
}
diff --git a/plugins/MirOTR/MirOTR/svcs_proto.cpp b/plugins/MirOTR/MirOTR/svcs_proto.cpp
index 5ea6055908..89f2473597 100644
--- a/plugins/MirOTR/MirOTR/svcs_proto.cpp
+++ b/plugins/MirOTR/MirOTR/svcs_proto.cpp
@@ -9,7 +9,7 @@
//TODO: Social-Millionaire-Dialoge
INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
- if(!lParam) return 0;
+ if (!lParam) return 0;
CCSDATA *ccs = (CCSDATA *) lParam;
@@ -21,7 +21,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0);
if(proto && g_metaproto && strcmp(proto, g_metaproto) == 0) // bypass for metacontacts
return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
- if(!proto || !ccs->hContact) return 1; // error
+ if (!proto || !ccs->hContact) return 1; // error
gcry_error_t err;
char *newmessage = 0;
@@ -40,7 +40,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
} else {
oldmessage_utf = mir_utf8encode(oldmessage);
}
- if(!oldmessage_utf) return 1;
+ if (!oldmessage_utf) return 1;
// don't filter OTR messages being sent (OTR messages should only happen *after* the otrl_message_sending call below)
if(strncmp(oldmessage_utf, "?OTR", 4) == 0) {
@@ -128,7 +128,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
}
INT_PTR SVC_OTRSendMessageW(WPARAM wParam, LPARAM lParam){
- if(!lParam) return 0;
+ if (!lParam) return 0;
CCSDATA *ccs = (CCSDATA *) lParam;
if (!(ccs->wParam & PREF_UTF)) ccs->wParam |= PREF_UNICODE;
@@ -159,7 +159,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
}
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0);
- if(!proto)
+ if (!proto)
return 1; //error
else if(proto && g_metaproto && strcmp(proto, g_metaproto) == 0) // bypass for metacontacts
return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
@@ -176,7 +176,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
} else {
oldmessage_utf = mir_utf8encode(oldmessage);
}
- if(!oldmessage_utf) return 1;
+ if (!oldmessage_utf) return 1;
char *newmessage = NULL;
@@ -194,7 +194,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
lib_cs_unlock();
mir_free(uname);
- if( !(pre->flags & PREF_UTF)) mir_free(oldmessage_utf);
+ if ( !(pre->flags & PREF_UTF)) mir_free(oldmessage_utf);
oldmessage_utf = NULL;
diff --git a/plugins/MirOTR/MirOTR/svcs_srmm.cpp b/plugins/MirOTR/MirOTR/svcs_srmm.cpp
index e37ee9db51..fbc2797178 100644
--- a/plugins/MirOTR/MirOTR/svcs_srmm.cpp
+++ b/plugins/MirOTR/MirOTR/svcs_srmm.cpp
@@ -14,13 +14,13 @@ BBButton OTRButton;
// }
//
// if(mwd->uType != MSG_WINDOW_EVT_OPEN) return 0;
-// if(!options.bHaveSRMMIcons) return 0;
+// if (!options.bHaveSRMMIcons) return 0;
//
// HANDLE hContact = mwd->hContact, hTemp;
// if(options.bHaveMetaContacts && (hTemp = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
// hContact = hTemp;
//
-// if(!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME))
+// if (!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME))
// return 0;
//
// lib_cs_lock();
@@ -148,7 +148,7 @@ void SetEncryptionStatus(HANDLE hContact, TrustLevel level) {
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
bool chat_room = (proto && DBGetContactSettingByte(hContact, proto, "ChatRoom", 0));
- // if(!chat_room) DBWriteContactSettingByte(hContact, MODULENAME, "Encrypted", (encrypted ? 1 : 0));
+ // if (!chat_room) DBWriteContactSettingByte(hContact, MODULENAME, "Encrypted", (encrypted ? 1 : 0));
if(options.bHaveSRMMIcons || options.bHaveButtonsBar) {
//strcat(dbg_msg, "\nchanging icon");
@@ -197,7 +197,7 @@ void SetEncryptionStatus(HANDLE hContact, TrustLevel level) {
if (options.bHaveButtonsBar) CallService(MS_BB_SETBUTTONSTATE, (WPARAM)hContact, (LPARAM)&button);
db_dword_set(hContact, MODULENAME, "TrustLevel", level);
- if(!chat_room && options.bHaveMetaContacts) {
+ if (!chat_room && options.bHaveMetaContacts) {
HANDLE hMeta = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
HANDLE hMostOnline = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMeta, 0);
if(hMeta && hContact == hMostOnline) {
diff --git a/plugins/MirOTR/MirOTR/utils.cpp b/plugins/MirOTR/MirOTR/utils.cpp
index 3d3a50506e..2b592742d4 100644
--- a/plugins/MirOTR/MirOTR/utils.cpp
+++ b/plugins/MirOTR/MirOTR/utils.cpp
@@ -370,7 +370,7 @@ bool GetEncryptionStatus(HANDLE hContact) {
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
bool chat_room = (proto && DBGetContactSettingByte(hContact, proto, "ChatRoom", 0));
- if(!chat_room) {
+ if (!chat_room) {
if (options.bHaveMetaContacts) {
HANDLE hMeta = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
if(hMeta && hContact == (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMeta, 0)) {
diff --git a/plugins/MirOTR/ekhtml/include/ekhtml_private.h b/plugins/MirOTR/ekhtml/include/ekhtml_private.h
index 47d31282fa..90d99caeb2 100644
--- a/plugins/MirOTR/ekhtml/include/ekhtml_private.h
+++ b/plugins/MirOTR/ekhtml/include/ekhtml_private.h
@@ -150,8 +150,8 @@ char *ekhtml_find_notcharsmap(const char *buf, int len,
{
const char *endp = buf + len;
- for(;buf<endp;buf++)
- if(!(charmap[(unsigned char )*buf] & mask))
+ for (;buf<endp;buf++)
+ if (!(charmap[(unsigned char )*buf] & mask))
break;
return (char *)((buf == endp) ? endp : buf);
diff --git a/plugins/MirOTR/ekhtml/src/ekhtml.c b/plugins/MirOTR/ekhtml/src/ekhtml.c
index f3697469f6..8c432cc00e 100644
--- a/plugins/MirOTR/ekhtml/src/ekhtml.c
+++ b/plugins/MirOTR/ekhtml/src/ekhtml.c
@@ -89,7 +89,7 @@ static void ekhtml_buffer_grow(ekhtml_parser_t *parser){
newsize = parser->nalloced + EKHTML_BLOCKSIZE;
- if((newbuf = realloc(parser->buf, newsize)) == NULL){
+ if ((newbuf = realloc(parser->buf, newsize)) == NULL){
fprintf(stderr, "BAD! Can't allocate %d bytes in ekhtml_buffer_grow\n",
newsize);
fflush(stderr); /* Just in case someone changes the buffering scheme */
@@ -119,7 +119,7 @@ int parser_state_determine(const char *startp, const char *endp){
assert(startp != endp);
- if(*startp != '<')
+ if (*startp != '<')
return EKHTML_STATE_INDATA;
firstchar = startp + 1;
@@ -130,7 +130,7 @@ int parser_state_determine(const char *startp, const char *endp){
if(newstate == EKHTML_STATE_NONE){
if(firstchar + 2 >= endp) /* Not enough data to evaluate */
return EKHTML_STATE_NONE;
- if(*(firstchar + 1) == '-' && *(firstchar + 2) == '-')
+ if (*(firstchar + 1) == '-' && *(firstchar + 2) == '-')
return EKHTML_STATE_COMMENT;
else
return EKHTML_STATE_SPECIAL;
@@ -238,7 +238,7 @@ void ekhtml_parser_feed(ekhtml_parser_t *parser, ekhtml_string_t *str){
parser->nbuf += tocopy;
if(parser->nalloced == parser->nbuf){
/* Process the buffer */
- if(!ekhtml_parser_flush(parser, 0)){
+ if (!ekhtml_parser_flush(parser, 0)) {
/* If we didn't actually process anything, grow our buffer */
ekhtml_buffer_grow(parser);
}
@@ -270,7 +270,7 @@ ekhtml_parser_startendcb_add(ekhtml_parser_t *parser, const char *tag,
unsigned int taglen;
hnode_t *hn;
- if(!tag){
+ if (!tag){
if(isStart)
parser->startcb_unk = startcb;
else
@@ -289,7 +289,7 @@ ekhtml_parser_startendcb_add(ekhtml_parser_t *parser, const char *tag,
lookup_str.str = newtag;
lookup_str.len = taglen;
- if((hn = hash_lookup(parser->startendcb, &lookup_str))){
+ if ((hn = hash_lookup(parser->startendcb, &lookup_str))) {
cont = hnode_get(hn);
free(newtag);
if(isStart)
@@ -333,7 +333,7 @@ static hash_val_t ekhtml_string_hash(const void *key){
size_t len = s->len;
int c;
- while(len--){
+ while(len--) {
c = str[len];
res = ((res << 5) + res) + c; /* res * 33 + c */
}
@@ -353,7 +353,7 @@ void ekhtml_parser_destroy(ekhtml_parser_t *ekparser){
hscan_t hs;
hash_scan_begin(&hs, ekparser->startendcb);
- while((hn = hash_scan_next(&hs))){
+ while((hn = hash_scan_next(&hs))) {
ekhtml_string_t *key = (ekhtml_string_t *)hnode_getkey(hn);
ekhtml_tag_container *cont = hnode_get(hn);
diff --git a/plugins/MirOTR/ekhtml/src/ekhtml_comment.c b/plugins/MirOTR/ekhtml/src/ekhtml_comment.c
index e37cc487b5..11c4e8cf2e 100644
--- a/plugins/MirOTR/ekhtml/src/ekhtml_comment.c
+++ b/plugins/MirOTR/ekhtml/src/ekhtml_comment.c
@@ -66,22 +66,22 @@ char *ekhtml_parse_comment(ekhtml_parser_t *parser, void **state_data,
if(comstate->dashes == 0){ /* Still on the quest for the double dash*/
/* XXX -- Searching for '--' could be faster, doing
multibyte searching, or something similar */
- for(; workp < endp - 1; workp += 2){
- if(*workp == '-')
+ for (; workp < endp - 1; workp += 2){
+ if (*workp == '-')
break;
}
- if(!(workp < endp - 1)){
+ if (!(workp < endp - 1)) {
*offset = endp - 1 - curp;
return NULL;
}
- if((*(workp - 1) == '-') &&
+ if ((*(workp - 1) == '-') &&
(workp - curp) > (sizeof("<!--") - 1))
{
comstate->lastdash = workp - 1 - curp;
comstate->dashes = 1;
- } else if(*(workp + 1) == '-'){
+ } else if (*(workp + 1) == '-') {
comstate->lastdash = workp - curp;
comstate->dashes = 1;
} else {
@@ -99,7 +99,7 @@ char *ekhtml_parse_comment(ekhtml_parser_t *parser, void **state_data,
return NULL;
}
- if(*workp == '>'){
+ if (*workp == '>') {
if(parser->commentcb){
ekhtml_string_t str;
diff --git a/plugins/MirOTR/ekhtml/src/ekhtml_endtag.c b/plugins/MirOTR/ekhtml/src/ekhtml_endtag.c
index f7095dcdfe..7e4ba7650d 100644
--- a/plugins/MirOTR/ekhtml/src/ekhtml_endtag.c
+++ b/plugins/MirOTR/ekhtml/src/ekhtml_endtag.c
@@ -47,7 +47,7 @@ static void handle_endtag(ekhtml_parser_t *parser, ekhtml_string_t *str){
ekhtml_tag_container *container;
hnode_t *hn;
- if((hn = hash_lookup(parser->startendcb, str)) &&
+ if ((hn = hash_lookup(parser->startendcb, str)) &&
(container = hnode_get(hn)) &&
container->endfunc)
{
@@ -73,8 +73,8 @@ char *ekhtml_parse_endtag(ekhtml_parser_t *parser, void **state_data,
const char *secondchar = curp + 2;
/* Initial check to make sure this isn't some bad tag */
- if(!isalpha(*secondchar)){
- if(*secondchar != '>' && *secondchar != '<'){
+ if (!isalpha(*secondchar)) {
+ if (*secondchar != '>' && *secondchar != '<') {
/* Bogus tag */
*baddata = EKHTML_STATE_BADDATA;
return (char *)curp;
@@ -100,7 +100,7 @@ char *ekhtml_parse_endtag(ekhtml_parser_t *parser, void **state_data,
arrowp != endp && *arrowp != '<' && *arrowp != '>';
arrowp++)
{
- if(!(EKCMap_CharMap[(unsigned char)*arrowp] & EKHTML_CHAR_WHITESPACE))
+ if (!(EKCMap_CharMap[(unsigned char)*arrowp] & EKHTML_CHAR_WHITESPACE))
endstate->lastchar = arrowp - curp;
}
@@ -120,7 +120,7 @@ char *ekhtml_parse_endtag(ekhtml_parser_t *parser, void **state_data,
handle_endtag(parser, &str);
*state_data = NULL;
assert(arrowp < endp);
- if(*arrowp == '<'){ /* Malformed HTML */
+ if (*arrowp == '<') { /* Malformed HTML */
return (char *)(arrowp);
} else {
return (char *)(arrowp + 1);
diff --git a/plugins/MirOTR/ekhtml/src/ekhtml_mktables.c b/plugins/MirOTR/ekhtml/src/ekhtml_mktables.c
index 9a8dea2a03..235a0a7e75 100644
--- a/plugins/MirOTR/ekhtml/src/ekhtml_mktables.c
+++ b/plugins/MirOTR/ekhtml/src/ekhtml_mktables.c
@@ -106,21 +106,21 @@ static EKHTML_CHARMAP_TYPE charmap_values(char in){
#define EKHTML_STRINGIFY(x) #x
-static void print_charmap(char *name, EKHTML_CHARMAP_TYPE (*cmap_func)(char)){
+static void print_charmap(char *name, EKHTML_CHARMAP_TYPE (*cmap_func)(char)) {
int ch;
char sbuf[256];
sprintf_s(sbuf, 256, "0x%%0%dx ", EKHTML_CHARMAP_LEN * 2);
printf("#ifdef EKHTML_USE_TABLES\n");
printf("const %s %s[256] = {\n", EKHTML_CHARMAP_TYPE_S, name);
- for(ch=0; ch < 256; ch++){
+ for(ch=0; ch < 256; ch++) {
printf(sbuf, cmap_func((char)ch));
if(isgraph(ch))
printf("/* '%c' */", ch);
else
printf("/* 0x%.2x */", ch);
printf(", ");
- if(!((ch + 1) % 4))
+ if (!((ch + 1) % 4))
printf("\n");
}
printf("};\n\n");
@@ -129,7 +129,7 @@ static void print_charmap(char *name, EKHTML_CHARMAP_TYPE (*cmap_func)(char)){
printf("#endif\n");
}
-int main(int argc, char *argv[]){
+int main(int argc, char *argv[]) {
printf("#ifndef EKHTML_MKTABLES_DOT_H\n");
printf("#define EKHTML_MKTABLES_DOT_H\n");
diff --git a/plugins/MirOTR/ekhtml/src/ekhtml_special.c b/plugins/MirOTR/ekhtml/src/ekhtml_special.c
index f43a62dac4..b29e6422cd 100644
--- a/plugins/MirOTR/ekhtml/src/ekhtml_special.c
+++ b/plugins/MirOTR/ekhtml/src/ekhtml_special.c
@@ -41,13 +41,13 @@ char *ekhtml_parse_special(ekhtml_parser_t *parser, void **state_data,
assert(*curp == '<' && *(curp + 1) == '!');
- if(*state_data == NULL){/* Only called the first time the tag is started */
+ if (*state_data == NULL){/* Only called the first time the tag is started */
*offset = 2;
*state_data = (void *)1; /* Assign it any non-NULL value */
}
for(workp=curp + *offset;workp != endp; workp++)
- if(*workp == '<' || *workp == '>')
+ if (*workp == '<' || *workp == '>')
break;
if(workp == endp){
@@ -65,7 +65,7 @@ char *ekhtml_parse_special(ekhtml_parser_t *parser, void **state_data,
}
*state_data = NULL;
- if(*workp == '<') /* Malformed HTML */
+ if (*workp == '<') /* Malformed HTML */
return (char *)workp;
else
return (char *)workp + 1;
diff --git a/plugins/MirOTR/ekhtml/src/ekhtml_starttag.c b/plugins/MirOTR/ekhtml/src/ekhtml_starttag.c
index cfd3ea4fd4..ea0b213ec7 100644
--- a/plugins/MirOTR/ekhtml/src/ekhtml_starttag.c
+++ b/plugins/MirOTR/ekhtml/src/ekhtml_starttag.c
@@ -133,7 +133,7 @@ static void handle_starttag(ekhtml_parser_t *parser, char *curp,
str.str = upper_str;
str.len = taglen;
- if((hn = hash_lookup(parser->startendcb, &str)) &&
+ if ((hn = hash_lookup(parser->startendcb, &str)) &&
(container = hnode_get(hn)) &&
container->startfunc)
{
@@ -141,14 +141,14 @@ static void handle_starttag(ekhtml_parser_t *parser, char *curp,
} else if(parser->startcb_unk)
cback = parser->startcb_unk;
- if(!cback)
+ if (!cback)
return;
/* Formulate real attribute callback data from the 'offset'
pointer values */
for(attr=sstate->attrs;attr;attr=attr->next){
attr->name.str = curp + (int)attr->name.str;
- if(!attr->isBoolean)
+ if (!attr->isBoolean)
attr->val.str = curp + (int)attr->val.str;
}
@@ -223,7 +223,7 @@ char *ekhtml_parse_starttag(ekhtml_parser_t *parser, void **state_data,
if(workp == endp)
break;
- if(!(EKCMap_CharMap[(unsigned char)*workp] &
+ if (!(EKCMap_CharMap[(unsigned char)*workp] &
EKHTML_CHAR_BEGATTRNAME))
{
/* Bad attrname character */
@@ -254,11 +254,11 @@ char *ekhtml_parse_starttag(ekhtml_parser_t *parser, void **state_data,
of file */
startstate->curattr->name.len =
workp - (curp + (int)startstate->curattr->name.str);
- if(*workp == '='){
+ if (*workp == '=') {
startstate->mode = EKHTML_STMODE_BEGVALUE;
workp++; /* Skip the equals sign */
} else {
- if(!(EKCMap_CharMap[(unsigned char)*workp] &
+ if (!(EKCMap_CharMap[(unsigned char)*workp] &
EKHTML_CHAR_WHITESPACE))
{
/* Found something we weren't expecting. Use the current
@@ -277,7 +277,7 @@ char *ekhtml_parse_starttag(ekhtml_parser_t *parser, void **state_data,
if(workp == endp)
break;
- if(*workp != '='){
+ if (*workp != '=') {
/* Unexpected value. Could either be time to suck, or this was
really only a boolean value */
scroll_attribute(startstate);
@@ -306,12 +306,12 @@ char *ekhtml_parse_starttag(ekhtml_parser_t *parser, void **state_data,
startstate->curattr->isBoolean = 0;
startstate->curattr->val.str = (char *)NULL + (workp - curp);
startstate->quote = '\0';
- if(*workp == '"' || *workp == '\''){
+ if (*workp == '"' || *workp == '\'') {
startstate->curattr->val.str++; /* Skip the quote */
startstate->mode = EKHTML_STMODE_GETVALUE;
startstate->quote = *workp;
workp++;
- } else if(!(EKCMap_CharMap[(unsigned char)*workp] &
+ } else if (!(EKCMap_CharMap[(unsigned char)*workp] &
EKHTML_CHAR_ATTRVALUE))
{
/* Bad value .. */
@@ -326,8 +326,8 @@ char *ekhtml_parse_starttag(ekhtml_parser_t *parser, void **state_data,
if(startstate->mode == EKHTML_STMODE_GETVALUE){
if(startstate->quote){
- for(;workp != endp && *workp != '>' && *workp != '<'; workp++){
- if(*workp == startstate->quote){
+ for (;workp != endp && *workp != '>' && *workp != '<'; workp++) {
+ if (*workp == startstate->quote){
startstate->curattr->val.len =
workp - (curp + (int)startstate->curattr->val.str);
scroll_attribute(startstate);
@@ -351,12 +351,12 @@ char *ekhtml_parse_starttag(ekhtml_parser_t *parser, void **state_data,
workp - (curp + (int)startstate->curattr->val.str);
scroll_attribute(startstate);
- if(*workp == '>' || *workp == '<') {
+ if (*workp == '>' || *workp == '<') {
*offset = workp - curp;
handle_starttag(parser, curp, startstate);
release_attributes(parser, startstate);
*state_data = NULL;
- if(*workp == '<')
+ if (*workp == '<')
return workp;
else
return workp + 1;
@@ -369,7 +369,7 @@ char *ekhtml_parse_starttag(ekhtml_parser_t *parser, void **state_data,
if(startstate->mode == EKHTML_STMODE_SUCK){
/* The sucking mode is here in case someone puts a bad character
in an attribute name. We suck until what looks like end of tag*/
- for(;workp != endp && *workp != '<' && *workp != '>'; workp++)
+ for (;workp != endp && *workp != '<' && *workp != '>'; workp++)
;
if(workp == endp)
break;
@@ -378,7 +378,7 @@ char *ekhtml_parse_starttag(ekhtml_parser_t *parser, void **state_data,
handle_starttag(parser, curp, startstate);
release_attributes(parser, startstate);
*state_data = NULL;
- if(*workp == '<')
+ if (*workp == '<')
return workp;
else
return workp + 1;
diff --git a/plugins/MirOTR/ekhtml/testsuite/tester.c b/plugins/MirOTR/ekhtml/testsuite/tester.c
index 972a1564c2..226cb21393 100644
--- a/plugins/MirOTR/ekhtml/testsuite/tester.c
+++ b/plugins/MirOTR/ekhtml/testsuite/tester.c
@@ -61,7 +61,7 @@ static void handle_starttag(void *cbdata, ekhtml_string_t *tag,
printf("START: \"%.*s\"\n", tag->len, tag->str);
for(attr=attrs; attr; attr=attr->next) {
printf("ATTRIBUTE: \"%.*s\" = ", attr->name.len, attr->name.str);
- if(!attr->isBoolean)
+ if (!attr->isBoolean)
printf("\"%.*s\"\n", attr->val.len, attr->val.str);
else
printf("\"%.*s\"\n", attr->name.len, attr->name.str);
@@ -101,7 +101,7 @@ static void handle_data(void *cbdata, ekhtml_string_t *str){
fwrite(str->str, str->len, 1, stdout);
}
-int main(int argc, char *argv[]){
+int main(int argc, char *argv[]) {
tester_cbdata cbdata;
ekhtml_parser_t *ekparser;
char *buf;
@@ -133,7 +133,7 @@ int main(int argc, char *argv[]){
ekhtml_parser_cbdata_set(ekparser, &cbdata);
buf = malloc(feedsize);
- while((nbuf = fread(buf, 1, feedsize, stdin))){
+ while((nbuf = fread(buf, 1, feedsize, stdin))) {
ekhtml_string_t str;
str.str = buf;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/arcfour.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/arcfour.c
index 6bb0555c60..eab52a4714 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/arcfour.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/arcfour.c
@@ -84,13 +84,13 @@ do_arcfour_setkey (void *context, const byte *key, unsigned int keylen)
{
initialized = 1;
selftest_failed = selftest();
- if( selftest_failed )
+ if ( selftest_failed )
log_error ("ARCFOUR selftest failed (%s)\n", selftest_failed );
}
- if( selftest_failed )
+ if ( selftest_failed )
return GPG_ERR_SELFTEST_FAILED;
- if( keylen < 40/8 ) /* we want at least 40 bits */
+ if ( keylen < 40/8 ) /* we want at least 40 bits */
return GPG_ERR_INV_KEYLEN;
ctx->idx_i = ctx->idx_j = 0;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/blowfish.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/blowfish.c
index 6ef68e371d..de89b59271 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/blowfish.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/blowfish.c
@@ -475,18 +475,18 @@ selftest(void)
bf_setkey( (void *) &c,
(const unsigned char*)"abcdefghijklmnopqrstuvwxyz", 26 );
encrypt_block( (void *) &c, buffer, plain );
- if( memcmp( buffer, "\x32\x4E\xD0\xFE\xF4\x13\xA2\x03", 8 ) )
+ if ( memcmp( buffer, "\x32\x4E\xD0\xFE\xF4\x13\xA2\x03", 8 ) )
return "Blowfish selftest failed (1).";
decrypt_block( (void *) &c, buffer, buffer );
- if( memcmp( buffer, plain, 8 ) )
+ if ( memcmp( buffer, plain, 8 ) )
return "Blowfish selftest failed (2).";
bf_setkey( (void *) &c, key3, 8 );
encrypt_block( (void *) &c, buffer, plain3 );
- if( memcmp( buffer, cipher3, 8 ) )
+ if ( memcmp( buffer, cipher3, 8 ) )
return "Blowfish selftest failed (3).";
decrypt_block( (void *) &c, buffer, buffer );
- if( memcmp( buffer, plain3, 8 ) )
+ if ( memcmp( buffer, plain3, 8 ) )
return "Blowfish selftest failed (4).";
return NULL;
}
@@ -501,14 +501,14 @@ do_bf_setkey (BLOWFISH_context *c, const byte *key, unsigned keylen)
static int initialized;
static const char *selftest_failed;
- if( !initialized )
+ if ( !initialized )
{
initialized = 1;
selftest_failed = selftest();
- if( selftest_failed )
+ if ( selftest_failed )
log_error ("%s\n", selftest_failed );
}
- if( selftest_failed )
+ if ( selftest_failed )
return GPG_ERR_SELFTEST_FAILED;
for(i=0; i < BLOWFISH_ROUNDS+2; i++ )
@@ -575,9 +575,9 @@ do_bf_setkey (BLOWFISH_context *c, const byte *key, unsigned keylen)
the P-array (here c) occurs more than once per table. */
for(i=0; i < 255; i++ )
{
- for( j=i+1; j < 256; j++)
+ for ( j=i+1; j < 256; j++)
{
- if( (c->s0[i] == c->s0[j]) || (c->s1[i] == c->s1[j]) ||
+ if ( (c->s0[i] == c->s0[j]) || (c->s1[i] == c->s1[j]) ||
(c->s2[i] == c->s2[j]) || (c->s3[i] == c->s3[j]) )
return GPG_ERR_WEAK_KEY;
}
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/camellia-glue.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/camellia-glue.c
index 067af85bca..99174c55f1 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/camellia-glue.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/camellia-glue.c
@@ -81,7 +81,7 @@ camellia_setkey(void *c, const byte *key, unsigned keylen)
if(keylen!=16 && keylen!=24 && keylen!=32)
return GPG_ERR_INV_KEYLEN;
- if(!initialized)
+ if (!initialized)
{
initialized=1;
selftest_failed=selftest();
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/cast5.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/cast5.c
index 333d55e91f..a532acfd4d 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/cast5.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/cast5.c
@@ -476,10 +476,10 @@ selftest(void)
cast_setkey( &c, key, 16 );
encrypt_block( &c, buffer, plain );
- if( memcmp( buffer, cipher, 8 ) )
+ if ( memcmp( buffer, cipher, 8 ) )
return "1";
decrypt_block( &c, buffer, buffer );
- if( memcmp( buffer, plain, 8 ) )
+ if ( memcmp( buffer, plain, 8 ) )
return "2";
#if 0 /* full maintenance test */
@@ -502,7 +502,7 @@ selftest(void)
encrypt_block( &c, b0, b0 );
encrypt_block( &c, b0+8, b0+8 );
}
- if( memcmp( a0, a1, 16 ) || memcmp( b0, b1, 16 ) )
+ if ( memcmp( a0, a1, 16 ) || memcmp( b0, b1, 16 ) )
return "3";
}
@@ -569,17 +569,17 @@ do_cast_setkey( CAST5_context *c, const byte *key, unsigned keylen )
u32 z[4];
u32 k[16];
- if( !initialized )
+ if ( !initialized )
{
initialized = 1;
selftest_failed = selftest();
- if( selftest_failed )
+ if ( selftest_failed )
log_error ("CAST5 selftest failed (%s).\n", selftest_failed );
}
- if( selftest_failed )
+ if ( selftest_failed )
return GPG_ERR_SELFTEST_FAILED;
- if( keylen != 16 )
+ if ( keylen != 16 )
return GPG_ERR_INV_KEYLEN;
x[0] = key[0] << 24 | key[1] << 16 | key[2] << 8 | key[3];
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/cipher.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/cipher.c
index 8cfe54fce1..7594ee593a 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/cipher.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/cipher.c
@@ -1294,7 +1294,7 @@ do_ofb_encrypt( gcry_cipher_hd_t c,
return;
}
- if( c->unused )
+ if ( c->unused )
{
nbytes -= c->unused;
for(ivp=c->u_iv.iv+blocksize - c->unused; c->unused; c->unused-- )
@@ -1331,7 +1331,7 @@ do_ofb_decrypt( gcry_cipher_hd_t c,
byte *ivp;
size_t blocksize = c->cipher->blocksize;
- if( nbytes <= c->unused )
+ if ( nbytes <= c->unused )
{
/* Short enough to be encoded by the remaining XOR mask. */
for (ivp=c->u_iv.iv+blocksize - c->unused; nbytes; nbytes--,c->unused--)
@@ -1874,7 +1874,7 @@ gcry_cipher_ctl( gcry_cipher_hd_t h, int cmd, void *buffer, size_t buflen)
case GCRYCTL_DISABLE_ALGO:
/* This command expects NULL for H and BUFFER to point to an
integer with the algo number. */
- if( h || !buffer || buflen != sizeof(int) )
+ if ( h || !buffer || buflen != sizeof(int) )
return gcry_error (GPG_ERR_CIPHER_ALGO);
disable_cipher_algo( *(int*)buffer );
break;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/des.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/des.c
index f91df77713..3dfd27812e 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/des.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/des.c
@@ -129,8 +129,8 @@
static int
working_memcmp( const char *a, const char *b, size_t n )
{
- for( ; n; n--, a++, b++ )
- if( *a != *b )
+ for ( ; n; n--, a++, b++ )
+ if ( *a != *b )
return (int)(*(byte*)a) - (int)(*(byte*)b);
return 0;
}
@@ -1012,7 +1012,7 @@ do_tripledes_setkey ( void *context, const byte *key, unsigned keylen )
{
struct _tripledes_ctx *ctx = (struct _tripledes_ctx *) context;
- if( keylen != 24 )
+ if ( keylen != 24 )
return GPG_ERR_INV_KEYLEN;
tripledes_set3keys ( ctx, key, key+8, key+16);
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/dsa.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/dsa.c
index ceb94965c5..24e07b59ab 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/dsa.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/dsa.c
@@ -145,7 +145,7 @@ gen_k( gcry_mpi_t q )
log_debug("choosing a random k ");
for (;;)
{
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
progress('.');
if ( !rndbuf || nbits < 32 )
@@ -171,22 +171,22 @@ gen_k( gcry_mpi_t q )
mpi_clear_bit( k, nbits-1 );
}
- if( !(mpi_cmp( k, q ) < 0) ) /* check: k < q */
+ if ( !(mpi_cmp( k, q ) < 0) ) /* check: k < q */
{
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
progress('+');
continue; /* no */
}
- if( !(mpi_cmp_ui( k, 0 ) > 0) ) /* check: k > 0 */
+ if ( !(mpi_cmp_ui( k, 0 ) > 0) ) /* check: k > 0 */
{
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
progress('-');
continue; /* no */
}
break; /* okay */
}
gcry_free(rndbuf);
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
progress('\n');
return k;
@@ -332,9 +332,9 @@ generate (DSA_secret_key *sk, unsigned int nbits, unsigned int qbits,
rndbuf = NULL;
do
{
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
progress('.');
- if( !rndbuf )
+ if ( !rndbuf )
rndbuf = gcry_random_bytes_secure ((qbits+7)/8, random_level);
else
{ /* Change only some of the higher bits (= 2 bytes)*/
@@ -355,7 +355,7 @@ generate (DSA_secret_key *sk, unsigned int nbits, unsigned int qbits,
y = mpi_alloc( mpi_get_nlimbs(p) );
gcry_mpi_powm( y, g, x, p );
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
{
progress('\n');
log_mpidump("dsa p", p );
@@ -508,7 +508,7 @@ generate_fips186 (DSA_secret_key *sk, unsigned int nbits, unsigned int qbits,
value_x = gcry_mpi_snew (qbits);
do
{
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
progress('.');
gcry_mpi_randomize (value_x, qbits, GCRY_VERY_STRONG_RANDOM);
mpi_clear_highbit (value_x, qbits+1);
@@ -634,9 +634,9 @@ verify (gcry_mpi_t r, gcry_mpi_t s, gcry_mpi_t hash, DSA_public_key *pkey )
gcry_mpi_t base[3];
gcry_mpi_t ex[3];
- if( !(mpi_cmp_ui( r, 0 ) > 0 && mpi_cmp( r, pkey->q ) < 0) )
+ if ( !(mpi_cmp_ui( r, 0 ) > 0 && mpi_cmp( r, pkey->q ) < 0) )
return 0; /* assertion 0 < r < q failed */
- if( !(mpi_cmp_ui( s, 0 ) > 0 && mpi_cmp( s, pkey->q ) < 0) )
+ if ( !(mpi_cmp_ui( s, 0 ) > 0 && mpi_cmp( s, pkey->q ) < 0) )
return 0; /* assertion 0 < s < q failed */
w = mpi_alloc( mpi_get_nlimbs(pkey->q) );
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/ecc.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/ecc.c
index fcbd8e3a9d..fec7e86ee6 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/ecc.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/ecc.c
@@ -760,9 +760,9 @@ verify (gcry_mpi_t input, ECC_public_key *pkey, gcry_mpi_t r, gcry_mpi_t s)
mpi_point_t Q, Q1, Q2;
mpi_ec_t ctx;
- if( !(mpi_cmp_ui (r, 0) > 0 && mpi_cmp (r, pkey->E.n) < 0) )
+ if ( !(mpi_cmp_ui (r, 0) > 0 && mpi_cmp (r, pkey->E.n) < 0) )
return GPG_ERR_BAD_SIGNATURE; /* Assertion 0 < r < n failed. */
- if( !(mpi_cmp_ui (s, 0) > 0 && mpi_cmp (s, pkey->E.n) < 0) )
+ if ( !(mpi_cmp_ui (s, 0) > 0 && mpi_cmp (s, pkey->E.n) < 0) )
return GPG_ERR_BAD_SIGNATURE; /* Assertion 0 < s < n failed. */
h = mpi_alloc (0);
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/elgamal.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/elgamal.c
index 0b0c07cb4b..776d7a52c2 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/elgamal.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/elgamal.c
@@ -117,7 +117,7 @@ wiener_map( unsigned int n )
for(i=0; t[i].p_n; i++ )
{
- if( n <= t[i].p_n )
+ if ( n <= t[i].p_n )
return t[i].q_n;
}
/* Not in table - use an arbitrary high number. */
@@ -188,7 +188,7 @@ gen_k( gcry_mpi_t p, int small_k )
* it greatly improves the encryption performance. We use
* Wiener's table and add a large safety margin. */
nbits = wiener_map( orig_nbits ) * 3 / 2;
- if( nbits >= orig_nbits )
+ if ( nbits >= orig_nbits )
BUG();
}
else
@@ -196,12 +196,12 @@ gen_k( gcry_mpi_t p, int small_k )
nbytes = (nbits+7)/8;
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
log_debug("choosing a random k ");
mpi_sub_ui( p_1, p, 1);
- for(;;)
+ for (;;)
{
- if( !rndbuf || nbits < 32 )
+ if ( !rndbuf || nbits < 32 )
{
gcry_free(rndbuf);
rndbuf = gcry_random_bytes_secure( nbytes, GCRY_STRONG_RANDOM );
@@ -219,30 +219,30 @@ gen_k( gcry_mpi_t p, int small_k )
}
_gcry_mpi_set_buffer( k, rndbuf, nbytes, 0 );
- for(;;)
+ for (;;)
{
- if( !(mpi_cmp( k, p_1 ) < 0) ) /* check: k < (p-1) */
+ if ( !(mpi_cmp( k, p_1 ) < 0) ) /* check: k < (p-1) */
{
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
progress('+');
break; /* no */
}
- if( !(mpi_cmp_ui( k, 0 ) > 0) ) /* check: k > 0 */
+ if ( !(mpi_cmp_ui( k, 0 ) > 0) ) /* check: k > 0 */
{
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
progress('-');
break; /* no */
}
if (gcry_mpi_gcd( temp, k, p_1 ))
goto found; /* okay, k is relative prime to (p-1) */
mpi_add_ui( k, k, 1 );
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
progress('.');
}
}
found:
gcry_free(rndbuf);
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
progress('\n');
mpi_free(p_1);
mpi_free(temp);
@@ -269,7 +269,7 @@ generate ( ELG_secret_key *sk, unsigned int nbits, gcry_mpi_t **ret_factors )
p_min1 = gcry_mpi_new ( nbits );
qbits = wiener_map( nbits );
- if( qbits & 1 ) /* better have a even one */
+ if ( qbits & 1 ) /* better have a even one */
qbits++;
g = mpi_alloc(1);
p = _gcry_generate_elg_prime( 0, nbits, qbits, g, ret_factors );
@@ -288,19 +288,19 @@ generate ( ELG_secret_key *sk, unsigned int nbits, gcry_mpi_t **ret_factors )
* will be much faster with such an x.
*/
xbits = qbits * 3 / 2;
- if( xbits >= nbits )
+ if ( xbits >= nbits )
BUG();
x = gcry_mpi_snew ( xbits );
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
log_debug("choosing a random x of size %u", xbits );
rndbuf = NULL;
do
{
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
progress('.');
- if( rndbuf )
+ if ( rndbuf )
{ /* Change only some of the higher bits */
- if( xbits < 16 ) /* should never happen ... */
+ if ( xbits < 16 ) /* should never happen ... */
{
gcry_free(rndbuf);
rndbuf = gcry_random_bytes_secure( (xbits+7)/8,
@@ -328,7 +328,7 @@ generate ( ELG_secret_key *sk, unsigned int nbits, gcry_mpi_t **ret_factors )
y = gcry_mpi_new (nbits);
gcry_mpi_powm( y, g, x, p );
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
{
progress('\n');
log_mpidump("elg p= ", p );
@@ -467,7 +467,7 @@ do_encrypt(gcry_mpi_t a, gcry_mpi_t b, gcry_mpi_t input, ELG_public_key *pkey )
gcry_mpi_powm( b, pkey->y, k, pkey->p );
gcry_mpi_mulm( b, b, input, pkey->p );
#if 0
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
{
log_mpidump("elg encrypted y= ", pkey->y);
log_mpidump("elg encrypted p= ", pkey->p);
@@ -493,7 +493,7 @@ decrypt(gcry_mpi_t output, gcry_mpi_t a, gcry_mpi_t b, ELG_secret_key *skey )
mpi_invm( t1, t1, skey->p );
mpi_mulm( output, b, t1, skey->p );
#if 0
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
{
log_mpidump("elg decrypted x= ", skey->x);
log_mpidump("elg decrypted p= ", skey->p);
@@ -533,7 +533,7 @@ sign(gcry_mpi_t a, gcry_mpi_t b, gcry_mpi_t input, ELG_secret_key *skey )
mpi_mulm(b, t, inv, p_1 );
#if 0
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
{
log_mpidump("elg sign p= ", skey->p);
log_mpidump("elg sign g= ", skey->g);
@@ -564,7 +564,7 @@ verify(gcry_mpi_t a, gcry_mpi_t b, gcry_mpi_t input, ELG_public_key *pkey )
gcry_mpi_t base[4];
gcry_mpi_t ex[4];
- if( !(mpi_cmp_ui( a, 0 ) > 0 && mpi_cmp( a, pkey->p ) < 0) )
+ if ( !(mpi_cmp_ui( a, 0 ) > 0 && mpi_cmp( a, pkey->p ) < 0) )
return 0; /* assertion 0 < a < p failed */
t1 = mpi_alloc( mpi_get_nlimbs(a) );
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/md4.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/md4.c
index 680cf87f5d..ce277fa4f5 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/md4.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/md4.c
@@ -197,22 +197,22 @@ md4_write ( void *context, const void *inbuf_arg, size_t inlen)
const unsigned char *inbuf = inbuf_arg;
MD4_CONTEXT *hd = context;
- if( hd->count == 64 ) /* flush the buffer */
+ if ( hd->count == 64 ) /* flush the buffer */
{
transform( hd, hd->buf );
_gcry_burn_stack (80+6*sizeof(void*));
hd->count = 0;
hd->nblocks++;
}
- if( !inbuf )
+ if ( !inbuf )
return;
- if( hd->count )
+ if ( hd->count )
{
- for( ; inlen && hd->count < 64; inlen-- )
+ for ( ; inlen && hd->count < 64; inlen-- )
hd->buf[hd->count++] = *inbuf++;
md4_write( hd, NULL, 0 );
- if( !inlen )
+ if ( !inlen )
return;
}
_gcry_burn_stack (80+6*sizeof(void*));
@@ -225,7 +225,7 @@ md4_write ( void *context, const void *inbuf_arg, size_t inlen)
inlen -= 64;
inbuf += 64;
}
- for( ; inlen && hd->count < 64; inlen-- )
+ for ( ; inlen && hd->count < 64; inlen-- )
hd->buf[hd->count++] = *inbuf++;
}
@@ -252,7 +252,7 @@ md4_final( void *context )
msb = t >> 26;
/* add the count */
t = lsb;
- if( (lsb += hd->count) < t )
+ if ( (lsb += hd->count) < t )
msb++;
/* multiply by 8 to make a bit count */
t = lsb;
@@ -260,7 +260,7 @@ md4_final( void *context )
msb <<= 3;
msb |= t >> 29;
- if( hd->count < 56 ) /* enough room */
+ if ( hd->count < 56 ) /* enough room */
{
hd->buf[hd->count++] = 0x80; /* pad */
while( hd->count < 56 )
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/md5.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/md5.c
index 899dce89ad..d57a6b7838 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/md5.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/md5.c
@@ -222,22 +222,22 @@ md5_write( void *context, const void *inbuf_arg , size_t inlen)
const unsigned char *inbuf = inbuf_arg;
MD5_CONTEXT *hd = context;
- if( hd->count == 64 ) /* flush the buffer */
+ if ( hd->count == 64 ) /* flush the buffer */
{
transform( hd, hd->buf );
_gcry_burn_stack (80+6*sizeof(void*));
hd->count = 0;
hd->nblocks++;
}
- if( !inbuf )
+ if ( !inbuf )
return;
- if( hd->count )
+ if ( hd->count )
{
- for( ; inlen && hd->count < 64; inlen-- )
+ for ( ; inlen && hd->count < 64; inlen-- )
hd->buf[hd->count++] = *inbuf++;
md5_write( hd, NULL, 0 );
- if( !inlen )
+ if ( !inlen )
return;
}
_gcry_burn_stack (80+6*sizeof(void*));
@@ -250,7 +250,7 @@ md5_write( void *context, const void *inbuf_arg , size_t inlen)
inlen -= 64;
inbuf += 64;
}
- for( ; inlen && hd->count < 64; inlen-- )
+ for ( ; inlen && hd->count < 64; inlen-- )
hd->buf[hd->count++] = *inbuf++;
}
@@ -278,7 +278,7 @@ md5_final( void *context)
msb = t >> 26;
/* add the count */
t = lsb;
- if( (lsb += hd->count) < t )
+ if ( (lsb += hd->count) < t )
msb++;
/* multiply by 8 to make a bit count */
t = lsb;
@@ -286,7 +286,7 @@ md5_final( void *context)
msb <<= 3;
msb |= t >> 29;
- if( hd->count < 56 ) /* enough room */
+ if ( hd->count < 56 ) /* enough room */
{
hd->buf[hd->count++] = 0x80; /* pad */
while( hd->count < 56 )
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/primegen.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/primegen.c
index b869bee839..c9b5414501 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/primegen.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/primegen.c
@@ -936,7 +936,7 @@ is_prime (gcry_mpi_t n, int steps, unsigned int *count)
for (i=0 ; i < steps; i++ )
{
++*count;
- if( !i )
+ if ( !i )
{
mpi_set_ui( x, 2 );
}
@@ -963,7 +963,7 @@ is_prime (gcry_mpi_t n, int steps, unsigned int *count)
for ( j=1; j < k && mpi_cmp( y, nminus1 ); j++ )
{
gcry_mpi_powm(y, y, a2, n);
- if( !mpi_cmp_ui( y, 1 ) )
+ if ( !mpi_cmp_ui( y, 1 ) )
goto leave; /* Not a prime. */
}
if (mpi_cmp( y, nminus1 ) )
@@ -1005,18 +1005,18 @@ m_out_of_n ( char *array, int m, int n )
{
int i=0, i1=0, j=0, jp=0, j1=0, k1=0, k2=0;
- if( !m || m >= n )
+ if ( !m || m >= n )
return;
/* Need to handle this simple case separately. */
- if( m == 1 )
+ if ( m == 1 )
{
for (i=0; i < n; i++ )
{
if ( array[i] )
{
array[i++] = 0;
- if( i >= n )
+ if ( i >= n )
i = 0;
array[i] = 1;
return;
@@ -1037,25 +1037,25 @@ m_out_of_n ( char *array, int m, int n )
if ( (m & 1) )
{
/* M is odd. */
- if( array[n-1] )
+ if ( array[n-1] )
{
- if( j1 & 1 )
+ if ( j1 & 1 )
{
k1 = n - j1;
k2 = k1+2;
- if( k2 > n )
+ if ( k2 > n )
k2 = n;
goto leave;
}
goto scan;
}
k2 = n - j1 - 1;
- if( k2 == 0 )
+ if ( k2 == 0 )
{
k1 = i;
k2 = n - j1;
}
- else if( array[k2] && array[k2-1] )
+ else if ( array[k2] && array[k2-1] )
k1 = n;
else
k1 = k2 + 1;
@@ -1063,18 +1063,18 @@ m_out_of_n ( char *array, int m, int n )
else
{
/* M is even. */
- if( !array[n-1] )
+ if ( !array[n-1] )
{
k1 = n - j1;
k2 = k1 + 1;
goto leave;
}
- if( !(j1 & 1) )
+ if ( !(j1 & 1) )
{
k1 = n - j1;
k2 = k1+2;
- if( k2 > n )
+ if ( k2 > n )
k2 = n;
goto leave;
}
@@ -1083,9 +1083,9 @@ m_out_of_n ( char *array, int m, int n )
for (i=1; i <= jp; i++ )
{
i1 = jp + 2 - i;
- if( array[i1-1] )
+ if ( array[i1-1] )
{
- if( array[i1-2] )
+ if ( array[i1-2] )
{
k1 = i1 - 1;
k2 = n - j1;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/pubkey.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/pubkey.c
index 08abcbfdec..b888d4b936 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/pubkey.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/pubkey.c
@@ -1518,7 +1518,7 @@ sexp_data_to_mpi (gcry_sexp_t input, unsigned int nbits, gcry_mpi_t *ret_mpi,
the given algorithm. */
rc = GPG_ERR_CONFLICT;
}
- else if( !dlen || dlen + asnlen + 4 > nframe)
+ else if ( !dlen || dlen + asnlen + 4 > nframe)
{
/* Can't encode an DLEN byte digest MD into a NFRAME
byte frame. */
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/rijndael.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/rijndael.c
index d43b349b41..0c092f78aa 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/rijndael.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/rijndael.c
@@ -134,7 +134,7 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
ctx->use_padlock = 0;
#endif
- if( keylen == 128/8 )
+ if ( keylen == 128/8 )
{
ROUNDS = 10;
KC = 4;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/rmd160.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/rmd160.c
index 7805bf53b0..6e3dc68ee6 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/rmd160.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/rmd160.c
@@ -406,21 +406,21 @@ rmd160_write ( void *context, const void *inbuf_arg, size_t inlen)
const unsigned char *inbuf = inbuf_arg;
RMD160_CONTEXT *hd = context;
- if( hd->count == 64 ) /* flush the buffer */
+ if ( hd->count == 64 ) /* flush the buffer */
{
transform( hd, hd->buf );
_gcry_burn_stack (108+5*sizeof(void*));
hd->count = 0;
hd->nblocks++;
}
- if( !inbuf )
+ if ( !inbuf )
return;
- if( hd->count )
+ if ( hd->count )
{
- for( ; inlen && hd->count < 64; inlen-- )
+ for ( ; inlen && hd->count < 64; inlen-- )
hd->buf[hd->count++] = *inbuf++;
rmd160_write( hd, NULL, 0 );
- if( !inlen )
+ if ( !inlen )
return;
}
@@ -433,7 +433,7 @@ rmd160_write ( void *context, const void *inbuf_arg, size_t inlen)
inbuf += 64;
}
_gcry_burn_stack (108+5*sizeof(void*));
- for( ; inlen && hd->count < 64; inlen-- )
+ for ( ; inlen && hd->count < 64; inlen-- )
hd->buf[hd->count++] = *inbuf++;
}
@@ -477,7 +477,7 @@ rmd160_final( void *context )
msb = t >> 26;
/* add the count */
t = lsb;
- if( (lsb += hd->count) < t )
+ if ( (lsb += hd->count) < t )
msb++;
/* multiply by 8 to make a bit count */
t = lsb;
@@ -485,7 +485,7 @@ rmd160_final( void *context )
msb <<= 3;
msb |= t >> 29;
- if( hd->count < 56 ) /* enough room */
+ if ( hd->count < 56 ) /* enough room */
{
hd->buf[hd->count++] = 0x80; /* pad */
while( hd->count < 56 )
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/rsa.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/rsa.c
index cf278c2532..a6b225e0f0 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/rsa.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/rsa.c
@@ -285,7 +285,7 @@ generate_std (RSA_secret_key *sk, unsigned int nbits, unsigned long use_e,
u = gcry_mpi_snew ( nbits );
mpi_invm(u, p, q );
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
{
log_mpidump(" p= ", p );
log_mpidump(" q= ", q );
@@ -534,7 +534,7 @@ generate_x931 (RSA_secret_key *sk, unsigned int nbits, unsigned long e_value,
u = f; f = NULL;
mpi_invm (u, p, q );
- if( DBG_CIPHER )
+ if ( DBG_CIPHER )
{
if (*swapped)
log_debug ("p and q are swapped\n");
@@ -599,7 +599,7 @@ check_secret_key( RSA_secret_key *sk )
static void
public(gcry_mpi_t output, gcry_mpi_t input, RSA_public_key *pkey )
{
- if( output == input ) /* powm doesn't like output and input the same */
+ if ( output == input ) /* powm doesn't like output and input the same */
{
gcry_mpi_t x = mpi_alloc( mpi_get_nlimbs(input)*2 );
mpi_powm( x, input, pkey->e, pkey->n );
@@ -625,7 +625,7 @@ stronger_key_check ( RSA_secret_key *skey )
log_info ( "RSA Oops: n != p * q\n" );
/* check that p is less than q */
- if( mpi_cmp( skey->p, skey->q ) > 0 )
+ if ( mpi_cmp( skey->p, skey->q ) > 0 )
{
log_info ("RSA Oops: p >= q - fixed\n");
_gcry_mpi_swap ( skey->p, skey->q);
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/seed.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/seed.c
index b0980d61ec..f1e921148f 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/seed.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/seed.c
@@ -273,7 +273,7 @@ do_setkey (SEED_context *ctx, const byte *key, const unsigned keylen)
{
initialized = 1;
selftest_failed = selftest ();
- if( selftest_failed )
+ if ( selftest_failed )
log_error ("%s\n", selftest_failed );
}
if (selftest_failed)
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/sha1.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/sha1.c
index 8862c64b0a..c7f697c7bb 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/sha1.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/sha1.c
@@ -300,7 +300,7 @@ sha1_final(void *context)
msb = t >> 26;
/* add the count */
t = lsb;
- if( (lsb += hd->count) < t )
+ if ( (lsb += hd->count) < t )
msb++;
/* multiply by 8 to make a bit count */
t = lsb;
@@ -308,7 +308,7 @@ sha1_final(void *context)
msb <<= 3;
msb |= t >> 29;
- if( hd->count < 56 ) /* enough room */
+ if ( hd->count < 56 ) /* enough room */
{
hd->buf[hd->count++] = 0x80; /* pad */
while( hd->count < 56 )
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/tiger.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/tiger.c
index a6feb316c2..afc756d50e 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/tiger.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/tiger.c
@@ -743,21 +743,21 @@ tiger_write ( void *context, const void *inbuf_arg, size_t inlen)
const unsigned char *inbuf = inbuf_arg;
TIGER_CONTEXT *hd = context;
- if( hd->count == 64 ) /* flush the buffer */
+ if ( hd->count == 64 ) /* flush the buffer */
{
transform( hd, hd->buf );
_gcry_burn_stack (21*8+11*sizeof(void*));
hd->count = 0;
hd->nblocks++;
}
- if( !inbuf )
+ if ( !inbuf )
return;
- if( hd->count )
+ if ( hd->count )
{
- for( ; inlen && hd->count < 64; inlen-- )
+ for ( ; inlen && hd->count < 64; inlen-- )
hd->buf[hd->count++] = *inbuf++;
tiger_write( hd, NULL, 0 );
- if( !inlen )
+ if ( !inlen )
return;
}
@@ -770,7 +770,7 @@ tiger_write ( void *context, const void *inbuf_arg, size_t inlen)
inbuf += 64;
}
_gcry_burn_stack (21*8+11*sizeof(void*));
- for( ; inlen && hd->count < 64; inlen-- )
+ for ( ; inlen && hd->count < 64; inlen-- )
hd->buf[hd->count++] = *inbuf++;
}
@@ -794,7 +794,7 @@ tiger_final( void *context )
msb = t >> 26;
/* add the count */
t = lsb;
- if( (lsb += hd->count) < t )
+ if ( (lsb += hd->count) < t )
msb++;
/* multiply by 8 to make a bit count */
t = lsb;
@@ -802,7 +802,7 @@ tiger_final( void *context )
msb <<= 3;
msb |= t >> 29;
- if( hd->count < 56 ) /* enough room */
+ if ( hd->count < 56 ) /* enough room */
{
hd->buf[hd->count++] = pad;
while( hd->count < 56 )
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/twofish.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/twofish.c
index 5274c4001d..2183aa0b7b 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/twofish.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/twofish.c
@@ -584,7 +584,7 @@ do_twofish_setkey (TWOFISH_context *ctx, const byte *key, const unsigned keylen)
static const char *selftest_failed=0;
/* Check key length. */
- if( ( ( keylen - 16 ) | 16 ) != 16 )
+ if ( ( ( keylen - 16 ) | 16 ) != 16 )
return GPG_ERR_INV_KEYLEN;
/* Do self-test if necessary. */
@@ -592,10 +592,10 @@ do_twofish_setkey (TWOFISH_context *ctx, const byte *key, const unsigned keylen)
{
initialized = 1;
selftest_failed = selftest ();
- if( selftest_failed )
+ if ( selftest_failed )
log_error("%s\n", selftest_failed );
}
- if( selftest_failed )
+ if ( selftest_failed )
return GPG_ERR_SELFTEST_FAILED;
/* Compute the first two words of the S vector. The magic numbers are
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-add.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-add.c
index ada257ae1e..a5cbc0f0fe 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-add.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-add.c
@@ -48,18 +48,18 @@ gcry_mpi_add_ui(gcry_mpi_t w, gcry_mpi_t u, unsigned long v )
/* If not space for W (and possible carry), increase space. */
wsize = usize + 1;
- if( w->alloced < wsize )
+ if ( w->alloced < wsize )
mpi_resize(w, wsize);
/* These must be after realloc (U may be the same as W). */
up = u->d;
wp = w->d;
- if( !usize ) { /* simple */
+ if ( !usize ) { /* simple */
wp[0] = v;
wsize = v? 1:0;
}
- else if( !usign ) { /* mpi is not negative */
+ else if ( !usign ) { /* mpi is not negative */
mpi_limb_t cy;
cy = _gcry_mpih_add_1(wp, up, usize, v);
wp[usize] = cy;
@@ -67,7 +67,7 @@ gcry_mpi_add_ui(gcry_mpi_t w, gcry_mpi_t u, unsigned long v )
}
else { /* The signs are different. Need exact comparison to determine
* which operand to subtract from which. */
- if( usize == 1 && up[0] < v ) {
+ if ( usize == 1 && up[0] < v ) {
wp[0] = v - up[0];
wsize = 1;
}
@@ -91,7 +91,7 @@ gcry_mpi_add(gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v)
mpi_size_t usize, vsize, wsize;
int usign, vsign, wsign;
- if( u->nlimbs < v->nlimbs ) { /* Swap U and V. */
+ if ( u->nlimbs < v->nlimbs ) { /* Swap U and V. */
usize = v->nlimbs;
usign = v->sign;
vsize = u->nlimbs;
@@ -116,31 +116,31 @@ gcry_mpi_add(gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v)
wp = w->d;
wsign = 0;
- if( !vsize ) { /* simple */
+ if ( !vsize ) { /* simple */
MPN_COPY(wp, up, usize );
wsize = usize;
wsign = usign;
}
- else if( usign != vsign ) { /* different sign */
+ else if ( usign != vsign ) { /* different sign */
/* This test is right since USIZE >= VSIZE */
- if( usize != vsize ) {
+ if ( usize != vsize ) {
_gcry_mpih_sub(wp, up, usize, vp, vsize);
wsize = usize;
MPN_NORMALIZE(wp, wsize);
wsign = usign;
}
- else if( _gcry_mpih_cmp(up, vp, usize) < 0 ) {
+ else if ( _gcry_mpih_cmp(up, vp, usize) < 0 ) {
_gcry_mpih_sub_n(wp, vp, up, usize);
wsize = usize;
MPN_NORMALIZE(wp, wsize);
- if( !usign )
+ if ( !usign )
wsign = 1;
}
else {
_gcry_mpih_sub_n(wp, up, vp, usize);
wsize = usize;
MPN_NORMALIZE(wp, wsize);
- if( usign )
+ if ( usign )
wsign = 1;
}
}
@@ -148,7 +148,7 @@ gcry_mpi_add(gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v)
mpi_limb_t cy = _gcry_mpih_add(wp, up, usize, vp, vsize);
wp[usize] = cy;
wsize = usize + cy;
- if( usign )
+ if ( usign )
wsign = 1;
}
@@ -174,19 +174,19 @@ gcry_mpi_sub_ui(gcry_mpi_t w, gcry_mpi_t u, unsigned long v )
/* If not space for W (and possible carry), increase space. */
wsize = usize + 1;
- if( w->alloced < wsize )
+ if ( w->alloced < wsize )
mpi_resize(w, wsize);
/* These must be after realloc (U may be the same as W). */
up = u->d;
wp = w->d;
- if( !usize ) { /* simple */
+ if ( !usize ) { /* simple */
wp[0] = v;
wsize = v? 1:0;
wsign = 1;
}
- else if( usign ) { /* mpi and v are negative */
+ else if ( usign ) { /* mpi and v are negative */
mpi_limb_t cy;
cy = _gcry_mpih_add_1(wp, up, usize, v);
wp[usize] = cy;
@@ -194,7 +194,7 @@ gcry_mpi_sub_ui(gcry_mpi_t w, gcry_mpi_t u, unsigned long v )
}
else { /* The signs are different. Need exact comparison to determine
* which operand to subtract from which. */
- if( usize == 1 && up[0] < v ) {
+ if ( usize == 1 && up[0] < v ) {
wp[0] = v - up[0];
wsize = 1;
wsign = 1;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c
index 32c820c291..5aeedbbf6d 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c
@@ -54,10 +54,10 @@ _gcry_clz_tab[] =
void
_gcry_mpi_normalize( gcry_mpi_t a )
{
- if( mpi_is_opaque(a) )
+ if ( mpi_is_opaque(a) )
return;
- for( ; a->nlimbs && !a->d[a->nlimbs-1]; a->nlimbs-- )
+ for ( ; a->nlimbs && !a->d[a->nlimbs-1]; a->nlimbs-- )
;
}
@@ -71,14 +71,14 @@ gcry_mpi_get_nbits( gcry_mpi_t a )
{
unsigned n;
- if( mpi_is_opaque(a) ) {
+ if ( mpi_is_opaque(a) ) {
return a->sign; /* which holds the number of bits */
}
_gcry_mpi_normalize( a );
- if( a->nlimbs ) {
+ if ( a->nlimbs ) {
mpi_limb_t alimb = a->d[a->nlimbs-1];
- if( alimb )
+ if ( alimb )
count_leading_zeros( n, alimb );
else
n = BITS_PER_MPI_LIMB;
@@ -102,7 +102,7 @@ gcry_mpi_test_bit( gcry_mpi_t a, unsigned int n )
limbno = n / BITS_PER_MPI_LIMB;
bitno = n % BITS_PER_MPI_LIMB;
- if( limbno >= a->nlimbs )
+ if ( limbno >= a->nlimbs )
return 0; /* too far left: this is a 0 */
limb = a->d[limbno];
return (limb & (A_LIMB_1 << bitno))? 1: 0;
@@ -161,11 +161,11 @@ gcry_mpi_clear_highbit( gcry_mpi_t a, unsigned int n )
limbno = n / BITS_PER_MPI_LIMB;
bitno = n % BITS_PER_MPI_LIMB;
- if( limbno >= a->nlimbs )
+ if ( limbno >= a->nlimbs )
return; /* not allocated, therefore no need to clear bits
:-) */
- for( ; bitno < BITS_PER_MPI_LIMB; bitno++ )
+ for ( ; bitno < BITS_PER_MPI_LIMB; bitno++ )
a->d[limbno] &= ~(A_LIMB_1 << bitno);
a->nlimbs = limbno+1;
}
@@ -181,7 +181,7 @@ gcry_mpi_clear_bit( gcry_mpi_t a, unsigned int n )
limbno = n / BITS_PER_MPI_LIMB;
bitno = n % BITS_PER_MPI_LIMB;
- if( limbno >= a->nlimbs )
+ if ( limbno >= a->nlimbs )
return; /* don't need to clear this bit, it's to far to left */
a->d[limbno] &= ~(A_LIMB_1 << bitno);
}
@@ -198,12 +198,12 @@ _gcry_mpi_rshift_limbs( gcry_mpi_t a, unsigned int count )
mpi_size_t n = a->nlimbs;
unsigned int i;
- if( count >= n ) {
+ if ( count >= n ) {
a->nlimbs = 0;
return;
}
- for( i = 0; i < n - count; i++ )
+ for ( i = 0; i < n - count; i++ )
ap[i] = ap[i+count];
ap[i] = 0;
a->nlimbs -= count;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-cmp.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-cmp.c
index 9dd10830b0..eb62885e21 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-cmp.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-cmp.c
@@ -75,15 +75,15 @@ gcry_mpi_cmp (gcry_mpi_t u, gcry_mpi_t v)
/* U and V are either both positive or both negative. */
- if( usize != vsize && !u->sign && !v->sign )
+ if ( usize != vsize && !u->sign && !v->sign )
return usize - vsize;
- if( usize != vsize && u->sign && v->sign )
+ if ( usize != vsize && u->sign && v->sign )
return vsize + usize;
- if( !usize )
+ if ( !usize )
return 0;
- if( !(cmp = _gcry_mpih_cmp( u->d, v->d, usize )) )
+ if ( !(cmp = _gcry_mpih_cmp( u->d, v->d, usize )) )
return 0;
- if( (cmp < 0?1:0) == (u->sign?1:0))
+ if ( (cmp < 0?1:0) == (u->sign?1:0))
return 1;
return -1;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-div.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-div.c
index 0d8a2d1688..690a7e3885 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-div.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-div.c
@@ -42,17 +42,17 @@ _gcry_mpi_fdiv_r( gcry_mpi_t rem, gcry_mpi_t dividend, gcry_mpi_t divisor )
/* We need the original value of the divisor after the remainder has been
* preliminary calculated. We have to copy it to temporary space if it's
* the same variable as REM. */
- if( rem == divisor ) {
+ if ( rem == divisor ) {
temp_divisor = mpi_copy( divisor );
divisor = temp_divisor;
}
_gcry_mpi_tdiv_r( rem, dividend, divisor );
- if( ((divisor_sign?1:0) ^ (dividend->sign?1:0)) && rem->nlimbs )
+ if ( ((divisor_sign?1:0) ^ (dividend->sign?1:0)) && rem->nlimbs )
gcry_mpi_add( rem, rem, divisor);
- if( temp_divisor )
+ if ( temp_divisor )
mpi_free(temp_divisor);
}
@@ -70,10 +70,10 @@ _gcry_mpi_fdiv_r_ui( gcry_mpi_t rem, gcry_mpi_t dividend, ulong divisor )
mpi_limb_t rlimb;
rlimb = _gcry_mpih_mod_1( dividend->d, dividend->nlimbs, divisor );
- if( rlimb && dividend->sign )
+ if ( rlimb && dividend->sign )
rlimb = divisor - rlimb;
- if( rem ) {
+ if ( rem ) {
rem->d[0] = rlimb;
rem->nlimbs = rlimb? 1:0;
}
@@ -95,19 +95,19 @@ _gcry_mpi_fdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t dividend, gcry_mp
int divisor_sign = divisor->sign;
gcry_mpi_t temp_divisor = NULL;
- if( quot == divisor || rem == divisor ) {
+ if ( quot == divisor || rem == divisor ) {
temp_divisor = mpi_copy( divisor );
divisor = temp_divisor;
}
_gcry_mpi_tdiv_qr( quot, rem, dividend, divisor );
- if( (divisor_sign ^ dividend->sign) && rem->nlimbs ) {
+ if ( (divisor_sign ^ dividend->sign) && rem->nlimbs ) {
gcry_mpi_sub_ui( quot, quot, 1 );
gcry_mpi_add( rem, rem, divisor);
}
- if( temp_divisor )
+ if ( temp_divisor )
mpi_free(temp_divisor);
}
@@ -148,13 +148,13 @@ _gcry_mpi_tdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t num, gcry_mpi_t d
mpi_resize( rem, rsize);
qsize = rsize - dsize; /* qsize cannot be bigger than this. */
- if( qsize <= 0 ) {
- if( num != rem ) {
+ if ( qsize <= 0 ) {
+ if ( num != rem ) {
rem->nlimbs = num->nlimbs;
rem->sign = num->sign;
MPN_COPY(rem->d, num->d, nsize);
}
- if( quot ) {
+ if ( quot ) {
/* This needs to follow the assignment to rem, in case the
* numerator and quotient are the same. */
quot->nlimbs = 0;
@@ -163,7 +163,7 @@ _gcry_mpi_tdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t num, gcry_mpi_t d
return;
}
- if( quot )
+ if ( quot )
mpi_resize( quot, qsize);
/* Read pointers here, when reallocation is finished. */
@@ -172,9 +172,9 @@ _gcry_mpi_tdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t num, gcry_mpi_t d
rp = rem->d;
/* Optimize division by a single-limb divisor. */
- if( dsize == 1 ) {
+ if ( dsize == 1 ) {
mpi_limb_t rlimb;
- if( quot ) {
+ if ( quot ) {
qp = quot->d;
rlimb = _gcry_mpih_divmod_1( qp, np, nsize, dp[0] );
qsize -= qp[qsize - 1] == 0;
@@ -191,7 +191,7 @@ _gcry_mpi_tdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t num, gcry_mpi_t d
}
- if( quot ) {
+ if ( quot ) {
qp = quot->d;
/* Make sure QP and NP point to different objects. Otherwise the
* numerator would be gradually overwritten by the quotient limbs. */
@@ -211,7 +211,7 @@ _gcry_mpi_tdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t num, gcry_mpi_t d
* shifting it NORMALIZATION_STEPS bits to the left. Also shift the
* numerator the same number of steps (to keep the quotient the same!).
*/
- if( normalization_steps ) {
+ if ( normalization_steps ) {
mpi_ptr_t tp;
mpi_limb_t nlimb;
@@ -227,7 +227,7 @@ _gcry_mpi_tdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t num, gcry_mpi_t d
* significant word. Move the shifted numerator in the remainder
* meanwhile. */
nlimb = _gcry_mpih_lshift(rp, np, nsize, normalization_steps);
- if( nlimb ) {
+ if ( nlimb ) {
rp[nsize] = nlimb;
rsize = nsize + 1;
}
@@ -237,7 +237,7 @@ _gcry_mpi_tdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t num, gcry_mpi_t d
else {
/* The denominator is already normalized, as required. Copy it to
* temporary space if it overlaps with the quotient or remainder. */
- if( dp == rp || (quot && (dp == qp))) {
+ if ( dp == rp || (quot && (dp == qp))) {
mpi_ptr_t tp;
marker_nlimbs[markidx] = dsize;
@@ -248,7 +248,7 @@ _gcry_mpi_tdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t num, gcry_mpi_t d
}
/* Move the numerator to the remainder. */
- if( rp != np )
+ if ( rp != np )
MPN_COPY(rp, np, nsize);
rsize = nsize;
@@ -256,7 +256,7 @@ _gcry_mpi_tdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t num, gcry_mpi_t d
q_limb = _gcry_mpih_divrem( qp, 0, rp, rsize, dp, dsize );
- if( quot ) {
+ if ( quot ) {
qsize = rsize - dsize;
if(q_limb) {
qp[qsize] = q_limb;
@@ -270,7 +270,7 @@ _gcry_mpi_tdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t num, gcry_mpi_t d
rsize = dsize;
MPN_NORMALIZE (rp, rsize);
- if( normalization_steps && rsize ) {
+ if ( normalization_steps && rsize ) {
_gcry_mpih_rshift(rp, rp, rsize, normalization_steps);
rsize -= rp[rsize - 1] == 0?1:0;
}
@@ -293,7 +293,7 @@ _gcry_mpi_tdiv_q_2exp( gcry_mpi_t w, gcry_mpi_t u, unsigned int count )
usize = u->nlimbs;
limb_cnt = count / BITS_PER_MPI_LIMB;
wsize = usize - limb_cnt;
- if( limb_cnt >= usize )
+ if ( limb_cnt >= usize )
w->nlimbs = 0;
else {
mpi_ptr_t wp;
@@ -304,7 +304,7 @@ _gcry_mpi_tdiv_q_2exp( gcry_mpi_t w, gcry_mpi_t u, unsigned int count )
up = u->d;
count %= BITS_PER_MPI_LIMB;
- if( count ) {
+ if ( count ) {
_gcry_mpih_rshift( wp, up + limb_cnt, wsize, count );
wsize -= !wp[wsize - 1];
}
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-inline.h b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-inline.h
index 88d9f56c41..fb43951b1d 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-inline.h
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-inline.h
@@ -41,20 +41,20 @@ _gcry_mpih_add_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
x = *s1_ptr++;
s2_limb += x;
*res_ptr++ = s2_limb;
- if( s2_limb < x ) { /* sum is less than the left operand: handle carry */
+ if ( s2_limb < x ) { /* sum is less than the left operand: handle carry */
while( --s1_size ) {
x = *s1_ptr++ + 1; /* add carry */
*res_ptr++ = x; /* and store */
- if( x ) /* not 0 (no overflow): we can stop */
+ if ( x ) /* not 0 (no overflow): we can stop */
goto leave;
}
return 1; /* return carry (size of s1 to small) */
}
leave:
- if( res_ptr != s1_ptr ) { /* not the same variable */
+ if ( res_ptr != s1_ptr ) { /* not the same variable */
mpi_size_t i; /* copy the rest */
- for( i=0; i < s1_size-1; i++ )
+ for ( i=0; i < s1_size-1; i++ )
res_ptr[i] = s1_ptr[i];
}
return 0; /* no carry */
@@ -68,10 +68,10 @@ _gcry_mpih_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
{
mpi_limb_t cy = 0;
- if( s2_size )
+ if ( s2_size )
cy = _gcry_mpih_add_n( res_ptr, s1_ptr, s2_ptr, s2_size );
- if( s1_size - s2_size )
+ if ( s1_size - s2_size )
cy = _gcry_mpih_add_1( res_ptr + s2_size, s1_ptr + s2_size,
s1_size - s2_size, cy);
return cy;
@@ -87,20 +87,20 @@ _gcry_mpih_sub_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
x = *s1_ptr++;
s2_limb = x - s2_limb;
*res_ptr++ = s2_limb;
- if( s2_limb > x ) {
+ if ( s2_limb > x ) {
while( --s1_size ) {
x = *s1_ptr++;
*res_ptr++ = x - 1;
- if( x )
+ if ( x )
goto leave;
}
return 1;
}
leave:
- if( res_ptr != s1_ptr ) {
+ if ( res_ptr != s1_ptr ) {
mpi_size_t i;
- for( i=0; i < s1_size-1; i++ )
+ for ( i=0; i < s1_size-1; i++ )
res_ptr[i] = s1_ptr[i];
}
return 0;
@@ -114,10 +114,10 @@ _gcry_mpih_sub( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
{
mpi_limb_t cy = 0;
- if( s2_size )
+ if ( s2_size )
cy = _gcry_mpih_sub_n(res_ptr, s1_ptr, s2_ptr, s2_size);
- if( s1_size - s2_size )
+ if ( s1_size - s2_size )
cy = _gcry_mpih_sub_1(res_ptr + s2_size, s1_ptr + s2_size,
s1_size - s2_size, cy);
return cy;
@@ -135,10 +135,10 @@ _gcry_mpih_cmp( mpi_ptr_t op1_ptr, mpi_ptr_t op2_ptr, mpi_size_t size )
mpi_size_t i;
mpi_limb_t op1_word, op2_word;
- for( i = size - 1; i >= 0 ; i--) {
+ for ( i = size - 1; i >= 0 ; i--) {
op1_word = op1_ptr[i];
op2_word = op2_ptr[i];
- if( op1_word != op2_word )
+ if ( op1_word != op2_word )
goto diff;
}
return 0;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-internal.h b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-internal.h
index f9c1f9d4db..c560e5691f 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-internal.h
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-internal.h
@@ -76,7 +76,7 @@ typedef int mpi_size_t; /* (must be a signed type) */
#define MAX(h,i) ((h) > (i) ? (h) : (i))
#define RESIZE_IF_NEEDED(a,b) \
do { \
- if( (a)->alloced < (b) ) \
+ if ( (a)->alloced < (b) ) \
mpi_resize((a), (b)); \
} while(0)
@@ -84,21 +84,21 @@ typedef int mpi_size_t; /* (must be a signed type) */
#define MPN_COPY( d, s, n) \
do { \
mpi_size_t _i; \
- for( _i = 0; _i < (n); _i++ ) \
+ for ( _i = 0; _i < (n); _i++ ) \
(d)[_i] = (s)[_i]; \
} while(0)
#define MPN_COPY_INCR( d, s, n) \
do { \
mpi_size_t _i; \
- for( _i = 0; _i < (n); _i++ ) \
+ for ( _i = 0; _i < (n); _i++ ) \
(d)[_i] = (d)[_i]; \
} while (0)
#define MPN_COPY_DECR( d, s, n ) \
do { \
mpi_size_t _i; \
- for( _i = (n)-1; _i >= 0; _i--) \
+ for ( _i = (n)-1; _i >= 0; _i--) \
(d)[_i] = (s)[_i]; \
} while(0)
@@ -106,14 +106,14 @@ typedef int mpi_size_t; /* (must be a signed type) */
#define MPN_ZERO(d, n) \
do { \
int _i; \
- for( _i = 0; _i < (n); _i++ ) \
+ for ( _i = 0; _i < (n); _i++ ) \
(d)[_i] = 0; \
} while (0)
#define MPN_NORMALIZE(d, n) \
do { \
while( (n) > 0 ) { \
- if( (d)[(n)-1] ) \
+ if ( (d)[(n)-1] ) \
break; \
(n)--; \
} \
@@ -121,8 +121,8 @@ typedef int mpi_size_t; /* (must be a signed type) */
#define MPN_NORMALIZE_NOT_ZERO(d, n) \
do { \
- for(;;) { \
- if( (d)[(n)-1] ) \
+ for (;;) { \
+ if ( (d)[(n)-1] ) \
break; \
(n)--; \
} \
@@ -130,7 +130,7 @@ typedef int mpi_size_t; /* (must be a signed type) */
#define MPN_MUL_N_RECURSE(prodp, up, vp, size, tspace) \
do { \
- if( (size) < KARATSUBA_THRESHOLD ) \
+ if ( (size) < KARATSUBA_THRESHOLD ) \
mul_n_basecase (prodp, up, vp, size); \
else \
mul_n (prodp, up, vp, size, tspace); \
@@ -151,15 +151,15 @@ typedef int mpi_size_t; /* (must be a signed type) */
_q += (nh); /* DI is 2**BITS_PER_MPI_LIMB too small */ \
umul_ppmm (_xh, _xl, _q, (d)); \
sub_ddmmss (_xh, _r, (nh), (nl), _xh, _xl); \
- if( _xh ) { \
+ if ( _xh ) { \
sub_ddmmss (_xh, _r, _xh, _r, 0, (d)); \
_q++; \
- if( _xh) { \
+ if ( _xh) { \
sub_ddmmss (_xh, _r, _xh, _r, 0, (d)); \
_q++; \
} \
} \
- if( _r >= (d) ) { \
+ if ( _r >= (d) ) { \
_r -= (d); \
_q++; \
} \
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-inv.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-inv.c
index 5d269466e0..530f8fa4ff 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-inv.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-inv.c
@@ -98,7 +98,7 @@ gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n )
v1 = mpi_copy(v); /* !-- used as const 1 */
v2 = mpi_alloc( mpi_get_nlimbs(u) ); mpi_sub( v2, u1, u );
v3 = mpi_copy(v);
- if( mpi_test_bit(u, 0) ) { /* u is odd */
+ if ( mpi_test_bit(u, 0) ) { /* u is odd */
t1 = mpi_alloc_set_ui(0);
t2 = mpi_alloc_set_ui(1); t2->sign = 1;
t3 = mpi_copy(v); t3->sign = !t3->sign;
@@ -111,7 +111,7 @@ gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n )
}
do {
do {
- if( mpi_test_bit(t1, 0) || mpi_test_bit(t2, 0) ) { /* one is odd */
+ if ( mpi_test_bit(t1, 0) || mpi_test_bit(t2, 0) ) { /* one is odd */
mpi_add(t1, t1, v);
mpi_sub(t2, t2, u);
}
@@ -122,7 +122,7 @@ gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n )
;
} while( !mpi_test_bit( t3, 0 ) ); /* while t3 is even */
- if( !t3->sign ) {
+ if ( !t3->sign ) {
mpi_set(u1, t1);
mpi_set(u2, t2);
mpi_set(u3, t3);
@@ -139,7 +139,7 @@ gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n )
mpi_sub(t1, u1, v1);
mpi_sub(t2, u2, v2);
mpi_sub(t3, u3, v3);
- if( t1->sign ) {
+ if ( t1->sign ) {
mpi_add(t1, t1, v);
mpi_sub(t2, t2, u);
}
@@ -175,18 +175,18 @@ gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n )
odd = mpi_test_bit(v,0);
u1 = mpi_alloc_set_ui(1);
- if( !odd )
+ if ( !odd )
u2 = mpi_alloc_set_ui(0);
u3 = mpi_copy(u);
v1 = mpi_copy(v);
- if( !odd ) {
+ if ( !odd ) {
v2 = mpi_alloc( mpi_get_nlimbs(u) );
mpi_sub( v2, u1, u ); /* U is used as const 1 */
}
v3 = mpi_copy(v);
- if( mpi_test_bit(u, 0) ) { /* u is odd */
+ if ( mpi_test_bit(u, 0) ) { /* u is odd */
t1 = mpi_alloc_set_ui(0);
- if( !odd ) {
+ if ( !odd ) {
t2 = mpi_alloc_set_ui(1); t2->sign = 1;
}
t3 = mpi_copy(v); t3->sign = !t3->sign;
@@ -194,14 +194,14 @@ gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n )
}
else {
t1 = mpi_alloc_set_ui(1);
- if( !odd )
+ if ( !odd )
t2 = mpi_alloc_set_ui(0);
t3 = mpi_copy(u);
}
do {
do {
- if( !odd ) {
- if( mpi_test_bit(t1, 0) || mpi_test_bit(t2, 0) ) { /* one is odd */
+ if ( !odd ) {
+ if ( mpi_test_bit(t1, 0) || mpi_test_bit(t2, 0) ) { /* one is odd */
mpi_add(t1, t1, v);
mpi_sub(t2, t2, u);
}
@@ -210,7 +210,7 @@ gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n )
mpi_rshift(t3, t3, 1);
}
else {
- if( mpi_test_bit(t1, 0) )
+ if ( mpi_test_bit(t1, 0) )
mpi_add(t1, t1, v);
mpi_rshift(t1, t1, 1);
mpi_rshift(t3, t3, 1);
@@ -219,16 +219,16 @@ gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n )
;
} while( !mpi_test_bit( t3, 0 ) ); /* while t3 is even */
- if( !t3->sign ) {
+ if ( !t3->sign ) {
mpi_set(u1, t1);
- if( !odd )
+ if ( !odd )
mpi_set(u2, t2);
mpi_set(u3, t3);
}
else {
mpi_sub(v1, v, t1);
sign = u->sign; u->sign = !u->sign;
- if( !odd )
+ if ( !odd )
mpi_sub(v2, u, t2);
u->sign = sign;
sign = t3->sign; t3->sign = !t3->sign;
@@ -236,12 +236,12 @@ gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n )
t3->sign = sign;
}
mpi_sub(t1, u1, v1);
- if( !odd )
+ if ( !odd )
mpi_sub(t2, u2, v2);
mpi_sub(t3, u3, v3);
- if( t1->sign ) {
+ if ( t1->sign ) {
mpi_add(t1, t1, v);
- if( !odd )
+ if ( !odd )
mpi_sub(t2, t2, u);
}
} while( mpi_cmp_ui( t3, 0 ) ); /* while t3 != 0 */
@@ -251,7 +251,7 @@ gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n )
mpi_free(u1);
mpi_free(v1);
mpi_free(t1);
- if( !odd ) {
+ if ( !odd ) {
mpi_free(u2);
mpi_free(v2);
mpi_free(t2);
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-mpow.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-mpow.c
index 131c5b67b2..33b9d393c5 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-mpow.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-mpow.c
@@ -52,7 +52,7 @@ build_index( gcry_mpi_t *exparray, int k, int i, int t )
bitno = t-i;
for(j=k-1; j >= 0; j-- ) {
idx <<= 1;
- if( mpi_test_bit( exparray[j], bitno ) )
+ if ( mpi_test_bit( exparray[j], bitno ) )
idx |= 1;
}
/*log_debug("t=%d i=%d idx=%d\n", t, i, idx );*/
@@ -81,7 +81,7 @@ _gcry_mpi_mulpowm( gcry_mpi_t res, gcry_mpi_t *basearray, gcry_mpi_t *exparray,
for(t=0, i=0; (tmp=exparray[i]); i++ ) {
/*log_mpidump("exp: ", tmp );*/
j = mpi_get_nbits(tmp);
- if( j > t )
+ if ( j > t )
t = j;
}
/*log_mpidump("mod: ", m );*/
@@ -101,20 +101,20 @@ _gcry_mpi_mulpowm( gcry_mpi_t res, gcry_mpi_t *basearray, gcry_mpi_t *exparray,
barrett_r1, barrett_r2 );
idx = build_index( exparray, k, i, t );
gcry_assert (idx >= 0 && idx < (1<<k));
- if( !G[idx] ) {
- if( !idx )
+ if ( !G[idx] ) {
+ if ( !idx )
G[0] = mpi_alloc_set_ui( 1 );
else {
for(j=0; j < k; j++ ) {
- if( (idx & (1<<j) ) ) {
- if( !G[idx] )
+ if ( (idx & (1<<j) ) ) {
+ if ( !G[idx] )
G[idx] = mpi_copy( basearray[j] );
else
barrett_mulm( G[idx], G[idx], basearray[j],
m, barrett_y, barrett_k, barrett_r1, barrett_r2 );
}
}
- if( !G[idx] )
+ if ( !G[idx] )
G[idx] = mpi_alloc(0);
}
}
@@ -140,7 +140,7 @@ static void
barrett_mulm( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m, gcry_mpi_t y, int k, gcry_mpi_t r1, gcry_mpi_t r2 )
{
mpi_mul(w, u, v);
- if( calc_barrett( w, w, m, y, k, r1, r2 ) )
+ if ( calc_barrett( w, w, m, y, k, r1, r2 ) )
mpi_fdiv_r( w, w, m );
}
@@ -178,7 +178,7 @@ calc_barrett( gcry_mpi_t r, gcry_mpi_t x, gcry_mpi_t m, gcry_mpi_t y, int k, gcr
int xx = k > 3 ? k-3:0;
mpi_normalize( x );
- if( mpi_get_nlimbs(x) > 2*k )
+ if ( mpi_get_nlimbs(x) > 2*k )
return 1; /* can't do it */
/* 1. q1 = floor( x / b^k-1)
@@ -197,14 +197,14 @@ calc_barrett( gcry_mpi_t r, gcry_mpi_t x, gcry_mpi_t m, gcry_mpi_t y, int k, gcr
* 3. if r < 0 then r = r + b^k+1
*/
mpi_set( r1, x );
- if( r1->nlimbs > k+1 ) /* quick modulo operation */
+ if ( r1->nlimbs > k+1 ) /* quick modulo operation */
r1->nlimbs = k+1;
mpi_mul( r2, r2, m );
- if( r2->nlimbs > k+1 ) /* quick modulo operation */
+ if ( r2->nlimbs > k+1 ) /* quick modulo operation */
r2->nlimbs = k+1;
mpi_sub( r, r1, r2 );
- if( mpi_is_neg( r ) ) {
+ if ( mpi_is_neg( r ) ) {
gcry_mpi_t tmp;
tmp = mpi_alloc( k + 2 );
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-mul.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-mul.c
index 25aeaa0a2c..7ad9dd594b 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-mul.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-mul.c
@@ -41,19 +41,19 @@ gcry_mpi_mul_ui( gcry_mpi_t prod, gcry_mpi_t mult, unsigned long small_mult )
size = mult->nlimbs;
sign = mult->sign;
- if( !size || !small_mult ) {
+ if ( !size || !small_mult ) {
prod->nlimbs = 0;
prod->sign = 0;
return;
}
prod_size = size + 1;
- if( prod->alloced < prod_size )
+ if ( prod->alloced < prod_size )
mpi_resize( prod, prod_size );
prod_ptr = prod->d;
cy = _gcry_mpih_mul_1( prod_ptr, mult->d, size, (mpi_limb_t)small_mult );
- if( cy )
+ if ( cy )
prod_ptr[size++] = cy;
prod->nlimbs = size;
prod->sign = sign;
@@ -71,7 +71,7 @@ gcry_mpi_mul_2exp( gcry_mpi_t w, gcry_mpi_t u, unsigned long cnt)
usize = u->nlimbs;
usign = u->sign;
- if( !usize ) {
+ if ( !usize ) {
w->nlimbs = 0;
w->sign = 0;
return;
@@ -79,16 +79,16 @@ gcry_mpi_mul_2exp( gcry_mpi_t w, gcry_mpi_t u, unsigned long cnt)
limb_cnt = cnt / BITS_PER_MPI_LIMB;
wsize = usize + limb_cnt + 1;
- if( w->alloced < wsize )
+ if ( w->alloced < wsize )
mpi_resize(w, wsize );
wp = w->d;
wsize = usize + limb_cnt;
wsign = usign;
cnt %= BITS_PER_MPI_LIMB;
- if( cnt ) {
+ if ( cnt ) {
wlimb = _gcry_mpih_lshift( wp + limb_cnt, u->d, usize, cnt );
- if( wlimb ) {
+ if ( wlimb ) {
wp[wsize] = wlimb;
wsize++;
}
@@ -117,7 +117,7 @@ gcry_mpi_mul( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v)
mpi_ptr_t tmp_limb=NULL;
unsigned int tmp_limb_nlimbs = 0;
- if( u->nlimbs < v->nlimbs ) { /* Swap U and V. */
+ if ( u->nlimbs < v->nlimbs ) { /* Swap U and V. */
usize = v->nlimbs;
usign = v->sign;
usecure = mpi_is_secure(v);
@@ -150,8 +150,8 @@ gcry_mpi_mul( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v)
assign_wp = 2; /* mark it as 2 so that we can later copy it back to
* mormal memory */
}
- else if( w->alloced < wsize ) {
- if( wp == up || wp == vp ) {
+ else if ( w->alloced < wsize ) {
+ if ( wp == up || wp == vp ) {
wp = mpi_alloc_limb_space( wsize, mpi_is_secure(w) );
assign_wp = 1;
}
@@ -161,17 +161,17 @@ gcry_mpi_mul( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v)
}
}
else { /* Make U and V not overlap with W. */
- if( wp == up ) {
+ if ( wp == up ) {
/* W and U are identical. Allocate temporary space for U. */
tmp_limb_nlimbs = usize;
up = tmp_limb = mpi_alloc_limb_space( usize, usecure );
/* Is V identical too? Keep it identical with U. */
- if( wp == vp )
+ if ( wp == vp )
vp = up;
/* Copy to the temporary space. */
MPN_COPY( up, wp, usize );
}
- else if( wp == vp ) {
+ else if ( wp == vp ) {
/* W and V are identical. Allocate temporary space for V. */
tmp_limb_nlimbs = vsize;
vp = tmp_limb = mpi_alloc_limb_space( vsize, vsecure );
@@ -180,14 +180,14 @@ gcry_mpi_mul( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v)
}
}
- if( !vsize )
+ if ( !vsize )
wsize = 0;
else {
cy = _gcry_mpih_mul( wp, up, usize, vp, vsize );
wsize -= cy? 0:1;
}
- if( assign_wp ) {
+ if ( assign_wp ) {
if (assign_wp == 2) {
/* copy the temp wp from secure memory back to normal memory */
mpi_ptr_t tmp_wp = mpi_alloc_limb_space (wsize, 0);
@@ -199,7 +199,7 @@ gcry_mpi_mul( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v)
}
w->nlimbs = wsize;
w->sign = sign_product;
- if( tmp_limb )
+ if ( tmp_limb )
_gcry_mpi_free_limb_space (tmp_limb, tmp_limb_nlimbs);
}
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-pow.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-pow.c
index ca7ead0285..23e9f8eae1 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-pow.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-pow.c
@@ -234,7 +234,7 @@ gcry_mpi_powm (gcry_mpi_t res,
if ( (mpi_limb_signed_t)e < 0 )
{
/*mpih_mul( xp, rp, rsize, bp, bsize );*/
- if( bsize < KARATSUBA_THRESHOLD )
+ if ( bsize < KARATSUBA_THRESHOLD )
_gcry_mpih_mul ( xp, rp, rsize, bp, bsize );
else
_gcry_mpih_mul_karatsuba_case (xp, rp, rsize, bp, bsize,
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-scan.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-scan.c
index 90699cdd69..e06d990150 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-scan.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-scan.c
@@ -42,8 +42,8 @@ _gcry_mpi_getbyte( gcry_mpi_t a, unsigned idx )
ap = a->d;
for(n=0,i=0; i < a->nlimbs; i++ ) {
limb = ap[i];
- for( j=0; j < BYTES_PER_MPI_LIMB; j++, n++ )
- if( n == idx )
+ for ( j=0; j < BYTES_PER_MPI_LIMB; j++, n++ )
+ if ( n == idx )
return (limb >> j*8) & 0xff;
}
return -1;
@@ -65,38 +65,38 @@ _gcry_mpi_putbyte( gcry_mpi_t a, unsigned idx, int xc )
ap = a->d;
for(n=0,i=0; i < a->alloced; i++ ) {
limb = ap[i];
- for( j=0; j < BYTES_PER_MPI_LIMB; j++, n++ )
- if( n == idx ) {
+ for ( j=0; j < BYTES_PER_MPI_LIMB; j++, n++ )
+ if ( n == idx ) {
#if BYTES_PER_MPI_LIMB == 4
- if( j == 0 )
+ if ( j == 0 )
limb = (limb & 0xffffff00) | c;
- else if( j == 1 )
+ else if ( j == 1 )
limb = (limb & 0xffff00ff) | (c<<8);
- else if( j == 2 )
+ else if ( j == 2 )
limb = (limb & 0xff00ffff) | (c<<16);
else
limb = (limb & 0x00ffffff) | (c<<24);
#elif BYTES_PER_MPI_LIMB == 8
- if( j == 0 )
+ if ( j == 0 )
limb = (limb & 0xffffffffffffff00) | c;
- else if( j == 1 )
+ else if ( j == 1 )
limb = (limb & 0xffffffffffff00ff) | (c<<8);
- else if( j == 2 )
+ else if ( j == 2 )
limb = (limb & 0xffffffffff00ffff) | (c<<16);
- else if( j == 3 )
+ else if ( j == 3 )
limb = (limb & 0xffffffff00ffffff) | (c<<24);
- else if( j == 4 )
+ else if ( j == 4 )
limb = (limb & 0xffffff00ffffffff) | (c<<32);
- else if( j == 5 )
+ else if ( j == 5 )
limb = (limb & 0xffff00ffffffffff) | (c<<40);
- else if( j == 6 )
+ else if ( j == 6 )
limb = (limb & 0xff00ffffffffffff) | (c<<48);
else
limb = (limb & 0x00ffffffffffffff) | (c<<56);
#else
#error please enhance this function, its ugly - i know.
#endif
- if( a->nlimbs <= i )
+ if ( a->nlimbs <= i )
a->nlimbs = i+1;
ap[i] = limb;
return;
@@ -115,7 +115,7 @@ _gcry_mpi_trailing_zeros( gcry_mpi_t a )
unsigned n, count = 0;
for(n=0; n < a->nlimbs; n++ ) {
- if( a->d[n] ) {
+ if ( a->d[n] ) {
unsigned nn;
mpi_limb_t alimb = a->d[n];
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpicoder.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpicoder.c
index 8f0c76f144..63e589438c 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpicoder.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpicoder.c
@@ -46,7 +46,7 @@ mpi_read_from_buffer (const unsigned char *buffer, unsigned *ret_nread,
/* log_debug ("mpi too large (%u bits)\n", nbits); */
goto leave;
}
- else if( !nbits )
+ else if ( !nbits )
{
/* log_debug ("an mpi of size 0 is not allowed\n"); */
goto leave;
@@ -160,9 +160,9 @@ mpi_fromstr (gcry_mpi_t val, const char *str)
c <<= 4;
if ( c2 >= '0' && c2 <= '9' )
c |= c2 - '0';
- else if( c2 >= 'a' && c2 <= 'f' )
+ else if ( c2 >= 'a' && c2 <= 'f' )
c |= c2 - 'a' + 10;
- else if( c2 >= 'A' && c2 <= 'F' )
+ else if ( c2 >= 'A' && c2 <= 'F' )
c |= c2 - 'A' + 10;
else
{
@@ -601,7 +601,7 @@ gcry_mpi_print (enum gcry_mpi_format format,
unsigned int n = (nbits + 7)/8;
/* The PGP format can only handle unsigned integers. */
- if( a->sign )
+ if ( a->sign )
return gcry_error (GPG_ERR_INV_ARG);
if (buffer && n+2 > len)
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpih-div.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpih-div.c
index e41e205e1d..f151b8b17b 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpih-div.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpih-div.c
@@ -51,7 +51,7 @@ _gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
int dummy;
/* Botch: Should this be handled at all? Rely on callers? */
- if( !dividend_size )
+ if ( !dividend_size )
return 0;
/* If multiplication is much faster than division, and the
@@ -62,12 +62,12 @@ _gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
* Does it ever help to use udiv_qrnnd_preinv?
* && Does what we save compensate for the inversion overhead?
*/
- if( UDIV_TIME > (2 * UMUL_TIME + 6)
+ if ( UDIV_TIME > (2 * UMUL_TIME + 6)
&& (UDIV_TIME - (2 * UMUL_TIME + 6)) * dividend_size > UDIV_TIME ) {
int normalization_steps;
count_leading_zeros( normalization_steps, divisor_limb );
- if( normalization_steps ) {
+ if ( normalization_steps ) {
mpi_limb_t divisor_limb_inverted;
divisor_limb <<= normalization_steps;
@@ -78,7 +78,7 @@ _gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
*
* Special case for DIVISOR_LIMB == 100...000.
*/
- if( !(divisor_limb << 1) )
+ if ( !(divisor_limb << 1) )
divisor_limb_inverted = ~(mpi_limb_t)0;
else
udiv_qrnnd(divisor_limb_inverted, dummy,
@@ -93,7 +93,7 @@ _gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
* | (dividend_ptr[dividend_size - 2] >> ...)))
* ...one division less...
*/
- for( i = dividend_size - 2; i >= 0; i--) {
+ for ( i = dividend_size - 2; i >= 0; i--) {
n0 = dividend_ptr[i];
UDIV_QRNND_PREINV(dummy, r, r,
((n1 << normalization_steps)
@@ -115,7 +115,7 @@ _gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
*
* Special case for DIVISOR_LIMB == 100...000.
*/
- if( !(divisor_limb << 1) )
+ if ( !(divisor_limb << 1) )
divisor_limb_inverted = ~(mpi_limb_t)0;
else
udiv_qrnnd(divisor_limb_inverted, dummy,
@@ -124,12 +124,12 @@ _gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
i = dividend_size - 1;
r = dividend_ptr[i];
- if( r >= divisor_limb )
+ if ( r >= divisor_limb )
r = 0;
else
i--;
- for( ; i >= 0; i--) {
+ for ( ; i >= 0; i--) {
n0 = dividend_ptr[i];
UDIV_QRNND_PREINV(dummy, r, r,
n0, divisor_limb, divisor_limb_inverted);
@@ -138,11 +138,11 @@ _gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
}
}
else {
- if( UDIV_NEEDS_NORMALIZATION ) {
+ if ( UDIV_NEEDS_NORMALIZATION ) {
int normalization_steps;
count_leading_zeros(normalization_steps, divisor_limb);
- if( normalization_steps ) {
+ if ( normalization_steps ) {
divisor_limb <<= normalization_steps;
n1 = dividend_ptr[dividend_size - 1];
@@ -178,7 +178,7 @@ _gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
else
i--;
- for(; i >= 0; i--) {
+ for (; i >= 0; i--) {
n0 = dividend_ptr[i];
udiv_qrnnd (dummy, r, r, n0, divisor_limb);
}
@@ -225,17 +225,17 @@ _gcry_mpih_divrem( mpi_ptr_t qp, mpi_size_t qextra_limbs,
d = dp[0];
n1 = np[nsize - 1];
- if( n1 >= d ) {
+ if ( n1 >= d ) {
n1 -= d;
most_significant_q_limb = 1;
}
qp += qextra_limbs;
- for( i = nsize - 2; i >= 0; i--)
+ for ( i = nsize - 2; i >= 0; i--)
udiv_qrnnd( qp[i], n1, n1, np[i], d );
qp -= qextra_limbs;
- for( i = qextra_limbs - 1; i >= 0; i-- )
+ for ( i = qextra_limbs - 1; i >= 0; i-- )
udiv_qrnnd (qp[i], n1, n1, 0, d);
np[0] = n1;
@@ -254,28 +254,28 @@ _gcry_mpih_divrem( mpi_ptr_t qp, mpi_size_t qextra_limbs,
n1 = np[1];
n0 = np[0];
- if( n1 >= d1 && (n1 > d1 || n0 >= d0) ) {
+ if ( n1 >= d1 && (n1 > d1 || n0 >= d0) ) {
sub_ddmmss (n1, n0, n1, n0, d1, d0);
most_significant_q_limb = 1;
}
- for( i = qextra_limbs + nsize - 2 - 1; i >= 0; i-- ) {
+ for ( i = qextra_limbs + nsize - 2 - 1; i >= 0; i-- ) {
mpi_limb_t q;
mpi_limb_t r;
- if( i >= qextra_limbs )
+ if ( i >= qextra_limbs )
np--;
else
np[0] = 0;
- if( n1 == d1 ) {
+ if ( n1 == d1 ) {
/* Q should be either 111..111 or 111..110. Need special
* treatment of this rare case as normal division would
* give overflow. */
q = ~(mpi_limb_t)0;
r = n0 + d1;
- if( r < d1 ) { /* Carry in the addition? */
+ if ( r < d1 ) { /* Carry in the addition? */
add_ssaaaa( n1, n0, r - d0, np[0], 0, d0 );
qp[i] = q;
continue;
@@ -290,12 +290,12 @@ _gcry_mpih_divrem( mpi_ptr_t qp, mpi_size_t qextra_limbs,
n2 = np[0];
q_test:
- if( n1 > r || (n1 == r && n0 > n2) ) {
+ if ( n1 > r || (n1 == r && n0 > n2) ) {
/* The estimated Q was too large. */
q--;
sub_ddmmss (n1, n0, n1, n0, 0, d0);
r += d1;
- if( r >= d1 ) /* If not carry, test Q again. */
+ if ( r >= d1 ) /* If not carry, test Q again. */
goto q_test;
}
@@ -317,7 +317,7 @@ _gcry_mpih_divrem( mpi_ptr_t qp, mpi_size_t qextra_limbs,
d1 = dp[dsize - 2];
n0 = np[dsize - 1];
- if( n0 >= dX ) {
+ if ( n0 >= dX ) {
if(n0 > dX || _gcry_mpih_cmp(np, dp, dsize - 1) >= 0 ) {
_gcry_mpih_sub_n(np, np, dp, dsize);
n0 = np[dsize - 1];
@@ -325,12 +325,12 @@ _gcry_mpih_divrem( mpi_ptr_t qp, mpi_size_t qextra_limbs,
}
}
- for( i = qextra_limbs + nsize - dsize - 1; i >= 0; i--) {
+ for ( i = qextra_limbs + nsize - dsize - 1; i >= 0; i--) {
mpi_limb_t q;
mpi_limb_t n1, n2;
mpi_limb_t cy_limb;
- if( i >= qextra_limbs ) {
+ if ( i >= qextra_limbs ) {
np--;
n2 = np[dsize];
}
@@ -340,7 +340,7 @@ _gcry_mpih_divrem( mpi_ptr_t qp, mpi_size_t qextra_limbs,
np[0] = 0;
}
- if( n0 == dX ) {
+ if ( n0 == dX ) {
/* This might over-estimate q, but it's probably not worth
* the extra code here to find out. */
q = ~(mpi_limb_t)0;
@@ -354,7 +354,7 @@ _gcry_mpih_divrem( mpi_ptr_t qp, mpi_size_t qextra_limbs,
while( n1 > r || (n1 == r && n0 > np[dsize - 2])) {
q--;
r += dX;
- if( r < dX ) /* I.e. "carry in previous addition?" */
+ if ( r < dX ) /* I.e. "carry in previous addition?" */
break;
n1 -= n0 < d1;
n0 -= d1;
@@ -366,7 +366,7 @@ _gcry_mpih_divrem( mpi_ptr_t qp, mpi_size_t qextra_limbs,
* could make this loop make two iterations less. */
cy_limb = _gcry_mpih_submul_1(np, dp, dsize, q);
- if( n2 != cy_limb ) {
+ if ( n2 != cy_limb ) {
_gcry_mpih_add_n(np, np, dp, dsize);
q--;
}
@@ -399,7 +399,7 @@ _gcry_mpih_divmod_1( mpi_ptr_t quot_ptr,
mpi_limb_t n1, n0, r;
int dummy;
- if( !dividend_size )
+ if ( !dividend_size )
return 0;
/* If multiplication is much faster than division, and the
@@ -410,12 +410,12 @@ _gcry_mpih_divmod_1( mpi_ptr_t quot_ptr,
* Does it ever help to use udiv_qrnnd_preinv?
* && Does what we save compensate for the inversion overhead?
*/
- if( UDIV_TIME > (2 * UMUL_TIME + 6)
+ if ( UDIV_TIME > (2 * UMUL_TIME + 6)
&& (UDIV_TIME - (2 * UMUL_TIME + 6)) * dividend_size > UDIV_TIME ) {
int normalization_steps;
count_leading_zeros( normalization_steps, divisor_limb );
- if( normalization_steps ) {
+ if ( normalization_steps ) {
mpi_limb_t divisor_limb_inverted;
divisor_limb <<= normalization_steps;
@@ -425,7 +425,7 @@ _gcry_mpih_divmod_1( mpi_ptr_t quot_ptr,
* most significant bit (with weight 2**N) implicit.
*/
/* Special case for DIVISOR_LIMB == 100...000. */
- if( !(divisor_limb << 1) )
+ if ( !(divisor_limb << 1) )
divisor_limb_inverted = ~(mpi_limb_t)0;
else
udiv_qrnnd(divisor_limb_inverted, dummy,
@@ -440,7 +440,7 @@ _gcry_mpih_divmod_1( mpi_ptr_t quot_ptr,
* | (dividend_ptr[dividend_size - 2] >> ...)))
* ...one division less...
*/
- for( i = dividend_size - 2; i >= 0; i--) {
+ for ( i = dividend_size - 2; i >= 0; i--) {
n0 = dividend_ptr[i];
UDIV_QRNND_PREINV( quot_ptr[i + 1], r, r,
((n1 << normalization_steps)
@@ -461,7 +461,7 @@ _gcry_mpih_divmod_1( mpi_ptr_t quot_ptr,
* most significant bit (with weight 2**N) implicit.
*/
/* Special case for DIVISOR_LIMB == 100...000. */
- if( !(divisor_limb << 1) )
+ if ( !(divisor_limb << 1) )
divisor_limb_inverted = ~(mpi_limb_t) 0;
else
udiv_qrnnd(divisor_limb_inverted, dummy,
@@ -470,12 +470,12 @@ _gcry_mpih_divmod_1( mpi_ptr_t quot_ptr,
i = dividend_size - 1;
r = dividend_ptr[i];
- if( r >= divisor_limb )
+ if ( r >= divisor_limb )
r = 0;
else
quot_ptr[i--] = 0;
- for( ; i >= 0; i-- ) {
+ for ( ; i >= 0; i-- ) {
n0 = dividend_ptr[i];
UDIV_QRNND_PREINV( quot_ptr[i], r, r,
n0, divisor_limb, divisor_limb_inverted);
@@ -488,7 +488,7 @@ _gcry_mpih_divmod_1( mpi_ptr_t quot_ptr,
int normalization_steps;
count_leading_zeros (normalization_steps, divisor_limb);
- if( normalization_steps ) {
+ if ( normalization_steps ) {
divisor_limb <<= normalization_steps;
n1 = dividend_ptr[dividend_size - 1];
@@ -500,7 +500,7 @@ _gcry_mpih_divmod_1( mpi_ptr_t quot_ptr,
* | (dividend_ptr[dividend_size - 2] >> ...)))
* ...one division less...
*/
- for( i = dividend_size - 2; i >= 0; i--) {
+ for ( i = dividend_size - 2; i >= 0; i--) {
n0 = dividend_ptr[i];
udiv_qrnnd (quot_ptr[i + 1], r, r,
((n1 << normalization_steps)
@@ -524,7 +524,7 @@ _gcry_mpih_divmod_1( mpi_ptr_t quot_ptr,
else
quot_ptr[i--] = 0;
- for(; i >= 0; i--) {
+ for (; i >= 0; i--) {
n0 = dividend_ptr[i];
udiv_qrnnd( quot_ptr[i], r, r, n0, divisor_limb );
}
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpih-mul.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpih-mul.c
index e1f6f58eb5..d412b693fd 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpih-mul.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpih-mul.c
@@ -35,7 +35,7 @@
#define MPN_MUL_N_RECURSE(prodp, up, vp, size, tspace) \
do { \
- if( (size) < KARATSUBA_THRESHOLD ) \
+ if ( (size) < KARATSUBA_THRESHOLD ) \
mul_n_basecase (prodp, up, vp, size); \
else \
mul_n (prodp, up, vp, size, tspace); \
@@ -80,8 +80,8 @@ mul_n_basecase( mpi_ptr_t prodp, mpi_ptr_t up,
/* Multiply by the first limb in V separately, as the result can be
* stored (not added) to PROD. We also avoid a loop for zeroing. */
v_limb = vp[0];
- if( v_limb <= 1 ) {
- if( v_limb == 1 )
+ if ( v_limb <= 1 ) {
+ if ( v_limb == 1 )
MPN_COPY( prodp, up, size );
else
MPN_ZERO( prodp, size );
@@ -95,11 +95,11 @@ mul_n_basecase( mpi_ptr_t prodp, mpi_ptr_t up,
/* For each iteration in the outer loop, multiply one limb from
* U with one limb from V, and add it to PROD. */
- for( i = 1; i < size; i++ ) {
+ for ( i = 1; i < size; i++ ) {
v_limb = vp[i];
- if( v_limb <= 1 ) {
+ if ( v_limb <= 1 ) {
cy = 0;
- if( v_limb == 1 )
+ if ( v_limb == 1 )
cy = _gcry_mpih_add_n(prodp, prodp, up, size);
}
else
@@ -117,7 +117,7 @@ static void
mul_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp,
mpi_size_t size, mpi_ptr_t tspace )
{
- if( size & 1 ) {
+ if ( size & 1 ) {
/* The size is odd, and the code below doesn't handle that.
* Multiply the least significant (size - 1) limbs with a recursive
* call, and handle the most significant limb of S1 and S2
@@ -167,7 +167,7 @@ mul_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp,
/* Product M. ________________
* |_(U1-U0)(V0-V1)_|
*/
- if( _gcry_mpih_cmp(up + hsize, up, hsize) >= 0 ) {
+ if ( _gcry_mpih_cmp(up + hsize, up, hsize) >= 0 ) {
_gcry_mpih_sub_n(prodp, up + hsize, up, hsize);
negflg = 0;
}
@@ -175,7 +175,7 @@ mul_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp,
_gcry_mpih_sub_n(prodp, up, up + hsize, hsize);
negflg = 1;
}
- if( _gcry_mpih_cmp(vp + hsize, vp, hsize) >= 0 ) {
+ if ( _gcry_mpih_cmp(vp + hsize, vp, hsize) >= 0 ) {
_gcry_mpih_sub_n(prodp + hsize, vp + hsize, vp, hsize);
negflg ^= 1;
}
@@ -211,12 +211,12 @@ mul_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp,
/* Add/copy Product L (twice) */
cy += _gcry_mpih_add_n(prodp + hsize, prodp + hsize, tspace, size);
- if( cy )
+ if ( cy )
_gcry_mpih_add_1(prodp + hsize + size, prodp + hsize + size, hsize, cy);
MPN_COPY(prodp, tspace, hsize);
cy = _gcry_mpih_add_n(prodp + hsize, prodp + hsize, tspace + hsize, hsize);
- if( cy )
+ if ( cy )
_gcry_mpih_add_1(prodp + size, prodp + size, size, 1);
}
}
@@ -232,8 +232,8 @@ _gcry_mpih_sqr_n_basecase( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size )
/* Multiply by the first limb in V separately, as the result can be
* stored (not added) to PROD. We also avoid a loop for zeroing. */
v_limb = up[0];
- if( v_limb <= 1 ) {
- if( v_limb == 1 )
+ if ( v_limb <= 1 ) {
+ if ( v_limb == 1 )
MPN_COPY( prodp, up, size );
else
MPN_ZERO(prodp, size);
@@ -247,11 +247,11 @@ _gcry_mpih_sqr_n_basecase( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size )
/* For each iteration in the outer loop, multiply one limb from
* U with one limb from V, and add it to PROD. */
- for( i=1; i < size; i++) {
+ for ( i=1; i < size; i++) {
v_limb = up[i];
- if( v_limb <= 1 ) {
+ if ( v_limb <= 1 ) {
cy_limb = 0;
- if( v_limb == 1 )
+ if ( v_limb == 1 )
cy_limb = _gcry_mpih_add_n(prodp, prodp, up, size);
}
else
@@ -267,7 +267,7 @@ void
_gcry_mpih_sqr_n( mpi_ptr_t prodp,
mpi_ptr_t up, mpi_size_t size, mpi_ptr_t tspace)
{
- if( size & 1 ) {
+ if ( size & 1 ) {
/* The size is odd, and the code below doesn't handle that.
* Multiply the least significant (size - 1) limbs with a recursive
* call, and handle the most significant limb of S1 and S2
@@ -302,7 +302,7 @@ _gcry_mpih_sqr_n( mpi_ptr_t prodp,
/* Product M. ________________
* |_(U1-U0)(U0-U1)_|
*/
- if( _gcry_mpih_cmp( up + hsize, up, hsize) >= 0 )
+ if ( _gcry_mpih_cmp( up + hsize, up, hsize) >= 0 )
_gcry_mpih_sub_n( prodp, up + hsize, up, hsize);
else
_gcry_mpih_sub_n (prodp, up, up + hsize, hsize);
@@ -329,13 +329,13 @@ _gcry_mpih_sqr_n( mpi_ptr_t prodp,
/* Add/copy Product L (twice). */
cy += _gcry_mpih_add_n (prodp + hsize, prodp + hsize, tspace, size);
- if( cy )
+ if ( cy )
_gcry_mpih_add_1(prodp + hsize + size, prodp + hsize + size,
hsize, cy);
MPN_COPY(prodp, tspace, hsize);
cy = _gcry_mpih_add_n (prodp + hsize, prodp + hsize, tspace + hsize, hsize);
- if( cy )
+ if ( cy )
_gcry_mpih_add_1 (prodp + size, prodp + size, size, 1);
}
}
@@ -348,8 +348,8 @@ _gcry_mpih_mul_n( mpi_ptr_t prodp,
{
int secure;
- if( up == vp ) {
- if( size < KARATSUBA_THRESHOLD )
+ if ( up == vp ) {
+ if ( size < KARATSUBA_THRESHOLD )
_gcry_mpih_sqr_n_basecase( prodp, up, size );
else {
mpi_ptr_t tspace;
@@ -360,7 +360,7 @@ _gcry_mpih_mul_n( mpi_ptr_t prodp,
}
}
else {
- if( size < KARATSUBA_THRESHOLD )
+ if ( size < KARATSUBA_THRESHOLD )
mul_n_basecase( prodp, up, vp, size );
else {
mpi_ptr_t tspace;
@@ -382,8 +382,8 @@ _gcry_mpih_mul_karatsuba_case( mpi_ptr_t prodp,
{
mpi_limb_t cy;
- if( !ctx->tspace || ctx->tspace_size < vsize ) {
- if( ctx->tspace )
+ if ( !ctx->tspace || ctx->tspace_size < vsize ) {
+ if ( ctx->tspace )
_gcry_mpi_free_limb_space( ctx->tspace, ctx->tspace_nlimbs );
ctx->tspace_nlimbs = 2 * vsize;
ctx->tspace = mpi_alloc_limb_space( 2 * vsize,
@@ -397,9 +397,9 @@ _gcry_mpih_mul_karatsuba_case( mpi_ptr_t prodp,
prodp += vsize;
up += vsize;
usize -= vsize;
- if( usize >= vsize ) {
- if( !ctx->tp || ctx->tp_size < vsize ) {
- if( ctx->tp )
+ if ( usize >= vsize ) {
+ if ( !ctx->tp || ctx->tp_size < vsize ) {
+ if ( ctx->tp )
_gcry_mpi_free_limb_space( ctx->tp, ctx->tp_nlimbs );
ctx->tp_nlimbs = 2 * vsize;
ctx->tp = mpi_alloc_limb_space( 2 * vsize, gcry_is_secure( up )
@@ -417,12 +417,12 @@ _gcry_mpih_mul_karatsuba_case( mpi_ptr_t prodp,
} while( usize >= vsize );
}
- if( usize ) {
- if( usize < KARATSUBA_THRESHOLD ) {
+ if ( usize ) {
+ if ( usize < KARATSUBA_THRESHOLD ) {
_gcry_mpih_mul( ctx->tspace, vp, vsize, up, usize );
}
else {
- if( !ctx->next ) {
+ if ( !ctx->next ) {
ctx->next = gcry_xcalloc( 1, sizeof *ctx );
}
_gcry_mpih_mul_karatsuba_case( ctx->tspace,
@@ -442,15 +442,15 @@ _gcry_mpih_release_karatsuba_ctx( struct karatsuba_ctx *ctx )
{
struct karatsuba_ctx *ctx2;
- if( ctx->tp )
+ if ( ctx->tp )
_gcry_mpi_free_limb_space( ctx->tp, ctx->tp_nlimbs );
- if( ctx->tspace )
+ if ( ctx->tspace )
_gcry_mpi_free_limb_space( ctx->tspace, ctx->tspace_nlimbs );
- for( ctx=ctx->next; ctx; ctx = ctx2 ) {
+ for ( ctx=ctx->next; ctx; ctx = ctx2 ) {
ctx2 = ctx->next;
- if( ctx->tp )
+ if ( ctx->tp )
_gcry_mpi_free_limb_space( ctx->tp, ctx->tp_nlimbs );
- if( ctx->tspace )
+ if ( ctx->tspace )
_gcry_mpi_free_limb_space( ctx->tspace, ctx->tspace_nlimbs );
gcry_free( ctx );
}
@@ -479,18 +479,18 @@ _gcry_mpih_mul( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t usize,
mpi_limb_t cy;
struct karatsuba_ctx ctx;
- if( vsize < KARATSUBA_THRESHOLD ) {
+ if ( vsize < KARATSUBA_THRESHOLD ) {
mpi_size_t i;
mpi_limb_t v_limb;
- if( !vsize )
+ if ( !vsize )
return 0;
/* Multiply by the first limb in V separately, as the result can be
* stored (not added) to PROD. We also avoid a loop for zeroing. */
v_limb = vp[0];
- if( v_limb <= 1 ) {
- if( v_limb == 1 )
+ if ( v_limb <= 1 ) {
+ if ( v_limb == 1 )
MPN_COPY( prodp, up, usize );
else
MPN_ZERO( prodp, usize );
@@ -504,11 +504,11 @@ _gcry_mpih_mul( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t usize,
/* For each iteration in the outer loop, multiply one limb from
* U with one limb from V, and add it to PROD. */
- for( i = 1; i < vsize; i++ ) {
+ for ( i = 1; i < vsize; i++ ) {
v_limb = vp[i];
- if( v_limb <= 1 ) {
+ if ( v_limb <= 1 ) {
cy = 0;
- if( v_limb == 1 )
+ if ( v_limb == 1 )
cy = _gcry_mpih_add_n(prodp, prodp, up, usize);
}
else
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpiutil.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpiutil.c
index 4dc5211360..dcff1e8a0a 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpiutil.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpiutil.c
@@ -211,7 +211,7 @@ gcry_mpi_set_opaque( gcry_mpi_t a, void *p, unsigned int nbits )
if (!a)
a = mpi_alloc(0);
- if( a->flags & 4 )
+ if ( a->flags & 4 )
gcry_free( a->d );
else
_gcry_mpi_free_limb_space (a->d, a->alloced);
@@ -228,9 +228,9 @@ gcry_mpi_set_opaque( gcry_mpi_t a, void *p, unsigned int nbits )
void *
gcry_mpi_get_opaque( gcry_mpi_t a, unsigned int *nbits )
{
- if( !(a->flags & 4) )
+ if ( !(a->flags & 4) )
log_bug("mpi_get_opaque on normal mpi\n");
- if( nbits )
+ if ( nbits )
*nbits = a->sign;
return a->d;
}
@@ -246,13 +246,13 @@ gcry_mpi_copy( gcry_mpi_t a )
int i;
gcry_mpi_t b;
- if( a && (a->flags & 4) ) {
+ if ( a && (a->flags & 4) ) {
void *p = gcry_is_secure(a->d)? gcry_xmalloc_secure( (a->sign+7)/8 )
: gcry_xmalloc( (a->sign+7)/8 );
memcpy( p, a->d, (a->sign+7)/8 );
b = gcry_mpi_set_opaque( NULL, p, a->sign );
}
- else if( a ) {
+ else if ( a ) {
b = mpi_is_secure(a)? mpi_alloc_secure( a->nlimbs )
: mpi_alloc( a->nlimbs );
b->nlimbs = a->nlimbs;
@@ -277,14 +277,14 @@ _gcry_mpi_alloc_like( gcry_mpi_t a )
{
gcry_mpi_t b;
- if( a && (a->flags & 4) ) {
+ if ( a && (a->flags & 4) ) {
int n = (a->sign+7)/8;
void *p = gcry_is_secure(a->d)? gcry_malloc_secure( n )
: gcry_malloc( n );
memcpy( p, a->d, n );
b = gcry_mpi_set_opaque( NULL, p, a->sign );
}
- else if( a ) {
+ else if ( a ) {
b = mpi_is_secure(a)? mpi_alloc_secure( a->nlimbs )
: mpi_alloc( a->nlimbs );
b->nlimbs = 0;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/random/random-csprng.c b/plugins/MirOTR/libgcrypt-1.4.6/random/random-csprng.c
index 6ab868ae37..16fe9db998 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/random/random-csprng.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/random/random-csprng.c
@@ -747,7 +747,7 @@ read_seed_file (void)
#else
fd = open( seed_file_name, O_RDONLY );
#endif
- if( fd == -1 && errno == ENOENT)
+ if ( fd == -1 && errno == ENOENT)
{
allow_seed_file_update = 1;
return 0;
@@ -972,7 +972,7 @@ read_pool (byte *buffer, size_t length, int level)
needed = length - pool_balance;
if (needed < POOLSIZE/2)
needed = POOLSIZE/2;
- else if( needed > POOLSIZE )
+ else if ( needed > POOLSIZE )
BUG ();
read_random_source (RANDOM_ORIGIN_EXTRAPOLL, needed,
GCRY_VERY_STRONG_RANDOM);
@@ -1183,14 +1183,14 @@ do_fast_random_poll (void)
#elif HAVE_GETTIMEOFDAY
{
struct timeval tv;
- if( gettimeofday( &tv, NULL ) )
+ if ( gettimeofday( &tv, NULL ) )
BUG();
add_randomness( &tv.tv_sec, sizeof(tv.tv_sec), RANDOM_ORIGIN_FASTPOLL );
add_randomness( &tv.tv_usec, sizeof(tv.tv_usec), RANDOM_ORIGIN_FASTPOLL );
}
#elif HAVE_CLOCK_GETTIME
{ struct timespec tv;
- if( clock_gettime( CLOCK_REALTIME, &tv ) == -1 )
+ if ( clock_gettime( CLOCK_REALTIME, &tv ) == -1 )
BUG();
add_randomness( &tv.tv_sec, sizeof(tv.tv_sec), RANDOM_ORIGIN_FASTPOLL );
add_randomness( &tv.tv_nsec, sizeof(tv.tv_nsec), RANDOM_ORIGIN_FASTPOLL );
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/random/rndegd.c b/plugins/MirOTR/libgcrypt-1.4.6/random/rndegd.c
index 63a5e0f162..ba82a52616 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/random/rndegd.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/random/rndegd.c
@@ -58,7 +58,7 @@ my_make_filename (const char *first_part, const char *second_part)
n += strlen (second_part) + 1;
home = NULL;
- if( *first_part == '~' && first_part[1] == '/'
+ if ( *first_part == '~' && first_part[1] == '/'
&& (home = getenv("HOME")) && *home )
n += strlen(home);
@@ -83,9 +83,9 @@ do_write( int fd, void *buf, size_t nbytes )
while( nleft > 0 )
{
nwritten = write( fd, buf, nleft);
- if( nwritten < 0 )
+ if ( nwritten < 0 )
{
- if( errno == EINTR )
+ if ( errno == EINTR )
continue;
return -1;
}
@@ -107,9 +107,9 @@ do_read( int fd, void *buf, size_t nbytes )
n = read(fd, (char*)buf + nread, nbytes );
}
while( n == -1 && errno == EINTR );
- if( n == -1)
+ if ( n == -1)
return nread? nread:-1;
- if( n == 0)
+ if ( n == 0)
return -1;
nread += n;
nbytes -= n;
@@ -221,9 +221,9 @@ _gcry_rndegd_gather_random (void (*add)(const void*, size_t,
int nbytes;
int do_restart = 0;
- if( !length )
+ if ( !length )
return 0;
- if( !level )
+ if ( !level )
return 0;
restart:
@@ -236,20 +236,20 @@ _gcry_rndegd_gather_random (void (*add)(const void*, size_t,
/* First time we do it with a non blocking request */
buffer[0] = 1; /* non blocking */
buffer[1] = nbytes;
- if( do_write( fd, buffer, 2 ) == -1 )
+ if ( do_write( fd, buffer, 2 ) == -1 )
log_fatal("can't write to the EGD: %s\n", strerror(errno) );
n = do_read( fd, buffer, 1 );
- if( n == -1 )
+ if ( n == -1 )
{
log_error("read error on EGD: %s\n", strerror(errno));
do_restart = 1;
goto restart;
}
n = buffer[0];
- if( n )
+ if ( n )
{
n = do_read( fd, buffer, n );
- if( n == -1 )
+ if ( n == -1 )
{
log_error("read error on EGD: %s\n", strerror(errno));
do_restart = 1;
@@ -259,7 +259,7 @@ _gcry_rndegd_gather_random (void (*add)(const void*, size_t,
length -= n;
}
- if( length )
+ if ( length )
{
log_info (
_("Please wait, entropy is being gathered. Do some work if it would\n"
@@ -272,10 +272,10 @@ _gcry_rndegd_gather_random (void (*add)(const void*, size_t,
buffer[0] = 2; /* blocking */
buffer[1] = nbytes;
- if( do_write( fd, buffer, 2 ) == -1 )
+ if ( do_write( fd, buffer, 2 ) == -1 )
log_fatal("can't write to the EGD: %s\n", strerror(errno) );
n = do_read( fd, buffer, nbytes );
- if( n == -1 )
+ if ( n == -1 )
{
log_error("read error on EGD: %s\n", strerror(errno));
do_restart = 1;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/random/rndlinux.c b/plugins/MirOTR/libgcrypt-1.4.6/random/rndlinux.c
index 574ef6dcc0..aca72011ea 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/random/rndlinux.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/random/rndlinux.c
@@ -74,9 +74,9 @@ open_device ( const char *name )
struct stat sb;
- if( fstat( fd, &sb ) )
+ if ( fstat( fd, &sb ) )
log_fatal("stat() off %s failed: %s\n", name, strerror(errno) );
- if( (!S_ISCHR(sb.st_mode)) && (!S_ISFIFO(sb.st_mode)) )
+ if ( (!S_ISCHR(sb.st_mode)) && (!S_ISFIFO(sb.st_mode)) )
log_fatal("invalid random device!\n" );
*/
return fd;
@@ -108,13 +108,13 @@ _gcry_rndlinux_gather_random (void (*add)(const void*, size_t,
/* Open the requested device. */
if (level >= 2)
{
- if( fd_random == -1 )
+ if ( fd_random == -1 )
fd_random = open_device ( NAME_OF_DEV_RANDOM );
fd = fd_random;
}
else
{
- if( fd_urandom == -1 )
+ if ( fd_urandom == -1 )
fd_urandom = open_device ( NAME_OF_DEV_URANDOM );
fd = fd_urandom;
}
@@ -130,16 +130,16 @@ _gcry_rndlinux_gather_random (void (*add)(const void*, size_t,
FD_SET(fd, &rfds);
tv.tv_sec = 3;
tv.tv_usec = 0;
- if( !(rc=select(fd+1, &rfds, NULL, NULL, &tv)) )
+ if ( !(rc=select(fd+1, &rfds, NULL, NULL, &tv)) )
{
- if( !warn )
+ if ( !warn )
{
_gcry_random_progress ("need_entropy", 'X', 0, (int)length);
warn = 1;
}
continue;
}
- else if( rc == -1 )
+ else if ( rc == -1 )
{
log_error ("select() error: %s\n", strerror(errno));
continue;
@@ -149,14 +149,14 @@ _gcry_rndlinux_gather_random (void (*add)(const void*, size_t,
{
int nbytes = length < sizeof(buffer)? length : sizeof(buffer);
n = read(fd, buffer, nbytes );
- if( n >= 0 && n > nbytes )
+ if ( n >= 0 && n > nbytes )
{
log_error("bogus read from random device (n=%d)\n", n );
n = nbytes;
}
}
while( n == -1 && errno == EINTR );
- if( n == -1 )
+ if ( n == -1 )
log_fatal("read error on random device: %s\n", strerror(errno));
(*add)( buffer, n, origin );
length -= n;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/random/rndunix.c b/plugins/MirOTR/libgcrypt-1.4.6/random/rndunix.c
index 1faf9abc0e..8f5d30a9ac 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/random/rndunix.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/random/rndunix.c
@@ -529,7 +529,7 @@ slow_poll(FILE *dbgfp, int dbgall, size_t *nbytes )
/* Since popen() is a fairly heavy function, we check to see whether
* the executable exists before we try to run it */
if (access(dataSources[i].path, X_OK)) {
- if( dbgfp && dbgall )
+ if ( dbgfp && dbgall )
fprintf(dbgfp, "%s not present%s\n", dataSources[i].path,
dataSources[i].hasAlternative ?
", has alternatives" : "");
@@ -555,7 +555,7 @@ slow_poll(FILE *dbgfp, int dbgall, size_t *nbytes )
/* If there are alternatives for this command, don't try and
* execute them */
while (dataSources[i].hasAlternative) {
- if( dbgfp && dbgall )
+ if ( dbgfp && dbgall )
fprintf(dbgfp, "Skipping %s\n", dataSources[i + 1].path);
i++;
}
@@ -584,7 +584,7 @@ slow_poll(FILE *dbgfp, int dbgall, size_t *nbytes )
/* One of the sources has data available, read it into the buffer */
for (i = 0; dataSources[i].path != NULL; i++) {
- if( dataSources[i].pipe && FD_ISSET(dataSources[i].pipeFD, &fds)) {
+ if ( dataSources[i].pipe && FD_ISSET(dataSources[i].pipeFD, &fds)) {
size_t noBytes;
if ((noBytes = fread(gather_buffer + bufPos, 1,
@@ -603,14 +603,14 @@ slow_poll(FILE *dbgfp, int dbgall, size_t *nbytes )
total = dataSources[i].length
/ dataSources[i].usefulness;
}
- if( dbgfp )
+ if ( dbgfp )
fprintf(dbgfp,
"%s %s contributed %d bytes, "
"usefulness = %d\n", dataSources[i].path,
(dataSources[i].arg != NULL) ?
dataSources[i].arg : "",
dataSources[i].length, total);
- if( dataSources[i].length )
+ if ( dataSources[i].length )
usefulness += total;
}
dataSources[i].pipe = NULL;
@@ -661,7 +661,7 @@ slow_poll(FILE *dbgfp, int dbgall, size_t *nbytes )
}
}
- if( dbgfp ) {
+ if ( dbgfp ) {
fprintf(dbgfp, "Got %d bytes, usefulness = %d\n", bufPos, usefulness);
fflush(dbgfp);
}
@@ -681,9 +681,9 @@ start_gatherer( int pipefd )
{
const char *s = getenv("GNUPG_RNDUNIX_DBG");
- if( s ) {
+ if ( s ) {
dbgfp = (*s=='-' && !s[1])? stdout : fopen(s, "a");
- if( !dbgfp )
+ if ( !dbgfp )
log_info("can't open debug file `%s': %s\n",
s, strerror(errno) );
else
@@ -694,7 +694,7 @@ start_gatherer( int pipefd )
/* close all files but the ones we need */
{ int nmax, n1, n2, i;
#ifdef _SC_OPEN_MAX
- if( (nmax=sysconf( _SC_OPEN_MAX )) < 0 ) {
+ if ( (nmax=sysconf( _SC_OPEN_MAX )) < 0 ) {
#ifdef _POSIX_OPEN_MAX
nmax = _POSIX_OPEN_MAX;
#else
@@ -707,7 +707,7 @@ start_gatherer( int pipefd )
n1 = fileno( stderr );
n2 = dbgfp? fileno( dbgfp ) : -1;
for(i=0; i < nmax; i++ ) {
- if( i != n1 && i != n2 && i != pipefd )
+ if ( i != n1 && i != n2 && i != pipefd )
close(i);
}
errno = 0;
@@ -717,7 +717,7 @@ start_gatherer( int pipefd )
/* Set up the buffer. Not ethat we use a plain standard malloc here. */
gather_buffer_size = GATHER_BUFSIZE;
gather_buffer = malloc( gather_buffer_size );
- if( !gather_buffer ) {
+ if ( !gather_buffer ) {
log_error("out of core while allocating the gatherer buffer\n");
exit(2);
}
@@ -738,7 +738,7 @@ start_gatherer( int pipefd )
fclose(stderr); /* Arrghh!! It's Stuart code!! */
- for(;;) {
+ for (;;) {
GATHER_MSG msg;
size_t nbytes;
const char *p;
@@ -752,20 +752,20 @@ start_gatherer( int pipefd )
p += msg.ndata;
while( write( pipefd, &msg, sizeof(msg) ) != sizeof(msg) ) {
- if( errno == EINTR )
+ if ( errno == EINTR )
continue;
- if( errno == EAGAIN ) {
+ if ( errno == EAGAIN ) {
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 50000;
select(0, NULL, NULL, NULL, &tv);
continue;
}
- if( errno == EPIPE ) /* parent has exited, so give up */
+ if ( errno == EPIPE ) /* parent has exited, so give up */
exit(0);
/* we can't do very much here because stderr is closed */
- if( dbgfp )
+ if ( dbgfp )
fprintf(dbgfp, "gatherer can't write to pipe: %s\n",
strerror(errno) );
/* we start a new poll to give the system some time */
@@ -789,7 +789,7 @@ read_a_msg( int fd, GATHER_MSG *msg )
do {
n = read(fd, buffer, length );
} while( n == -1 && errno == EINTR );
- if( n == -1 )
+ if ( n == -1 )
return -1;
buffer += n;
length -= n;
@@ -813,24 +813,24 @@ _gcry_rndunix_gather_random (void (*add)(const void*, size_t,
GATHER_MSG msg;
size_t n;
- if( !level )
+ if ( !level )
return 0;
- if( !gatherer_pid ) {
+ if ( !gatherer_pid ) {
/* Make sure we are not setuid. */
if ( getuid() != geteuid() )
BUG();
/* time to start the gatherer process */
- if( pipe( pipedes ) ) {
+ if ( pipe( pipedes ) ) {
log_error("pipe() failed: %s\n", strerror(errno));
return -1;
}
gatherer_pid = fork();
- if( gatherer_pid == -1 ) {
+ if ( gatherer_pid == -1 ) {
log_error("can't for gatherer process: %s\n", strerror(errno));
return -1;
}
- if( !gatherer_pid ) {
+ if ( !gatherer_pid ) {
start_gatherer( pipedes[1] );
/* oops, can't happen */
return -1;
@@ -842,23 +842,23 @@ _gcry_rndunix_gather_random (void (*add)(const void*, size_t,
int goodness;
ulong subtract;
- if( read_a_msg( pipedes[0], &msg ) ) {
+ if ( read_a_msg( pipedes[0], &msg ) ) {
log_error("reading from gatherer pipe failed: %s\n",
strerror(errno));
return -1;
}
- if( level > 1 ) {
- if( msg.usefulness > 30 )
+ if ( level > 1 ) {
+ if ( msg.usefulness > 30 )
goodness = 100;
else if ( msg.usefulness )
goodness = msg.usefulness * 100 / 30;
else
goodness = 0;
}
- else if( level ) {
- if( msg.usefulness > 15 )
+ else if ( level ) {
+ if ( msg.usefulness > 15 )
goodness = 100;
else if ( msg.usefulness )
goodness = msg.usefulness * 100 / 15;
@@ -869,7 +869,7 @@ _gcry_rndunix_gather_random (void (*add)(const void*, size_t,
goodness = 100; /* goodness of level 0 is always 100 % */
n = msg.ndata;
- if( n > length )
+ if ( n > length )
n = length;
(*add)( msg.data, n, origin );
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/src/gcrypt.h b/plugins/MirOTR/libgcrypt-1.4.6/src/gcrypt.h
index 08112a7610..9e624d3572 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/src/gcrypt.h
+++ b/plugins/MirOTR/libgcrypt-1.4.6/src/gcrypt.h
@@ -1199,7 +1199,7 @@ void gcry_md_debug (gcry_md_hd_t hd, const char *suffix);
#define gcry_md_putc(h,c) \
do { \
gcry_md_hd_t h__ = (h); \
- if( (h__)->bufpos == (h__)->bufsize ) \
+ if ( (h__)->bufpos == (h__)->bufsize ) \
gcry_md_write( (h__), NULL, 0 ); \
(h__)->buf[(h__)->bufpos++] = (c) & 0xff; \
} while(0)
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/src/gcryptrnd.c b/plugins/MirOTR/libgcrypt-1.4.6/src/gcryptrnd.c
index e15fecaf35..8aa3568837 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/src/gcryptrnd.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/src/gcryptrnd.c
@@ -202,7 +202,7 @@ disable_core_dumps (void)
if (getrlimit (RLIMIT_CORE, &limit))
limit.rlim_max = 0;
limit.rlim_cur = 0;
- if( !setrlimit (RLIMIT_CORE, &limit) )
+ if ( !setrlimit (RLIMIT_CORE, &limit) )
return 0;
if (errno != EINVAL && errno != ENOSYS)
logit (LOG_ERR, "can't disable core dumps: %s\n", strerror (errno));
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/src/global.c b/plugins/MirOTR/libgcrypt-1.4.6/src/global.c
index a69513e7d5..7c73f14a99 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/src/global.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/src/global.c
@@ -167,7 +167,7 @@ parse_version_number( const char *s, int *number )
{
int val = 0;
- if( *s == '0' && isdigit(s[1]) )
+ if ( *s == '0' && isdigit(s[1]) )
return NULL; /* leading zeros are not allowed */
for ( ; isdigit(*s); s++ ) {
val *= 10;
@@ -190,15 +190,15 @@ static const char *
parse_version_string( const char *s, int *major, int *minor, int *micro )
{
s = parse_version_number( s, major );
- if( !s || *s != '.' )
+ if ( !s || *s != '.' )
return NULL;
s++;
s = parse_version_number( s, minor );
- if( !s || *s != '.' )
+ if ( !s || *s != '.' )
return NULL;
s++;
s = parse_version_number( s, micro );
- if( !s )
+ if ( !s )
return NULL;
return s; /* patchlevel */
}
@@ -788,7 +788,7 @@ _gcry_check_heap( const void *a )
/* FIXME: implement this*/
#if 0
- if( some_handler )
+ if ( some_handler )
some_handler(a)
else
_gcry_private_check_heap(a)
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/src/misc.c b/plugins/MirOTR/libgcrypt-1.4.6/src/misc.c
index fcad8d4e3b..0146c61273 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/src/misc.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/src/misc.c
@@ -48,7 +48,7 @@ gcry_set_gettext_handler( const char *(*f)(const char*) )
const char *
_gcry_gettext( const char *key )
{
- if( user_gettext_handler )
+ if ( user_gettext_handler )
return user_gettext_handler( key );
/* FIXME: switch the domain to gnupg and restore later */
return key;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/src/missing-string.c b/plugins/MirOTR/libgcrypt-1.4.6/src/missing-string.c
index a5e56c3f76..c5f4c83f70 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/src/missing-string.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/src/missing-string.c
@@ -45,8 +45,8 @@ stpcpy(char *a,const char *b)
int
strcasecmp( const char *a, const char *b )
{
- for( ; *a && *b; a++, b++ ) {
- if( *a != *b && toupper(*a) != toupper(*b) )
+ for ( ; *a && *b; a++, b++ ) {
+ if ( *a != *b && toupper(*a) != toupper(*b) )
break;
}
return *(const byte*)a - *(const byte*)b;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/src/sexp.c b/plugins/MirOTR/libgcrypt-1.4.6/src/sexp.c
index e11f86ec0a..865e7d7a88 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/src/sexp.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/src/sexp.c
@@ -84,9 +84,9 @@ dump_mpi( gcry_mpi_t a )
char buffer[1000];
size_t n = 1000;
- if( !a )
+ if ( !a )
fputs("[no MPI]", stderr );
- else if( gcry_mpi_print( GCRYMPI_FMT_HEX, buffer, &n, a ) )
+ else if ( gcry_mpi_print( GCRYMPI_FMT_HEX, buffer, &n, a ) )
fputs("[MPI too large to print]", stderr );
else
fputs( buffer, stderr );
@@ -100,17 +100,17 @@ dump_string (const byte *p, size_t n, int delim )
{
if ((*p & 0x80) || iscntrl( *p ) || *p == delim )
{
- if( *p == '\n' )
+ if ( *p == '\n' )
log_printf ("\\n");
- else if( *p == '\r' )
+ else if ( *p == '\r' )
log_printf ("\\r");
- else if( *p == '\f' )
+ else if ( *p == '\f' )
log_printf ("\\f");
- else if( *p == '\v' )
+ else if ( *p == '\v' )
log_printf ("\\v");
- else if( *p == '\b' )
+ else if ( *p == '\b' )
log_printf ("\\b");
- else if( !*p )
+ else if ( !*p )
log_printf ("\\0");
else
log_printf ("\\x%02x", *p );
@@ -145,7 +145,7 @@ gcry_sexp_dump (const gcry_sexp_t a)
indent++;
break;
case ST_CLOSE:
- if( indent )
+ if ( indent )
indent--;
log_printf ("%*s[close]\n", 2*indent, "");
break;
@@ -831,19 +831,19 @@ hextobyte( const byte *s )
{
int c=0;
- if( *s >= '0' && *s <= '9' )
+ if ( *s >= '0' && *s <= '9' )
c = 16 * (*s - '0');
- else if( *s >= 'A' && *s <= 'F' )
+ else if ( *s >= 'A' && *s <= 'F' )
c = 16 * (10 + *s - 'A');
- else if( *s >= 'a' && *s <= 'f' ) {
+ else if ( *s >= 'a' && *s <= 'f' ) {
c = 16 * (10 + *s - 'a');
}
s++;
- if( *s >= '0' && *s <= '9' )
+ if ( *s >= '0' && *s <= '9' )
c += *s - '0';
- else if( *s >= 'A' && *s <= 'F' )
+ else if ( *s >= 'A' && *s <= 'F' )
c += 10 + *s - 'A';
- else if( *s >= 'a' && *s <= 'f' ) {
+ else if ( *s >= 'a' && *s <= 'f' ) {
c += 10 + *s - 'a';
}
return c;
@@ -942,7 +942,7 @@ unquote_string (const char *string, size_t length, unsigned char *buf)
}
esc = 0;
}
- else if( *s == '\\' )
+ else if ( *s == '\\' )
esc = 1;
else
*d++ = *s;
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/src/stdmem.c b/plugins/MirOTR/libgcrypt-1.4.6/src/stdmem.c
index bb8adeabec..14a7691563 100644
--- a/plugins/MirOTR/libgcrypt-1.4.6/src/stdmem.c
+++ b/plugins/MirOTR/libgcrypt-1.4.6/src/stdmem.c
@@ -160,7 +160,7 @@ _gcry_private_realloc ( void *a, size_t n )
len = p[-4];
len |= p[-3] << 8;
len |= p[-2] << 16;
- if( len >= n ) /* We don't shrink for now. */
+ if ( len >= n ) /* We don't shrink for now. */
return a;
if (p[-1] == MAGIC_SEC_BYTE)
b = _gcry_private_malloc_secure(n);
diff --git a/plugins/MirOTR/libgpg-error-1.9/src/w32-gettext.c b/plugins/MirOTR/libgpg-error-1.9/src/w32-gettext.c
index da07a25695..f1c74fedc9 100644
--- a/plugins/MirOTR/libgpg-error-1.9/src/w32-gettext.c
+++ b/plugins/MirOTR/libgpg-error-1.9/src/w32-gettext.c
@@ -1467,7 +1467,7 @@ _gpg_w32_bindtextdomain (const char *domainname, const char *dirname)
}
strcpy (item->name, domainname);
item->dname = jnlib_malloc (strlen (dirname) +1);
- if(!item->dname)
+ if (!item->dname)
{
jnlib_free (item);
jnlib_free (fname);
diff --git a/plugins/MirOTR/libotr-3.2.0/src/proto.c b/plugins/MirOTR/libotr-3.2.0/src/proto.c
index 9f76455a9f..75782d6a63 100644
--- a/plugins/MirOTR/libotr-3.2.0/src/proto.c
+++ b/plugins/MirOTR/libotr-3.2.0/src/proto.c
@@ -259,7 +259,7 @@ unsigned int otrl_proto_query_bestversion(const char *querymsg,
++otrtag;
}
if (*otrtag == 'v') {
- for(++otrtag; *otrtag && *otrtag != '?'; ++otrtag) {
+ for (++otrtag; *otrtag && *otrtag != '?'; ++otrtag) {
switch(*otrtag) {
case '2':
query_versions |= (1<<1);
@@ -840,7 +840,7 @@ gcry_error_t otrl_proto_fragment_create(int mms, int fragment_count,
int headerlen = 19; /* Should vary by number of msgs */
char **fragmentarray = malloc(fragment_count * sizeof(char*));
- if(!fragmentarray) return gcry_error(GPG_ERR_ENOMEM);
+ if (!fragmentarray) return gcry_error(GPG_ERR_ENOMEM);
/*
* Find the next message fragment and store it in the array.
@@ -855,7 +855,7 @@ gcry_error_t otrl_proto_fragment_create(int mms, int fragment_count,
fragdatalen = mms - headerlen;
}
fragdata = malloc(fragdatalen + 1);
- if(!fragdata) {
+ if (!fragdata) {
for (i=0; i<curfrag-1; free(fragmentarray[i++])) {}
free(fragmentarray);
return gcry_error(GPG_ERR_ENOMEM);
@@ -864,7 +864,7 @@ gcry_error_t otrl_proto_fragment_create(int mms, int fragment_count,
fragdata[fragdatalen] = 0;
fragmentmsg = malloc(fragdatalen+headerlen+1);
- if(!fragmentmsg) {
+ if (!fragmentmsg) {
for (i=0; i<curfrag-1; free(fragmentarray[i++])) {}
free(fragmentarray);
free(fragdata);
diff --git a/plugins/MirOTR/libotr-3.2.0/toolkit/aes.c b/plugins/MirOTR/libotr-3.2.0/toolkit/aes.c
index 24b9b56084..44bb67597f 100644
--- a/plugins/MirOTR/libotr-3.2.0/toolkit/aes.c
+++ b/plugins/MirOTR/libotr-3.2.0/toolkit/aes.c
@@ -74,7 +74,7 @@ void aes_gen_tables( void )
/* compute pow and log tables over GF(2^8) */
- for( i = 0, x = 1; i < 256; i++, x ^= XTIME( x ) )
+ for ( i = 0, x = 1; i < 256; i++, x ^= XTIME( x ) )
{
pow[i] = x;
log[x] = i;
@@ -82,7 +82,7 @@ void aes_gen_tables( void )
/* calculate the round constants */
- for( i = 0, x = 1; i < 10; i++, x = XTIME( x ) )
+ for ( i = 0, x = 1; i < 10; i++, x = XTIME( x ) )
{
RCON[i] = (uint32) x << 24;
}
@@ -92,7 +92,7 @@ void aes_gen_tables( void )
FSb[0x00] = 0x63;
RSb[0x63] = 0x00;
- for( i = 1; i < 256; i++ )
+ for ( i = 1; i < 256; i++ )
{
x = pow[255 - log[i]];
@@ -108,7 +108,7 @@ void aes_gen_tables( void )
/* generate the forward and reverse tables */
- for( i = 0; i < 256; i++ )
+ for ( i = 0; i < 256; i++ )
{
x = (unsigned char) FSb[i]; y = XTIME( x );
@@ -441,7 +441,7 @@ int aes_set_key( aes_context *ctx, uint8 *key, int nbits )
int i;
uint32 *RK, *SK;
- if( do_init )
+ if ( do_init )
{
aes_gen_tables();
@@ -458,7 +458,7 @@ int aes_set_key( aes_context *ctx, uint8 *key, int nbits )
RK = ctx->erk;
- for( i = 0; i < (nbits >> 5); i++ )
+ for ( i = 0; i < (nbits >> 5); i++ )
{
GET_UINT32( RK[i], key, i * 4 );
}
@@ -469,7 +469,7 @@ int aes_set_key( aes_context *ctx, uint8 *key, int nbits )
{
case 128:
- for( i = 0; i < 10; i++, RK += 4 )
+ for ( i = 0; i < 10; i++, RK += 4 )
{
RK[4] = RK[0] ^ RCON[i] ^
( FSb[ (uint8) ( RK[3] >> 16 ) ] << 24 ) ^
@@ -485,7 +485,7 @@ int aes_set_key( aes_context *ctx, uint8 *key, int nbits )
case 192:
- for( i = 0; i < 8; i++, RK += 6 )
+ for ( i = 0; i < 8; i++, RK += 6 )
{
RK[6] = RK[0] ^ RCON[i] ^
( FSb[ (uint8) ( RK[5] >> 16 ) ] << 24 ) ^
@@ -503,7 +503,7 @@ int aes_set_key( aes_context *ctx, uint8 *key, int nbits )
case 256:
- for( i = 0; i < 7; i++, RK += 8 )
+ for ( i = 0; i < 7; i++, RK += 8 )
{
RK[8] = RK[0] ^ RCON[i] ^
( FSb[ (uint8) ( RK[7] >> 16 ) ] << 24 ) ^
@@ -530,9 +530,9 @@ int aes_set_key( aes_context *ctx, uint8 *key, int nbits )
/* setup decryption round keys */
- if( KT_init )
+ if ( KT_init )
{
- for( i = 0; i < 256; i++ )
+ for ( i = 0; i < 256; i++ )
{
KT0[i] = RT0[ FSb[i] ];
KT1[i] = RT1[ FSb[i] ];
@@ -550,7 +550,7 @@ int aes_set_key( aes_context *ctx, uint8 *key, int nbits )
*SK++ = *RK++;
*SK++ = *RK++;
- for( i = 1; i < ctx->nr; i++ )
+ for ( i = 1; i < ctx->nr; i++ )
{
RK -= 8;
@@ -633,13 +633,13 @@ void aes_encrypt( aes_context *ctx, uint8 input[16], uint8 output[16] )
AES_FROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 8 */
AES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 9 */
- if( ctx->nr > 10 )
+ if ( ctx->nr > 10 )
{
AES_FROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 10 */
AES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 11 */
}
- if( ctx->nr > 12 )
+ if ( ctx->nr > 12 )
{
AES_FROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 12 */
AES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 13 */
@@ -723,13 +723,13 @@ void aes_decrypt( aes_context *ctx, uint8 input[16], uint8 output[16] )
AES_RROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 8 */
AES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 9 */
- if( ctx->nr > 10 )
+ if ( ctx->nr > 10 )
{
AES_RROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 10 */
AES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 11 */
}
- if( ctx->nr > 12 )
+ if ( ctx->nr > 12 )
{
AES_RROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 12 */
AES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 13 */
@@ -802,14 +802,14 @@ int main( void )
unsigned char buf[16];
unsigned char key[32];
- for( m = 0; m < 2; m++ )
+ for ( m = 0; m < 2; m++ )
{
printf( "\n Rijndael Monte Carlo Test (ECB mode) - " );
- if( m == 0 ) printf( "encryption\n\n" );
- if( m == 1 ) printf( "decryption\n\n" );
+ if ( m == 0 ) printf( "encryption\n\n" );
+ if ( m == 1 ) printf( "decryption\n\n" );
- for( n = 0; n < 3; n++ )
+ for ( n = 0; n < 3; n++ )
{
printf( " Test %d, key size = %3d bits: ",
n + 1, 128 + n * 64 );
@@ -819,34 +819,34 @@ int main( void )
memset( buf, 0, 16 );
memset( key, 0, 16 + n * 8 );
- for( i = 0; i < 400; i++ )
+ for ( i = 0; i < 400; i++ )
{
aes_set_key( &ctx, key, 128 + n * 64 );
- for( j = 0; j < 9999; j++ )
+ for ( j = 0; j < 9999; j++ )
{
- if( m == 0 ) aes_encrypt( &ctx, buf, buf );
- if( m == 1 ) aes_decrypt( &ctx, buf, buf );
+ if ( m == 0 ) aes_encrypt( &ctx, buf, buf );
+ if ( m == 1 ) aes_decrypt( &ctx, buf, buf );
}
- if( n > 0 )
+ if ( n > 0 )
{
- for( j = 0; j < (n << 3); j++ )
+ for ( j = 0; j < (n << 3); j++ )
{
key[j] ^= buf[j + 16 - (n << 3)];
}
}
- if( m == 0 ) aes_encrypt( &ctx, buf, buf );
- if( m == 1 ) aes_decrypt( &ctx, buf, buf );
+ if ( m == 0 ) aes_encrypt( &ctx, buf, buf );
+ if ( m == 1 ) aes_decrypt( &ctx, buf, buf );
- for( j = 0; j < 16; j++ )
+ for ( j = 0; j < 16; j++ )
{
key[j + (n << 3)] ^= buf[j];
}
}
- if( ( m == 0 && memcmp( buf, AES_enc_test[n], 16 ) != 0 ) ||
+ if ( ( m == 0 && memcmp( buf, AES_enc_test[n], 16 ) != 0 ) ||
( m == 1 && memcmp( buf, AES_dec_test[n], 16 ) != 0 ) )
{
printf( "failed!\n" );
diff --git a/plugins/ModernOpt/mopt_ignore.cpp b/plugins/ModernOpt/mopt_ignore.cpp
index 8576b3f2bb..74f8b1524d 100644
--- a/plugins/ModernOpt/mopt_ignore.cpp
+++ b/plugins/ModernOpt/mopt_ignore.cpp
@@ -54,7 +54,7 @@ static void SetAllContactIcons(HWND hwndList, int count)
DWORD hItem = SendMessage(hwndList,CLM_FINDCONTACT,(WPARAM)hContact,0);
for (int i = 0; i < count; ++i)
SendMessage(hwndList,CLM_SETEXTRAIMAGE,hItem,MAKELPARAM(i, i+1));
- if(!DBGetContactSettingByte(hContact,"CList","Hidden",0))
+ if (!DBGetContactSettingByte(hContact,"CList","Hidden",0))
SendMessage(hwndList,CLM_SETCHECKMARK,hItem,1);
}
while(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
diff --git a/plugins/Modernb/MString.cpp b/plugins/Modernb/MString.cpp
index bf385194c3..caba4e022c 100644
--- a/plugins/Modernb/MString.cpp
+++ b/plugins/Modernb/MString.cpp
@@ -79,7 +79,7 @@ bool CMStringData::IsShared() const
void CMStringData::Lock()
{
nRefs--; // Locked buffers can't be shared, so no interlocked operation necessary
- if( nRefs == 0 )
+ if ( nRefs == 0 )
nRefs = -1;
}
diff --git a/plugins/Modernb/_disabled_src/groups.c b/plugins/Modernb/_disabled_src/groups.c
index 8e282de26b..e9350bf66a 100644
--- a/plugins/Modernb/_disabled_src/groups.c
+++ b/plugins/Modernb/_disabled_src/groups.c
@@ -134,7 +134,7 @@ static int GetGroupName(WPARAM wParam,LPARAM lParam)
{
int ret;
ret=GetGroupName2(wParam,lParam);
- if((int*)lParam)
+ if ((int*)lParam)
*(int*)lParam=0!=(*(int*)lParam&GROUPF_EXPANDED);
return ret;
}
diff --git a/plugins/Modernb/hdr/MString.h b/plugins/Modernb/hdr/MString.h
index 28cbeebdcf..28840fd84b 100644
--- a/plugins/Modernb/hdr/MString.h
+++ b/plugins/Modernb/hdr/MString.h
@@ -126,7 +126,7 @@ public:
CMSimpleStringT(const XCHAR* pchSrc, int nLength)
{
CMStringData* pData = Allocate( nLength, sizeof( XCHAR ) );
- if( pData != NULL )
+ if ( pData != NULL )
{
Attach( pData );
SetLength( nLength );
@@ -148,9 +148,9 @@ public:
{
CMStringData* pSrcData = strSrc.GetData();
CMStringData* pOldData = GetData();
- if( pSrcData != pOldData)
+ if ( pSrcData != pOldData)
{
- if( pOldData->IsLocked() )
+ if ( pOldData->IsLocked() )
SetString( strSrc.GetString(), strSrc.GetLength() );
else
{
@@ -238,7 +238,7 @@ public:
int nNewLength = nOldLength+nLength;
PXSTR pszBuffer = GetBuffer( nNewLength );
- if( nOffset <= nOldLength )
+ if ( nOffset <= nOldLength )
{
pszSrc = pszBuffer+nOffset;
// No need to call CopyCharsOverlapped, since the destination is
@@ -262,10 +262,10 @@ public:
void Empty()
{
CMStringData* pOldData = GetData();
- if( pOldData->nDataLength == 0 )
+ if ( pOldData->nDataLength == 0 )
return;
- if( pOldData->IsLocked() )
+ if ( pOldData->IsLocked() )
{
// Don't reallocate a locked buffer that's shrinking
SetLength( 0 );
@@ -281,13 +281,13 @@ public:
{
CMStringData* pOldData = GetData();
int nLength = pOldData->nDataLength;
- if( pOldData->nAllocLength == nLength )
+ if ( pOldData->nAllocLength == nLength )
return;
- if( !pOldData->IsLocked() ) // Don't reallocate a locked buffer that's shrinking
+ if ( !pOldData->IsLocked() ) // Don't reallocate a locked buffer that's shrinking
{
CMStringData* pNewData = Allocate( nLength, sizeof( XCHAR ) );
- if( pNewData == NULL ) {
+ if ( pNewData == NULL ) {
SetLength( nLength );
return;
}
@@ -311,7 +311,7 @@ public:
PXSTR GetBuffer()
{
CMStringData* pData = GetData();
- if( pData->IsShared() )
+ if ( pData->IsShared() )
Fork( pData->nDataLength );
return m_pszData;
@@ -343,7 +343,7 @@ public:
PXSTR LockBuffer()
{
CMStringData* pData = GetData();
- if( pData->IsShared() )
+ if ( pData->IsShared() )
{
Fork( pData->nDataLength );
pData = GetData(); // Do it again, because the fork might have changed it
@@ -363,7 +363,7 @@ public:
}
void ReleaseBuffer( int nNewLength = -1 )
{
- if( nNewLength == -1 )
+ if ( nNewLength == -1 )
{
int nAlloc = GetData()->nAllocLength;
nNewLength = StringLengthN( m_pszData, nAlloc);
@@ -397,7 +397,7 @@ public:
}
void SetString( PCXSTR pszSrc, int nLength )
{
- if( nLength == 0 )
+ if ( nLength == 0 )
{
Empty();
}
@@ -408,7 +408,7 @@ public:
UINT_PTR nOffset = pszSrc - GetString();
PXSTR pszBuffer = GetBuffer( nLength );
- if( nOffset <= nOldLength )
+ if ( nOffset <= nOldLength )
{
CopyCharsOverlapped( pszBuffer, GetAllocLength(),
pszBuffer+nOffset, nLength );
@@ -496,14 +496,14 @@ public:
}
static int __stdcall StringLengthN(const char* psz, size_t sizeInXChar )
{
- if( psz == NULL )
+ if ( psz == NULL )
return 0;
return int( strnlen( psz, sizeInXChar ));
}
static int __stdcall StringLengthN(const wchar_t* psz, size_t sizeInXChar )
{
- if( psz == NULL )
+ if ( psz == NULL )
return 0;
return int( wcsnlen( psz, sizeInXChar ));
@@ -565,12 +565,12 @@ private:
{
// Grow exponentially, until we hit 1K.
int nNewLength = pOldData->nAllocLength;
- if( nNewLength > 1024 )
+ if ( nNewLength > 1024 )
nNewLength += 1024;
else
nNewLength *= 2;
- if( nNewLength < nLength )
+ if ( nNewLength < nLength )
nNewLength = nLength;
Reallocate( nNewLength );
@@ -583,7 +583,7 @@ private:
return;
CMStringData* pNewData = Realloc( pOldData, nLength, sizeof( XCHAR ) );
- if( pNewData != NULL )
+ if ( pNewData != NULL )
Attach( pNewData );
}
@@ -820,7 +820,7 @@ public:
{
int nLen = ::MultiByteToWideChar( _AtlGetConversionACP(), 0, pchData, nDataLength, NULL, NULL );
BSTR bstr = ::SysAllocStringLen( NULL, nLen );
- if( bstr != NULL )
+ if ( bstr != NULL )
::MultiByteToWideChar( _AtlGetConversionACP(), 0, pchData, nDataLength, bstr, nLen );
return bstr;
@@ -830,7 +830,7 @@ public:
{
int nLen = ::MultiByteToWideChar( _AtlGetConversionACP(), 0, pchData, nDataLength, NULL, NULL );
BOOL bSuccess = ::SysReAllocStringLen( pbstr, NULL, nLen );
- if( bSuccess )
+ if ( bSuccess )
::MultiByteToWideChar( _AtlGetConversionACP(), 0, pchData, nDataLength, *pbstr, nLen );
return bSuccess;
@@ -1034,7 +1034,7 @@ public:
static void __stdcall FloodCharacters( wchar_t ch, int nLength, LPWSTR psz )
{
// nLength is in XCHARs
- for( int i = 0; i < nLength; i++ )
+ for ( int i = 0; i < nLength; i++ )
{
psz[i] = ch;
}
@@ -1148,7 +1148,7 @@ public:
CMStringT( char ch, int nLength = 1 ) :
CThisSimpleString()
{
- if( nLength > 0 )
+ if ( nLength > 0 )
{
PXSTR pszBuffer = this->GetBuffer( nLength );
StringTraits::FloodCharacters( XCHAR( ch ), nLength, pszBuffer );
@@ -1159,7 +1159,7 @@ public:
CMStringT( wchar_t ch, int nLength = 1 ) :
CThisSimpleString()
{
- if( nLength > 0 )
+ if ( nLength > 0 )
{
//Convert ch to the BaseType
wchar_t pszCh[2] = { ch , 0 };
@@ -1202,7 +1202,7 @@ public:
CMStringT( const YCHAR* pch, int nLength ) :
CThisSimpleString()
{
- if( nLength > 0 )
+ if ( nLength > 0 )
{
int nDestLength = StringTraits::GetBaseTypeLength( pch, nLength );
PXSTR pszBuffer = this->GetBuffer( nDestLength );
@@ -1235,7 +1235,7 @@ public:
{
// nDestLength is in XCHARs
int nDestLength = (pszSrc != NULL) ? StringTraits::GetBaseTypeLength( pszSrc ) : 0;
- if( nDestLength > 0 )
+ if ( nDestLength > 0 )
{
PXSTR pszBuffer = this->GetBuffer( nDestLength );
StringTraits::ConvertToBaseType( pszBuffer, nDestLength, pszSrc);
@@ -1349,18 +1349,18 @@ public:
// Delete 'nCount' characters, starting at index 'iIndex'
int Delete( int iIndex, int nCount = 1 )
{
- if( iIndex < 0 )
+ if ( iIndex < 0 )
iIndex = 0;
- if( nCount < 0 )
+ if ( nCount < 0 )
nCount = 0;
int nLength = this->GetLength();
- if( nCount + iIndex > nLength )
+ if ( nCount + iIndex > nLength )
{
nCount = nLength-iIndex;
}
- if( nCount > 0 )
+ if ( nCount > 0 )
{
int nNewLength = nLength-nCount;
int nXCHARsToCopy = nLength-(iIndex+nCount)+1;
@@ -1379,10 +1379,10 @@ public:
// Insert character 'ch' before index 'iIndex'
int Insert( int iIndex, XCHAR ch )
{
- if( iIndex < 0 )
+ if ( iIndex < 0 )
iIndex = 0;
- if( iIndex > this->GetLength() )
+ if ( iIndex > this->GetLength() )
iIndex = this->GetLength();
int nNewLength = this->GetLength()+1;
@@ -1404,10 +1404,10 @@ public:
// Insert string 'psz' before index 'iIndex'
int Insert( int iIndex, PCXSTR psz )
{
- if( iIndex < 0 )
+ if ( iIndex < 0 )
iIndex = 0;
- if( iIndex > this->GetLength() )
+ if ( iIndex > this->GetLength() )
{
iIndex = this->GetLength();
}
@@ -1415,7 +1415,7 @@ public:
// nInsertLength and nNewLength are in XCHARs
int nInsertLength = StringTraits::SafeStringLen( psz );
int nNewLength = this->GetLength();
- if( nInsertLength > 0 )
+ if ( nInsertLength > 0 )
{
nNewLength += nInsertLength;
@@ -1440,7 +1440,7 @@ public:
int nCount = 0;
// short-circuit the nop case
- if( chOld != chNew )
+ if ( chOld != chNew )
{
// otherwise modify each character that matches in the string
bool bCopied = false;
@@ -1451,9 +1451,9 @@ public:
while( iChar < nLength )
{
// replace instances of the specified character only
- if( pszBuffer[iChar] == chOld )
+ if ( pszBuffer[iChar] == chOld )
{
- if( !bCopied )
+ if ( !bCopied )
{
bCopied = true;
pszBuffer = this->GetBuffer( nLength );
@@ -1463,7 +1463,7 @@ public:
}
iChar = int( StringTraits::CharNext( pszBuffer+iChar )-pszBuffer );
}
- if( bCopied )
+ if ( bCopied )
{
this->ReleaseBufferSetLength( nLength );
}
@@ -1479,7 +1479,7 @@ public:
// nSourceLen is in XCHARs
int nSourceLen = StringTraits::SafeStringLen( pszOld );
- if( nSourceLen == 0 )
+ if ( nSourceLen == 0 )
return 0;
// nReplacementLen is in XCHARs
int nReplacementLen = StringTraits::SafeStringLen( pszNew );
@@ -1502,7 +1502,7 @@ public:
}
// if any changes were made, make them
- if( nCount > 0 )
+ if ( nCount > 0 )
{
// if the buffer is too small, just
// allocate a new buffer (slow but sure)
@@ -1550,7 +1550,7 @@ public:
while( pszSource < pszEnd )
{
PXSTR pszNewSource = StringTraits::CharNext( pszSource );
- if( *pszSource != chRemove )
+ if ( *pszSource != chRemove )
{
// Copy the source to the destination. Remember to copy all bytes of an MBCS character
// Copy the source to the destination. Remember to copy all bytes of an MBCS character
@@ -1575,7 +1575,7 @@ public:
CMStringT Tokenize( PCXSTR pszTokens, int& iStart ) const
{
- if( (pszTokens == NULL) || (*pszTokens == (XCHAR)0) )
+ if ( (pszTokens == NULL) || (*pszTokens == (XCHAR)0) )
{
if (iStart < this->GetLength())
return CMStringT( this->GetString()+iStart );
@@ -1584,11 +1584,11 @@ public:
{
PCXSTR pszPlace = this->GetString()+iStart;
PCXSTR pszEnd = this->GetString()+this->GetLength();
- if( pszPlace < pszEnd )
+ if ( pszPlace < pszEnd )
{
int nIncluding = StringTraits::StringSpanIncluding( pszPlace, pszTokens );
- if( (pszPlace+nIncluding) < pszEnd )
+ if ( (pszPlace+nIncluding) < pszEnd )
{
pszPlace += nIncluding;
int nExcluding = StringTraits::StringSpanExcluding( pszPlace, pszTokens );
@@ -1615,7 +1615,7 @@ public:
{
// nLength is in XCHARs
int nLength = this->GetLength();
- if( iStart < 0 || iStart >= nLength)
+ if ( iStart < 0 || iStart >= nLength)
return -1;
// find first single character
@@ -1636,7 +1636,7 @@ public:
// nLength is in XCHARs
int nLength = this->GetLength();
- if( iStart < 0 || iStart > nLength )
+ if ( iStart < 0 || iStart > nLength )
return -1;
// find first matching substring
@@ -1711,9 +1711,9 @@ public:
while( *psz != 0 )
{
- if( StringTraits::IsSpace( *psz ) )
+ if ( StringTraits::IsSpace( *psz ) )
{
- if( pszLast == NULL )
+ if ( pszLast == NULL )
pszLast = psz;
}
else
@@ -1723,7 +1723,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( pszLast != NULL )
+ if ( pszLast != NULL )
{
// truncate at trailing space start
int iLast = int( pszLast-this->GetString() );
@@ -1746,7 +1746,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( psz != this->GetString() )
+ if ( psz != this->GetString() )
{
// fix up data and length
int iFirst = int( psz-this->GetString() );
@@ -1792,9 +1792,9 @@ public:
while( *psz != 0 )
{
- if( *psz == chTarget )
+ if ( *psz == chTarget )
{
- if( pszLast == NULL )
+ if ( pszLast == NULL )
{
pszLast = psz;
}
@@ -1806,7 +1806,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( pszLast != NULL )
+ if ( pszLast != NULL )
{
// truncate at left-most matching character
int iLast = int( pszLast-this->GetString() );
@@ -1820,7 +1820,7 @@ public:
CMStringT& TrimRight( PCXSTR pszTargets )
{
// if we're not trimming anything, we're not doing any work
- if( (pszTargets == NULL) || (*pszTargets == 0) )
+ if ( (pszTargets == NULL) || (*pszTargets == 0) )
{
return *this;
}
@@ -1833,9 +1833,9 @@ public:
while( *psz != 0 )
{
- if( StringTraits::StringFindChar( pszTargets, *psz ) != NULL )
+ if ( StringTraits::StringFindChar( pszTargets, *psz ) != NULL )
{
- if( pszLast == NULL )
+ if ( pszLast == NULL )
{
pszLast = psz;
}
@@ -1847,7 +1847,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( pszLast != NULL )
+ if ( pszLast != NULL )
{
// truncate at left-most matching character
int iLast = int( pszLast-this->GetString() );
@@ -1868,7 +1868,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( psz != this->GetString() )
+ if ( psz != this->GetString() )
{
// fix up data and length
int iFirst = int( psz-this->GetString() );
@@ -1887,7 +1887,7 @@ public:
CMStringT& TrimLeft( PCXSTR pszTargets )
{
// if we're not trimming anything, we're not doing any work
- if( (pszTargets == NULL) || (*pszTargets == 0) )
+ if ( (pszTargets == NULL) || (*pszTargets == 0) )
{
return *this;
}
@@ -1898,7 +1898,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( psz != this->GetString() )
+ if ( psz != this->GetString() )
{
// fix up data and length
int iFirst = int( psz-this->GetString() );
@@ -1950,14 +1950,14 @@ public:
if (nCount < 0)
nCount = 0;
- if( (iFirst + nCount) > this->GetLength() )
+ if ( (iFirst + nCount) > this->GetLength() )
nCount = this->GetLength()-iFirst;
- if( iFirst > this->GetLength() )
+ if ( iFirst > this->GetLength() )
nCount = 0;
// optimize case of returning entire string
- if( (iFirst == 0) && ((iFirst+nCount) == this->GetLength()) )
+ if ( (iFirst == 0) && ((iFirst+nCount) == this->GetLength()) )
return *this;
return CMStringT( this->GetString()+iFirst, nCount );
@@ -1971,7 +1971,7 @@ public:
nCount = 0;
int nLength = this->GetLength();
- if( nCount >= nLength )
+ if ( nCount >= nLength )
{
return *this;
}
@@ -1987,7 +1987,7 @@ public:
nCount = 0;
int nLength = this->GetLength();
- if( nCount >= nLength )
+ if ( nCount >= nLength )
return *this;
return CMStringT( this->GetString(), nCount );
@@ -2050,7 +2050,7 @@ public:
ULONG nLength = StringTraits::GetEnvironmentVariable( pszVar, NULL, 0 );
BOOL bRetVal = FALSE;
- if( nLength == 0 )
+ if ( nLength == 0 )
{
this->Empty();
}
@@ -2069,7 +2069,7 @@ public:
BOOL LoadString( UINT nID )
{
HINSTANCE hInst = StringTraits::FindStringResourceInstance( nID );
- if( hInst == NULL )
+ if ( hInst == NULL )
return FALSE;
return LoadString( hInst, nID );
diff --git a/plugins/Modernb/modern_clc.cpp b/plugins/Modernb/modern_clc.cpp
index a3a08b7494..ec54139d94 100644
--- a/plugins/Modernb/modern_clc.cpp
+++ b/plugins/Modernb/modern_clc.cpp
@@ -235,7 +235,7 @@ static int clcHookSettingChanged(WPARAM wParam,LPARAM lParam)
}
else if (g_szMetaModuleName && !strcmp(cws->szModule,g_szMetaModuleName))
{
- if(!strcmp(cws->szSetting,"Handle"))
+ if (!strcmp(cws->szSetting,"Handle"))
{
pcli->pfnClcBroadcast( INTM_NAMEORDERCHANGED,0,0);
}
@@ -252,30 +252,30 @@ static int clcHookSettingChanged(WPARAM wParam,LPARAM lParam)
else if (!strcmp(cws->szModule,"CList"))
{
/*
- if(!strcmp(cws->szSetting,"MyHandle"))
+ if (!strcmp(cws->szSetting,"MyHandle"))
pcli->pfnClcBroadcast( INTM_NAMECHANGED,wParam,lParam);
- else if(!strcmp(cws->szSetting,"Group"))
+ else if (!strcmp(cws->szSetting,"Group"))
pcli->pfnClcBroadcast( INTM_GROUPCHANGED,wParam,lParam);
- else if(!strcmp(cws->szSetting,"Hidden"))
+ else if (!strcmp(cws->szSetting,"Hidden"))
pcli->pfnClcBroadcast( INTM_HIDDENCHANGED,wParam,lParam);
- else if(!strcmp(cws->szSetting,"noOffline"))
+ else if (!strcmp(cws->szSetting,"noOffline"))
pcli->pfnClcBroadcast( INTM_NAMEORDERCHANGED,wParam,lParam);
- else if(!strcmp(cws->szSetting,"NotOnList"))
+ else if (!strcmp(cws->szSetting,"NotOnList"))
pcli->pfnClcBroadcast( INTM_NOTONLISTCHANGED,wParam,lParam);
- else if(!strcmp(cws->szSetting,"NameOrder"))
+ else if (!strcmp(cws->szSetting,"NameOrder"))
pcli->pfnClcBroadcast( INTM_NAMEORDERCHANGED,0,0);
else
- else if(!strcmp(cws->szSetting,"Status"))
+ else if (!strcmp(cws->szSetting,"Status"))
pcli->pfnClcBroadcast( INTM_STATUSCHANGED,wParam,0);
else
*/
- if(!strcmp(cws->szSetting,"StatusMsg"))
+ if (!strcmp(cws->szSetting,"StatusMsg"))
pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED,wParam,0);
}
- else if(!strcmp(cws->szModule,"ContactPhoto"))
+ else if (!strcmp(cws->szModule,"ContactPhoto"))
{
if (!strcmp(cws->szSetting,"File"))
pcli->pfnClcBroadcast( INTM_AVATARCHANGED,wParam,0);
@@ -698,7 +698,7 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa
case VK_DELETE: pcli->pfnDeleteFromContactList(hwnd,dat); SetCapture(hwnd);return 0;
case VK_ESCAPE:
{
- if((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_ACTIVE)
+ if ((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_ACTIVE)
{
dat->iDragItem=-1;
dat->iInsertionMark=-1;
@@ -1005,7 +1005,7 @@ static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM
if(GetFocus()!=hwnd) SetFocus(hwnd);
if(hit!=-1 && !(hitFlags&CLCHT_NOWHERE))
{
- if( hit==dat->selection && hitFlags&CLCHT_ONITEMLABEL && dat->exStyle&CLS_EX_EDITLABELS)
+ if ( hit==dat->selection && hitFlags&CLCHT_ONITEMLABEL && dat->exStyle&CLS_EX_EDITLABELS)
{
if ( !(dat->dragStage&DRAGSTAGEF_SKIPRENAME) )
{
@@ -1080,7 +1080,7 @@ static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM
nm.hItem=ContactToItemHandle(contact,&nm.flags);
SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm);
}
- if(!(hitFlags&(CLCHT_ONITEMICON|CLCHT_ONITEMLABEL|CLCHT_ONITEMCHECK)))
+ if (!(hitFlags&(CLCHT_ONITEMICON|CLCHT_ONITEMLABEL|CLCHT_ONITEMCHECK)))
{
NMCLISTCONTROL nm;
nm.hdr.code=NM_CLICK;
@@ -1234,13 +1234,13 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
}
return 0;
}
- if((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_NOTMOVED && !(dat->exStyle&CLS_EX_DISABLEDRAGDROP))
+ if ((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_NOTMOVED && !(dat->exStyle&CLS_EX_DISABLEDRAGDROP))
{
if(abs((short)LOWORD(lParam)-dat->ptDragStart.x)>=GetSystemMetrics(SM_CXDRAG) || abs((short)HIWORD(lParam)-dat->ptDragStart.y)>=GetSystemMetrics(SM_CYDRAG))
dat->dragStage=(dat->dragStage&~DRAGSTAGEM_STAGE)|DRAGSTAGE_ACTIVE;
}
- if((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_ACTIVE)
+ if ((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_ACTIVE)
{
HCURSOR hNewCursor;
RECT clRect;
@@ -1340,7 +1340,7 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
if(pt.x>=0 && pt.x<clRect.right && ((pt.y<0 && pt.y>-dat->dragAutoScrollHeight) || (pt.y>=clRect.bottom && pt.y<clRect.bottom+dat->dragAutoScrollHeight)))
{
- if(!dat->dragAutoScrolling)
+ if (!dat->dragAutoScrolling)
{
if(pt.y<0) dat->dragAutoScrolling=-1;
else dat->dragAutoScrolling=1;
@@ -1407,7 +1407,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
KillTimer(hwnd,TIMERID_DRAGAUTOSCROLL);
if(dat->dragStage==(DRAGSTAGE_NOTMOVED|DRAGSTAGEF_MAYBERENAME))
CLUI_SafeSetTimer(hwnd,TIMERID_RENAME,GetDoubleClickTime(),NULL);
- else if((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_ACTIVE)
+ else if ((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_ACTIVE)
{
POINT pt;
int target;
@@ -1442,7 +1442,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
if (res==1)
{
handle=(HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hDest,0);
- if(!handle) return 0;
+ if (!handle) return 0;
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
}
}
@@ -1458,7 +1458,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
{
handle=(HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hdest,0);
- if(!handle) return 0;
+ if (!handle) return 0;
CallService(MS_MC_REMOVEFROMMETA,(WPARAM)0,(LPARAM)hcontact);
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
@@ -1490,7 +1490,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
if (res==1)
{
- if(!handle) return 0;
+ if (!handle) return 0;
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
}
}
@@ -1519,7 +1519,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
if (res==1)
{
- if(!handle) return 0;
+ if (!handle) return 0;
CallService(MS_MC_REMOVEFROMMETA,(WPARAM)0,(LPARAM)hcontact);
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
@@ -1550,7 +1550,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
if (res==1)
{
- if(!handle) return 0;
+ if (!handle) return 0;
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
}
}
@@ -1567,7 +1567,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w
if (res==1)
{
- if(!handle) return 0;
+ if (!handle) return 0;
CallService(MS_MC_REMOVEFROMMETA,(WPARAM)0,(LPARAM)hcontact);
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
@@ -1842,7 +1842,7 @@ static LRESULT clcOnIntmAvatarChanged(struct ClcData *dat, HWND hwnd, UINT msg,
static LRESULT clcOnIntmTimeZoneChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
struct ClcContact *contact;
- if(!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
+ if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
return corecli.pfnContactListControlWndProc(hwnd,msg,wParam,lParam);
if (contact) //!IsBadWritePtr(contact, sizeof(struct ClcContact)))
@@ -1859,7 +1859,7 @@ static LRESULT clcOnIntmNameChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP
int ret=corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
pcli->pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
- if(!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
+ if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
return ret;
lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HANDLE)wParam,0),SIZEOF(contact->szText));
@@ -1904,7 +1904,7 @@ static LRESULT clcOnIntmNotOnListChanged(struct ClcData *dat, HWND hwnd, UINT ms
DBCONTACTWRITESETTING *dbcws=(DBCONTACTWRITESETTING*)lParam;
struct ClcContact *contact;
- if(!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE))
+ if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if(contact->type!=CLCIT_CONTACT)
diff --git a/plugins/Modernb/modern_clcidents.cpp b/plugins/Modernb/modern_clcidents.cpp
index bcbe3af247..b6106439bc 100644
--- a/plugins/Modernb/modern_clcidents.cpp
+++ b/plugins/Modernb/modern_clcidents.cpp
@@ -61,7 +61,7 @@ int cliGetRowsPriorTo(struct ClcGroup *group,struct ClcGroup *subgroup,int conta
int subcontactscount=0;
k=ModernGetSettingByte(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
group->scanIndex=0;
- for(;;) {
+ for (;;) {
if(group->scanIndex==group->cl.count) {
group=group->parent;
if(group==NULL) break;
@@ -120,7 +120,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont
group->scanIndex=0;
group=&dat->list;
- for(;;) {
+ for (;;) {
if(group->scanIndex==group->cl.count) {
struct ClcGroup *tgroup;
group=group->parent;
@@ -128,7 +128,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont
nowVisible=1;
for(tgroup=group;tgroup;tgroup=tgroup->parent)
{
- if(!tgroup->expanded)
+ if (!tgroup->expanded)
{
nowVisible=0;
break;
@@ -138,12 +138,12 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont
continue;
}
if(nowVisible) index++;
- if((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type==CLCIT_GROUP && ((UINT_PTR)hItem&~HCONTACT_ISGROUP)==group->cl.items[group->scanIndex]->groupId) ||
+ if ((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type==CLCIT_GROUP && ((UINT_PTR)hItem&~HCONTACT_ISGROUP)==group->cl.items[group->scanIndex]->groupId) ||
(IsHContactContact(hItem) && group->cl.items[group->scanIndex]->type==CLCIT_CONTACT && group->cl.items[group->scanIndex]->hContact==hItem) ||
(IsHContactInfo(hItem) && group->cl.items[group->scanIndex]->type==CLCIT_INFO && group->cl.items[group->scanIndex]->hContact==(HANDLE)((UINT_PTR)hItem&~HCONTACT_ISINFO)))
{
if(isVisible) {
- if(!nowVisible) *isVisible=0;
+ if (!nowVisible) *isVisible=0;
else {
int posy = cliGetRowTopY(dat,index+1);
if(posy<dat->yScroll)
@@ -215,7 +215,7 @@ int cliGetRowByIndex(struct ClcData *dat,int testindex,struct ClcContact **conta
if (testindex<0) return (-1);
{
group->scanIndex=0;
- for(;;) {
+ for (;;) {
if(group->scanIndex==group->cl.count) {
group=group->parent;
if(group==NULL) break;
diff --git a/plugins/Modernb/modern_clcitems.cpp b/plugins/Modernb/modern_clcitems.cpp
index 36ab3bca7a..0901e406a0 100644
--- a/plugins/Modernb/modern_clcitems.cpp
+++ b/plugins/Modernb/modern_clcitems.cpp
@@ -295,7 +295,7 @@ void cli_AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int upda
struct ClcContact * cont;
pdisplayNameCacheEntry cacheEntry=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
if(dat->IsMetaContactsEnabled && cacheEntry && cacheEntry->m_cache_nHiddenSubcontact) return; //contact should not be added
- if(!dat->IsMetaContactsEnabled && cacheEntry && g_szMetaModuleName && !mir_strcmp(cacheEntry->m_cache_cszProto,g_szMetaModuleName)) return;
+ if (!dat->IsMetaContactsEnabled && cacheEntry && g_szMetaModuleName && !mir_strcmp(cacheEntry->m_cache_cszProto,g_szMetaModuleName)) return;
corecli.pfnAddContactToTree(hwnd,dat,hContact,updateTotalCount,checkHideOffline);
if (FindItem(hwnd,dat,hContact,&cont,&group,NULL,FALSE))
_LoadDataToContact(cont, group, dat, hContact);
@@ -424,14 +424,14 @@ void cliRebuildEntireList(HWND hwnd,struct ClcData *dat)
group=&dat->list;
group->totalMembers++;
- if(!(style&CLS_NOHIDEOFFLINE) && (style&CLS_HIDEOFFLINE || group->hideOffline))
+ if (!(style&CLS_NOHIDEOFFLINE) && (style&CLS_HIDEOFFLINE || group->hideOffline))
{
if(cacheEntry->m_cache_cszProto==NULL) {
- if(!pcli->pfnIsHiddenMode(dat,ID_STATUS_OFFLINE)||cacheEntry->m_cache_nNoHiddenOffline || CLCItems_IsShowOfflineGroup(group))
+ if (!pcli->pfnIsHiddenMode(dat,ID_STATUS_OFFLINE)||cacheEntry->m_cache_nNoHiddenOffline || CLCItems_IsShowOfflineGroup(group))
cont=AddContactToGroup(dat,group,cacheEntry);
}
else
- if(!pcli->pfnIsHiddenMode(dat,wStatus)||cacheEntry->m_cache_nNoHiddenOffline || CLCItems_IsShowOfflineGroup(group))
+ if (!pcli->pfnIsHiddenMode(dat,wStatus)||cacheEntry->m_cache_nNoHiddenOffline || CLCItems_IsShowOfflineGroup(group))
cont=AddContactToGroup(dat,group,cacheEntry);
}
else cont=AddContactToGroup(dat,group,cacheEntry);
@@ -449,7 +449,7 @@ void cliRebuildEntireList(HWND hwnd,struct ClcData *dat)
if(style&CLS_HIDEEMPTYGROUPS) {
group=&dat->list;
group->scanIndex=0;
- for(;;) {
+ for (;;) {
if(group->scanIndex==group->cl.count) {
group=group->parent;
if(group==NULL) break;
@@ -490,7 +490,7 @@ int GetNewSelection(struct ClcGroup *group, int selection, int direction)
return 0;
}
group->scanIndex=0;
- for(;;) {
+ for (;;) {
if(group->scanIndex==group->cl.count) {
group=group->parent;
if(group==NULL) break;
@@ -776,7 +776,7 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc
// check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
if(g_CluiData.bFilterEffective & CLVM_STICKY_CONTACTS)
{
- if((dwLocalMask = ModernGetSettingDword(hContact, CLVM_MODULE, g_CluiData.current_viewmode, 0)) != 0) {
+ if ((dwLocalMask = ModernGetSettingDword(hContact, CLVM_MODULE, g_CluiData.current_viewmode, 0)) != 0) {
if(g_CluiData.bFilterEffective & CLVM_FILTER_STICKYSTATUS)
{
WORD wStatus = ModernGetSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
@@ -791,7 +791,7 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc
filterResult = strstr(g_CluiData.protoFilter, szTemp) ? 1 : 0;
}
if(g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) {
- if(!ModernGetSettingTString(hContact, "CList", "Group", &dbv)) {
+ if (!ModernGetSettingTString(hContact, "CList", "Group", &dbv)) {
mir_sntprintf(szGroupMask, SIZEOF(szGroupMask), _T("%s|"), &dbv.ptszVal[0]);
filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0));
mir_free(dbv.ptszVal);
diff --git a/plugins/Modernb/modern_clcopts.cpp b/plugins/Modernb/modern_clcopts.cpp
index 62dbe371d1..74b3a19b10 100644
--- a/plugins/Modernb/modern_clcopts.cpp
+++ b/plugins/Modernb/modern_clcopts.cpp
@@ -457,7 +457,7 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA
EnableWindow(GetDlgItem(hwndDlg,IDC_SUBINDENTSPIN),t);
EnableWindow(GetDlgItem(hwndDlg,IDC_SUBINDENT),t);
}
- if((LOWORD(wParam)==IDC_SUBINDENT) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
+ if ((LOWORD(wParam)==IDC_SUBINDENT) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
return TRUE;
case WM_NOTIFY:
@@ -542,14 +542,14 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar
EnableWindow(GetDlgItem(hwndDlg,IDC_SMOOTHTIME),IsDlgButtonChecked(hwndDlg,IDC_NOTNOSMOOTHSCROLLING));
if(LOWORD(wParam)==IDC_GREYOUT)
EnableWindow(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),IsDlgButtonChecked(hwndDlg,IDC_GREYOUT));
- if((/*LOWORD(wParam)==IDC_LEFTMARGIN ||*/ LOWORD(wParam)==IDC_SMOOTHTIME || LOWORD(wParam)==IDC_GROUPINDENT) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
+ if ((/*LOWORD(wParam)==IDC_LEFTMARGIN ||*/ LOWORD(wParam)==IDC_SMOOTHTIME || LOWORD(wParam)==IDC_GROUPINDENT) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
break;
case WM_NOTIFY:
switch(((LPNMHDR)lParam)->idFrom) {
case IDC_GREYOUTOPTS:
case IDC_HIDEOFFLINEOPTS:
- if(((LPNMHDR)lParam)->code==NM_CLICK) {
+ if (((LPNMHDR)lParam)->code==NM_CLICK) {
TVHITTESTINFO hti;
hti.pt.x=(short)LOWORD(GetMessagePos());
hti.pt.y=(short)HIWORD(GetMessagePos());
@@ -574,7 +574,7 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar
{
DWORD exStyle=0;
for(int i=0;i<SIZEOF(checkBoxToStyleEx);i++)
- if((IsDlgButtonChecked(hwndDlg,checkBoxToStyleEx[i].id)==0)==checkBoxToStyleEx[i].neg)
+ if ((IsDlgButtonChecked(hwndDlg,checkBoxToStyleEx[i].id)==0)==checkBoxToStyleEx[i].neg)
exStyle|=checkBoxToStyleEx[i].flag;
ModernWriteSettingDword(NULL,"CLC","ExStyle",exStyle);
}
@@ -624,7 +624,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETDEFAULTCOLOUR,0,CLCDEFAULT_SELBKCOLOUR);
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR,0,ModernGetSettingDword(NULL,"StatusBar","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
{ DBVARIANT dbv={0};
- if(!ModernGetSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
+ if (!ModernGetSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
char szPath[MAX_PATH];
@@ -686,7 +686,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w
ofn.nMaxFile = SIZEOF(str);
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = "bmp";
- if(!GetOpenFileNameA(&ofn)) break;
+ if (!GetOpenFileNameA(&ofn)) break;
SetDlgItemTextA(hwndDlg,IDC_FILENAME,str);
}
else if(LOWORD(wParam)==IDC_FILENAME && HIWORD(wParam)!=EN_CHANGE) break;
@@ -936,12 +936,12 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
item=SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_ADDSTRING,0,(LPARAM)accs[i]->tszAccountName);
SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETITEMDATA,item,(LPARAM)accs[i]);
- if((dbv.type==DBVT_ASCIIZ || dbv.type==DBVT_UTF8)&& !strcmp(dbv.pszVal,accs[i]->szModuleName))
+ if ((dbv.type==DBVT_ASCIIZ || dbv.type==DBVT_UTF8)&& !strcmp(dbv.pszVal,accs[i]->szModuleName))
SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETCURSEL,item,0);
}
ModernDBFreeVariant(&dbv);
}
- if(-1==(int)SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETCURSEL,0,0))
+ if (-1==(int)SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETCURSEL,0,0))
SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETCURSEL,0,0);
SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETBUDDY,(WPARAM)GetDlgItem(hwndDlg,IDC_BLINKTIME),0); // set buddy
SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETRANGE,0,MAKELONG(0x3FFF,250));
@@ -1111,7 +1111,7 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC13),mode!=0);
}
- if(!IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE)) {
+ if (!IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC21),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC22),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_MAXSIZEHEIGHT),FALSE);
@@ -1247,7 +1247,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
CheckDlgButton(hwndDlg, IDC_SHOWCAPTION, ModernGetSettingByte(NULL,"CLUI","ShowCaption",SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, ModernGetSettingByte(NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
//EnableWindow(GetDlgItem(hwndDlg,IDC_CLIENTDRAG),!IsDlgButtonChecked(hwndDlg,IDC_DRAGTOSCROLL));
- if(!IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))
+ if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),FALSE);
@@ -1289,7 +1289,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
DBVARIANT dbv={0};
TCHAR *s=NULL;
char szUin[20];
- if(!ModernGetSettingTString(NULL,"CList","TitleText",&dbv))
+ if (!ModernGetSettingTString(NULL,"CList","TitleText",&dbv))
s=mir_tstrdup(dbv.ptszVal);
else
s=mir_tstrdup(_T(MIRANDANAME));
@@ -1302,32 +1302,32 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
sprintf(szUin,"%u",ModernGetSettingDword(NULL,"ICQ","UIN",0));
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)szUin);
- if(!ModernGetSettingString(NULL,"ICQ","Nick",&dbv)) {
+ if (!ModernGetSettingString(NULL,"ICQ","Nick",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
//mir_free_and_nill(dbv.pszVal);
ModernDBFreeVariant(&dbv);
dbv.pszVal=NULL;
}
- if(!ModernGetSettingString(NULL,"ICQ","FirstName",&dbv)) {
+ if (!ModernGetSettingString(NULL,"ICQ","FirstName",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
//mir_free_and_nill(dbv.pszVal);
ModernDBFreeVariant(&dbv);
dbv.pszVal=NULL;
}
- if(!ModernGetSettingString(NULL,"ICQ","e-mail",&dbv)) {
+ if (!ModernGetSettingString(NULL,"ICQ","e-mail",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
//mir_free_and_nill(dbv.pszVal);
ModernDBFreeVariant(&dbv);
dbv.pszVal=NULL;
}
}
- if(!IsWinVer2000Plus()) {
+ if (!IsWinVer2000Plus()) {
EnableWindow(GetDlgItem(hwndDlg,IDC_FADEINOUT),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSPARENT),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_DROPSHADOW),FALSE);
}
else CheckDlgButton(hwndDlg,IDC_TRANSPARENT,ModernGetSettingByte(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT)?BST_CHECKED:BST_UNCHECKED);
- if(!IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
+ if (!IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC11),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC12),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSACTIVE),FALSE);
@@ -1585,10 +1585,10 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
dat->item[indx].useWinColours = ModernGetSettingByte(NULL,module, "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
{
DBVARIANT dbv;
- if(!ModernGetSettingString(NULL,module,"BkBitmap",&dbv))
+ if (!ModernGetSettingString(NULL,module,"BkBitmap",&dbv))
{
int retval = CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)dat->item[indx].filename);
- if(!retval || retval == CALLSERVICE_NOTFOUND)
+ if (!retval || retval == CALLSERVICE_NOTFOUND)
lstrcpynA(dat->item[indx].filename, dbv.pszVal, MAX_PATH);
mir_free(dbv.pszVal);
}
@@ -1741,7 +1741,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
ofn.nMaxFile = SIZEOF(str);
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = "bmp";
- if(!GetOpenFileNameA(&ofn)) break;
+ if (!GetOpenFileNameA(&ofn)) break;
SetDlgItemTextA(hwndDlg, IDC_FILENAME, str);
}
else
@@ -1793,12 +1793,12 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
{
COLORREF col;
- if((col = dat->item[indx].bkColor) == DEFAULT_BKCOLOUR)
+ if ((col = dat->item[indx].bkColor) == DEFAULT_BKCOLOUR)
ModernDeleteSetting(NULL, module, "BkColour");
else
ModernWriteSettingDword(NULL, module, "BkColour", col);
- if((col = dat->item[indx].selColor) == DEFAULT_SELBKCOLOUR)
+ if ((col = dat->item[indx].selColor) == DEFAULT_SELBKCOLOUR)
ModernDeleteSetting(NULL, module, "SelBkColour");
else
ModernWriteSettingDword(NULL, module, "SelBkColour", col);
@@ -1810,7 +1810,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
int retval = CallService(MS_UTILS_PATHTOABSOLUTE,
(WPARAM)dat->item[indx].filename,
(LPARAM)str);
- if(!retval || retval == CALLSERVICE_NOTFOUND)
+ if (!retval || retval == CALLSERVICE_NOTFOUND)
ModernWriteSettingString(NULL, module, "BkBitmap", dat->item[indx].filename);
else
ModernWriteSettingString(NULL, module, "BkBitmap", str);
@@ -2035,14 +2035,14 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar
SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETRANGE,0,MAKELONG(900,1));
SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETPOS,0,MAKELONG(ModernGetSettingWord(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),0));
- if(!IsWinVer2000Plus())
+ if (!IsWinVer2000Plus())
{
EnableWindow(GetDlgItem(hwndDlg,IDC_FADEINOUT),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSPARENT),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_DROPSHADOW),FALSE);
}
- if(!IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT))
+ if (!IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC11),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC12),FALSE);
diff --git a/plugins/Modernb/modern_clcpaint.cpp b/plugins/Modernb/modern_clcpaint.cpp
index bec3e0f6de..49483bc953 100644
--- a/plugins/Modernb/modern_clcpaint.cpp
+++ b/plugins/Modernb/modern_clcpaint.cpp
@@ -142,7 +142,7 @@ HFONT CLCPaint::ChangeToFont( HDC hdc, struct ClcData *dat, int id, int *fontHei
res = ( HFONT )SelectObject( hdc, dat->fontModernInfo[id].hFont );
SetTextColor( hdc, dat->fontModernInfo[id].colour );
- if( fontHeight )
+ if ( fontHeight )
*fontHeight = dat->fontModernInfo[id].fontHeight;
ske_ResetTextEffect( hdc );
@@ -169,7 +169,7 @@ int CLCPaint::GetBasicFontID( struct ClcContact * contact )
return FONTID_CLOSEDGROUPS;
break;
case CLCIT_INFO:
- if( contact->flags & CLCIIF_GROUPFONT )
+ if ( contact->flags & CLCIIF_GROUPFONT )
return FONTID_OPENGROUPS;
else
return FONTID_CONTACTS;
@@ -306,42 +306,42 @@ void CLCPaint::_FillQuickHash()
void CLCPaint::_SetHotTrackColour( HDC hdc, struct ClcData *dat )
{
- if( dat->gammaCorrection ) {
+ if ( dat->gammaCorrection ) {
COLORREF oldCol, newCol;
int oldLum, newLum;
oldCol = GetTextColor( hdc );
oldLum = ( GetRValue( oldCol )*30+GetGValue( oldCol )*59+GetBValue( oldCol )*11 )/100;
newLum = ( GetRValue( dat->hotTextColour )*30+GetGValue( dat->hotTextColour )*59+GetBValue( dat->hotTextColour )*11 )/100;
- if( newLum == 0 ) {
+ if ( newLum == 0 ) {
SetTextColor( hdc, dat->hotTextColour );
return;
}
- if( newLum>= oldLum+20 ) {
+ if ( newLum>= oldLum+20 ) {
oldLum+= 20;
newCol = RGB( GetRValue( dat->hotTextColour )*oldLum/newLum, GetGValue( dat->hotTextColour )*oldLum/newLum, GetBValue( dat->hotTextColour )*oldLum/newLum );
}
- else if( newLum<= oldLum ) {
+ else if ( newLum<= oldLum ) {
int r, g, b;
r = GetRValue( dat->hotTextColour )*oldLum/newLum;
g = GetGValue( dat->hotTextColour )*oldLum/newLum;
b = GetBValue( dat->hotTextColour )*oldLum/newLum;
- if( r>255 ) {
+ if ( r>255 ) {
g+= ( r-255 )*3/7;
b+= ( r-255 )*3/7;
r = 255;
}
- if( g>255 ) {
+ if ( g>255 ) {
r+= ( g-255 )*59/41;
- if( r>255 ) r = 255;
+ if ( r>255 ) r = 255;
b+= ( g-255 )*59/41;
g = 255;
}
- if( b>255 ) {
+ if ( b>255 ) {
r+= ( b-255 )*11/89;
- if( r>255 ) r = 255;
+ if ( r>255 ) r = 255;
g+= ( b-255 )*11/89;
- if( g>255 ) g = 255;
+ if ( g>255 ) g = 255;
b = 255;
}
newCol = RGB( r, g, b );
@@ -378,11 +378,11 @@ int CLCPaint::_GetGeneralisedStatus()
for ( int i = 0; i<pcli->hClcProtoCount; i++ )
{
int thisStatus = pcli->clcProto[i].dwStatus;
- if( thisStatus == ID_STATUS_INVISIBLE )
+ if ( thisStatus == ID_STATUS_INVISIBLE )
return ID_STATUS_INVISIBLE;
int thisOnlineness = _GetStatusOnlineness( thisStatus );
- if( thisOnlineness > statusOnlineness )
+ if ( thisOnlineness > statusOnlineness )
{
status = thisStatus;
statusOnlineness = thisOnlineness;
@@ -734,7 +734,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
if ( Drawing->type == CLCIT_CONTACT )
pdnce = ( PDNCE )pcli->pfnGetCacheEntry( Drawing->hContact );
- if( Drawing->type == CLCIT_GROUP &&
+ if ( Drawing->type == CLCIT_GROUP &&
Drawing->group->parent->groupId == 0 &&
Drawing->group->parent->cl.items[0] != Drawing )
{
@@ -770,12 +770,12 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
// Store pos
if ( dat->text_rtl != 0 ) _RTLRect( &p_rect, free_row_rc.right, dx );
Drawing->pos_icon = p_rect;
- if( hottrack )
+ if ( hottrack )
{
colourFg = dat->hotTextColour;
mode = ILD_NORMAL;
}
- else if( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
+ else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
{
colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
mode = ILD_BLEND50;
@@ -813,11 +813,11 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
int count = 0;
RECT rc;
int x = 0;
- for( iImage = dat->extraColumnsCount-1; iImage>= 0 ; iImage-- )
+ for ( iImage = dat->extraColumnsCount-1; iImage>= 0 ; iImage-- )
{
COLORREF colourFg = dat->selBkColour;
int mode = BlendedInActiveState?BlendValue:ILD_NORMAL;
- if( Drawing->iExtraImage[iImage] == 0xFF && Drawing->iWideExtraImage[iImage] == 0xFFFF )
+ if ( Drawing->iExtraImage[iImage] == 0xFF && Drawing->iWideExtraImage[iImage] == 0xFFFF )
{
{
x+= ( x>0 )?dat->extraColumnSpacing:ICON_HEIGHT;
@@ -829,13 +829,13 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
continue;
}
- if( selected ) mode = BlendedInActiveState?ILD_NORMAL:ILD_SELECTED;
- else if( hottrack )
+ if ( selected ) mode = BlendedInActiveState?ILD_NORMAL:ILD_SELECTED;
+ else if ( hottrack )
{
mode = BlendedInActiveState?ILD_NORMAL:ILD_FOCUS;
colourFg = dat->hotTextColour;
}
- else if( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
+ else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
{
colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
mode = BlendValue;
@@ -881,7 +881,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
int space_width = 0;
char * szCounts = pcli->pfnGetGroupCountsText( dat, Drawing );
// Has to draw the count?
- if( szCounts && strlen( szCounts )>0 )
+ if ( szCounts && strlen( szCounts )>0 )
{
// calc width and height
ChangeToFont( hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
@@ -935,28 +935,28 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
- //if( !( szCounts && strlen( szCounts )>0 ) )
+ //if ( !( szCounts && strlen( szCounts )>0 ) )
//uTextFormat|= ( dat->row_align_group_mode == 2 )?DT_RIGHT:( dat->row_align_group_mode == 1 )?DT_CENTER:DT_LEFT;
uTextFormat|= DT_VCENTER;
ChangeToFont( hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPS:FONTID_CLOSEDGROUPS, NULL );
if ( selected )
SetTextColor( hdcMem, dat->selTextColour );
- else if( hottrack )
+ else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
if ( dat->text_rtl != 0 ) _RTLRect( &nameRect, free_row_rc.right, dx );
_DrawTextSmiley( hdcMem, &nameRect, &text_size, Drawing->szText, lstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
- if( selected && dat->szQuickSearch[0] != '\0' )
+ if ( selected && dat->szQuickSearch[0] != '\0' )
{
SetTextColor( hdcMem, dat->quickSearchColour );
_DrawTextSmiley( hdcMem, &nameRect, &text_size, Drawing->szText, lstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
}
- if( szCounts && strlen( szCounts )>0 )
+ if ( szCounts && strlen( szCounts )>0 )
{
ChangeToFont( hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
if ( selected )
SetTextColor( hdcMem, dat->selTextColour );
- else if( hottrack )
+ else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
if ( dat->text_rtl != 0 ) _RTLRect( &countRect, free_row_rc.right, dx );
ske_DrawTextA( hdcMem, szCounts, lstrlenA( szCounts ), &countRect, uTextFormat );
@@ -974,7 +974,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
szCounts = pcli->pfnGetGroupCountsText( dat, Drawing );
// Has to draw the count?
- if( szCounts && szCounts[0] )
+ if ( szCounts && szCounts[0] )
{
RECT space_rc = fr_rc;
@@ -1018,11 +1018,11 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
// Set color
if ( selected )
SetTextColor( hdcMem, dat->selTextColour );
- else if( hottrack )
+ else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
if ( dat->text_rtl != 0 ) _RTLRect( &text_rect, free_row_rc.right, dx );
_DrawTextSmiley( hdcMem, &text_rect, &text_size, Drawing->szText, lstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
- if( selected && dat->szQuickSearch[0] != '\0' )
+ if ( selected && dat->szQuickSearch[0] != '\0' )
{
SetTextColor( hdcMem, dat->quickSearchColour );
_DrawTextSmiley( hdcMem, &text_rect, &text_size, Drawing->szText, lstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
@@ -1104,10 +1104,10 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
{
if ( selected )
SetTextColor( hdcMem, dat->selTextColour );
- else if( hottrack )
+ else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
_DrawTextSmiley( hdcMem, &p_rect, &text_size, Drawing->szText, lstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
- if( selected && dat->szQuickSearch[0] != '\0' )
+ if ( selected && dat->szQuickSearch[0] != '\0' )
{
SetTextColor( hdcMem, dat->quickSearchColour );
_DrawTextSmiley( hdcMem, &p_rect, &text_size, Drawing->szText, lstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
@@ -1130,7 +1130,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
int space_width = 0;
char * szCounts = pcli->pfnGetGroupCountsText( dat, Drawing );
// Has to draw the count?
- if( szCounts && strlen( szCounts )>0 )
+ if ( szCounts && strlen( szCounts )>0 )
{
@@ -1186,27 +1186,27 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
- //if( !( szCounts && strlen( szCounts )>0 ) )
+ //if ( !( szCounts && strlen( szCounts )>0 ) )
//uTextFormat|= ( dat->row_align_group_mode == 2 )?DT_RIGHT:( dat->row_align_group_mode == 1 )?DT_CENTER:DT_LEFT;
uTextFormat|= DT_VCENTER;
ChangeToFont( hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPS:FONTID_CLOSEDGROUPS, NULL );
if ( selected )
SetTextColor( hdcMem, dat->selTextColour );
- else if( hottrack )
+ else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
_DrawTextSmiley( hdcMem, &nameRect, &text_size, Drawing->szText, lstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
- if( selected && dat->szQuickSearch[0] != '\0' )
+ if ( selected && dat->szQuickSearch[0] != '\0' )
{
SetTextColor( hdcMem, dat->quickSearchColour );
_DrawTextSmiley( hdcMem, &nameRect, &text_size, Drawing->szText, lstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
}
- if( szCounts && strlen( szCounts )>0 )
+ if ( szCounts && strlen( szCounts )>0 )
{
ChangeToFont( hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
if ( selected )
SetTextColor( hdcMem, dat->selTextColour );
- else if( hottrack )
+ else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
ske_DrawTextA( hdcMem, szCounts, lstrlenA( szCounts ), &countRect, uTextFormat );
}
@@ -1300,12 +1300,12 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
int mode;
// Store pos
Drawing->pos_icon = p_rect;
- if( hottrack )
+ if ( hottrack )
{
colourFg = dat->hotTextColour;
mode = ILD_NORMAL;
}
- else if( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
+ else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
{
colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
mode = ILD_BLEND50;
@@ -1333,9 +1333,9 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
{
BOOL hasAvatar = ( dat->use_avatar_service && Drawing->avatar_data != NULL ) ||( !dat->use_avatar_service && Drawing->avatar_pos != AVATAR_POS_DONT_HAVE );
BYTE blendmode = 255;
- if( hottrack )
+ if ( hottrack )
blendmode = 255;
- else if( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
+ else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
blendmode = 128;
if ( Drawing->type == CLCIT_CONTACT && dat->showIdle && ( Drawing->flags&CONTACTF_IDLE ) &&
_GetRealStatus( Drawing, ID_STATUS_OFFLINE ) != ID_STATUS_OFFLINE )
@@ -1349,12 +1349,12 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
int mode;
// Store pos
Drawing->pos_icon = p_rect;
- if( hottrack )
+ if ( hottrack )
{
colourFg = dat->hotTextColour;
mode = ILD_NORMAL;
}
- else if( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
+ else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
{
colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
mode = ILD_BLEND50;
@@ -1568,11 +1568,11 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
int count = 0;
RECT rc;
int x = 0;
- for( iImage = 0; iImage<dat->extraColumnsCount ; iImage++ )
+ for ( iImage = 0; iImage<dat->extraColumnsCount ; iImage++ )
{
COLORREF colourFg = dat->selBkColour;
int mode = BlendedInActiveState?BlendValue:ILD_NORMAL;
- if( Drawing->iExtraImage[iImage] == 0xFF && Drawing->iWideExtraImage[iImage] == 0xFFFF )
+ if ( Drawing->iExtraImage[iImage] == 0xFF && Drawing->iWideExtraImage[iImage] == 0xFFFF )
{
if ( !dat->MetaIgnoreEmptyExtra )
{
@@ -1585,13 +1585,13 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
continue;
}
- if( selected ) mode = BlendedInActiveState?ILD_NORMAL:ILD_SELECTED;
- else if( hottrack )
+ if ( selected ) mode = BlendedInActiveState?ILD_NORMAL:ILD_SELECTED;
+ else if ( hottrack )
{
mode = BlendedInActiveState?ILD_NORMAL:ILD_FOCUS;
colourFg = dat->hotTextColour;
}
- else if( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
+ else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
{
colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
mode = BlendValue;
@@ -1635,13 +1635,13 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str
if ( mode2 != -1 ) mode = mode2;
else
{
- if( selected ) mode = BlendedInActiveState?ILD_NORMAL:ILD_SELECTED;
- else if( hottrack )
+ if ( selected ) mode = BlendedInActiveState?ILD_NORMAL:ILD_SELECTED;
+ else if ( hottrack )
{
mode = BlendedInActiveState?ILD_NORMAL:ILD_FOCUS;
colourFg = dat->hotTextColour;
}
- else if( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
+ else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
{
colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
mode = BlendValue;
@@ -1713,7 +1713,7 @@ void CLCPaint::_DrawStatusIcon( struct ClcContact * Drawing, struct ClcData *dat
BOOL CLCPaint::_DrawNonEnginedBackground( HWND hwnd, HDC hdcMem, RECT * rcPaint, RECT clRect, struct ClcData * dat )
{
- if( dat->hBmpBackground )
+ if ( dat->hBmpBackground )
{
BITMAP bmp;
HBITMAP oldbm;
@@ -1734,8 +1734,8 @@ BOOL CLCPaint::_DrawNonEnginedBackground( HWND hwnd, HDC hdcMem, RECT * rcPaint,
maxy = dat->backgroundBmpUse&CLBF_TILEV?maxy = rcPaint->bottom:y+1;
switch( dat->backgroundBmpUse&CLBM_TYPE ) {
case CLB_STRETCH:
- if( dat->backgroundBmpUse&CLBF_PROPORTIONAL ) {
- if( clRect.right*bmp.bmHeight<clRect.bottom*bmp.bmWidth ) {
+ if ( dat->backgroundBmpUse&CLBF_PROPORTIONAL ) {
+ if ( clRect.right*bmp.bmHeight<clRect.bottom*bmp.bmWidth ) {
desth = clRect.bottom;
destw = desth*bmp.bmWidth/bmp.bmHeight;
}
@@ -1750,7 +1750,7 @@ BOOL CLCPaint::_DrawNonEnginedBackground( HWND hwnd, HDC hdcMem, RECT * rcPaint,
}
break;
case CLB_STRETCHH:
- if( dat->backgroundBmpUse&CLBF_PROPORTIONAL ) {
+ if ( dat->backgroundBmpUse&CLBF_PROPORTIONAL ) {
destw = clRect.right;
desth = destw*bmp.bmHeight/bmp.bmWidth;
}
@@ -1765,7 +1765,7 @@ BOOL CLCPaint::_DrawNonEnginedBackground( HWND hwnd, HDC hdcMem, RECT * rcPaint,
}
break;
case CLB_STRETCHV:
- if( dat->backgroundBmpUse&CLBF_PROPORTIONAL ) {
+ if ( dat->backgroundBmpUse&CLBF_PROPORTIONAL ) {
desth = clRect.bottom;
destw = desth*bmp.bmWidth/bmp.bmHeight;
}
@@ -1783,9 +1783,9 @@ BOOL CLCPaint::_DrawNonEnginedBackground( HWND hwnd, HDC hdcMem, RECT * rcPaint,
}
break;
}
- for( ;y<maxy;y+= desth ) {
- if( y<rcPaint->top-desth ) continue;
- for( x = 0;x<maxx;x+= destw )
+ for ( ;y<maxy;y+= desth ) {
+ if ( y<rcPaint->top-desth ) continue;
+ for ( x = 0;x<maxx;x+= destw )
StretchBlt( hdcMem, x, y, destw, desth, hdcBmp, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY );
}
SelectObject( hdcBmp, oldbm );
@@ -1811,12 +1811,12 @@ int CLCPaint::_DetermineDrawMode( HWND hWnd, struct ClcData *dat )
LONG lStyle = GetWindowLong( hWnd, GWL_STYLE );
int nStatus = _GetGeneralisedStatus();
- if( ( lStyle & WS_DISABLED )
+ if ( ( lStyle & WS_DISABLED )
|| ( dat->greyoutFlags & pcli->pfnClcStatusToPf2( nStatus ) )
|| ( ( dat->greyoutFlags & GREYF_UNFOCUS) && ( GetFocus() != hWnd ) ) )
paintMode |= DM_GRAY;
- if( lStyle&CLS_GREYALTERNATE )
+ if ( lStyle&CLS_GREYALTERNATE )
paintMode |= DM_GREYALTERNATE;
return paintMode;
@@ -1928,7 +1928,7 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo
{
group = group->parent;
indent--;
- if( group == NULL ) break; // Finished list
+ if ( group == NULL ) break; // Finished list
group->scanIndex++;
continue;
}
@@ -2043,7 +2043,7 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo
if ( selected || hottrack )
{
RECT mrc = row_rc;
- if( Drawing->type == CLCIT_GROUP &&
+ if ( Drawing->type == CLCIT_GROUP &&
Drawing->group->parent->groupId == 0 &&
Drawing->group->parent->cl.items[0] != Drawing )
{
@@ -2054,14 +2054,14 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo
{
if ( selected )
SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL , ID = Selection " );
- if( hottrack )
+ if ( hottrack )
SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=HotTracking" );
}
else if ( dat->HiLightMode == 2 ) // Less
{
if ( selected )
SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=Selection" ); //instead of free_row_rc
- if( hottrack )
+ if ( hottrack )
SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=HotTracking" );
}
}
@@ -2070,13 +2070,13 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo
else
{
int checkboxWidth;
- if( ( lStyle&CLS_CHECKBOXES && Drawing->type == CLCIT_CONTACT ) ||
+ if ( ( lStyle&CLS_CHECKBOXES && Drawing->type == CLCIT_CONTACT ) ||
( lStyle&CLS_GROUPCHECKBOXES && Drawing->type == CLCIT_GROUP ) ||
( Drawing->type == CLCIT_INFO && Drawing->flags&CLCIIF_CHECKBOX ) )
checkboxWidth = dat->checkboxSize+2;
else checkboxWidth = 0;
//background
- if( selected ) {
+ if ( selected ) {
switch ( dat->HiLightMode )
{
case 0:
@@ -2112,7 +2112,7 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo
}
// **** Checkboxes
- if( ( lStyle&CLS_CHECKBOXES && Drawing->type == CLCIT_CONTACT ) ||
+ if ( ( lStyle&CLS_CHECKBOXES && Drawing->type == CLCIT_CONTACT ) ||
( lStyle&CLS_GROUPCHECKBOXES && Drawing->type == CLCIT_GROUP ) ||
( Drawing->type == CLCIT_INFO && Drawing->flags&CLCIIF_CHECKBOX ) )
{
@@ -2144,7 +2144,7 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo
mpRequest->pl_Params[1].dwValueHash = mod_CalcHash( "Ovl" );
{
RECT mrc = row_rc;
- if( Drawing->type == CLCIT_GROUP &&
+ if ( Drawing->type == CLCIT_GROUP &&
Drawing->group->parent->groupId == 0 &&
Drawing->group->parent->cl.items[0] != Drawing )
{
@@ -2171,7 +2171,7 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo
if ( subindex == -1 && group->scanIndex<group->cl.count )
{
- if( group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded )
+ if ( group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded )
{
group = group->cl.items[group->scanIndex]->group;
indent++;
@@ -2226,12 +2226,12 @@ void CLCPaint::_DrawInsertionMark( struct ClcData * dat, RECT& clRect, _PaintCon
void CLCPaint::_CopyPaintToDest( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc )
{
- if( !( paintMode&DM_GRAY ) && ( paintMode & DM_DRAW_OFFSCREEN ) )
+ if ( !( paintMode&DM_GRAY ) && ( paintMode & DM_DRAW_OFFSCREEN ) )
{
BitBlt( hdc, rcPaint->left, rcPaint->top, rcPaint->right-rcPaint->left, rcPaint->bottom-rcPaint->top, pc.hdcMem, rcPaint->left, rcPaint->top, SRCCOPY );
}
- if( ( paintMode&DM_GRAY ) && hdc && hdc != pc.hdcMem )
+ if ( ( paintMode&DM_GRAY ) && hdc && hdc != pc.hdcMem )
{
BLENDFUNCTION bf = {AC_SRC_OVER, 0, 80, AC_SRC_ALPHA };
BOOL a = ( ( paintMode&DM_GRAY ) && ( ( paintMode&DM_NON_LAYERED) ) );
@@ -2242,7 +2242,7 @@ void CLCPaint::_CopyPaintToDest( HWND hWnd, struct ClcData * dat, HDC hdc, int p
}
void CLCPaint::_FreePaintContext( _PaintContext& pc )
{
- if( pc.hBrushAlternateGrey ) DeleteObject( pc.hBrushAlternateGrey );
+ if ( pc.hBrushAlternateGrey ) DeleteObject( pc.hBrushAlternateGrey );
SelectObject( pc.hdcMem, (HFONT) GetStockObject( DEFAULT_GUI_FONT ) );
if ( pc.fRelease&_PaintContext::release_hdcmem )
{
@@ -2287,7 +2287,7 @@ void CLCPaint::_PaintClc( HWND hwnd, struct ClcData *dat, HDC hdc, RECT *_rcPain
_DrawLines( hwnd, dat, hdc, paintMode, rcPaint, clRect, pc );
//insertion mark
- if( dat->iInsertionMark != -1 )
+ if ( dat->iInsertionMark != -1 )
_DrawInsertionMark( dat, clRect, pc );
// BitBlt from memory to destination
@@ -2557,9 +2557,9 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct
int count = 0;
RECT rc;
- for( iImage = dat->extraColumnsCount-1 ; iImage >= 0 ; iImage -- )
+ for ( iImage = dat->extraColumnsCount-1 ; iImage >= 0 ; iImage -- )
{
- if( Drawing->iExtraImage[iImage] != 0xFF || Drawing->iWideExtraImage[iImage] != 0xFFFF || !dat->MetaIgnoreEmptyExtra )
+ if ( Drawing->iExtraImage[iImage] != 0xFF || Drawing->iWideExtraImage[iImage] != 0xFFFF || !dat->MetaIgnoreEmptyExtra )
{
rc = _GetRectangle( dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
left, dat->extraColumnSpacing, dat->extraColumnSpacing, ICON_HEIGHT, 0 );
@@ -2632,7 +2632,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct
szCounts = pcli->pfnGetGroupCountsText( dat, Drawing );
// Has to draw the count?
- if( szCounts && szCounts[0] )
+ if ( szCounts && szCounts[0] )
{
RECT space_rc = free_row_rc;
RECT counts_rc = free_row_rc;
@@ -2854,7 +2854,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct
_StoreItemPos( Drawing, CIT_TEXT, &rc );
// Has to draw the count?
- if( counts_size.cx > 0 )
+ if ( counts_size.cx > 0 )
{
RECT counts_rc = text_rc;
//counts_size.cx;
@@ -2964,17 +2964,17 @@ void CLCPaint::_GetBlendMode( IN struct ClcData *dat, IN struct ClcContact * Dra
int mode;
int BlendedInActiveState = ( dat->dbbBlendInActiveState );
int BlendValue = dat->dbbBlend25 ? ILD_BLEND25 : ILD_BLEND50;
- if( selected && ( bFlag&GIM_SELECTED_AFFECT ) )
+ if ( selected && ( bFlag&GIM_SELECTED_AFFECT ) )
{
colourFg = dat->selBkColour;
mode = BlendedInActiveState?ILD_NORMAL:ILD_SELECTED;
}
- else if( hottrack && ( bFlag&GIM_HOT_AFFECT ) )
+ else if ( hottrack && ( bFlag&GIM_HOT_AFFECT ) )
{
mode = BlendedInActiveState?ILD_NORMAL:ILD_FOCUS;
colourFg = dat->hotTextColour;
}
- else if( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST && ( bFlag&GIM_TEMP_AFFECT ) )
+ else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST && ( bFlag&GIM_TEMP_AFFECT ) )
{
colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
mode = BlendValue;
@@ -3153,7 +3153,7 @@ void CLCPaint::_DrawContactText( HDC hdcMem, struct ClcData *dat, struct ClcCont
ChangeToFont( hdcMem, dat, GetBasicFontID( Drawing ), NULL );
if ( selected )
SetTextColor( hdcMem, dat->force_in_dialog ? GetSysColor( COLOR_HIGHLIGHTTEXT ) : dat->selTextColour );
- else if( hottrack )
+ else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
if ( Drawing->type == CLCIT_GROUP )
@@ -3193,12 +3193,12 @@ void CLCPaint::_DrawContactSubText( HDC hdcMem, struct ClcData *dat, struct ClcC
char * szCounts = pcli->pfnGetGroupCountsText( dat, Drawing );
// Has to draw the count?
- if( szCounts && szCounts[0] )
+ if ( szCounts && szCounts[0] )
{
ChangeToFont( hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
if ( selected )
SetTextColor( hdcMem, dat->selTextColour );
- else if( hottrack )
+ else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
ske_DrawTextA( hdcMem, szCounts, -1, prcItem, uTextFormat );
ske_ResetTextEffect( hdcMem );
@@ -3214,7 +3214,7 @@ void CLCPaint::_DrawContactSubText( HDC hdcMem, struct ClcData *dat, struct ClcC
//draw second and third line
if ( selected )
SetTextColor( hdcMem, dat->selTextColour );
- else if( hottrack )
+ else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
uTextFormat|= DT_VCENTER;
if ( itemType == CIT_SUBTEXT1 )
@@ -3248,7 +3248,7 @@ void CLCPaint::_DrawContactSelection( HDC hdcMem, struct ClcData *dat, struct Cl
{
if ( selected )
SkinDrawGlyph( hdcMem, prcItem, rcPaint, "Contact List/Selection" );
- else if( hottrack )
+ else if ( hottrack )
SkinDrawGlyph( hdcMem, prcItem, rcPaint, "Contact List/HotTracking" );
}
}
diff --git a/plugins/Modernb/modern_clcutils.cpp b/plugins/Modernb/modern_clcutils.cpp
index 4b2dc8e798..f389a937b6 100644
--- a/plugins/Modernb/modern_clcutils.cpp
+++ b/plugins/Modernb/modern_clcutils.cpp
@@ -149,7 +149,7 @@ void cliScrollTo(HWND hwnd,struct ClcData *dat,int desty,int noSmooth)
if(desty>maxy) desty=maxy;
if(desty<0) desty=0;
if(abs(desty-dat->yScroll)<4) noSmooth=1;
- if(!noSmooth && dat->exStyle&CLS_EX_NOSMOOTHSCROLLING) noSmooth=1;
+ if (!noSmooth && dat->exStyle&CLS_EX_NOSMOOTHSCROLLING) noSmooth=1;
previousy=dat->yScroll;
BOOL keyDown = ( ( GetKeyState( VK_UP )
@@ -161,14 +161,14 @@ void cliScrollTo(HWND hwnd,struct ClcData *dat,int desty,int noSmooth)
| GetKeyState( VK_HOME )
| GetKeyState( VK_END ) ) & 0x8000 );
- if(!noSmooth && !keyDown)
+ if (!noSmooth && !keyDown)
{
startTick=GetTickCount();
- for(;;) {
+ for (;;) {
nowTick=GetTickCount();
if(nowTick>=startTick+dat->scrollTime) break;
dat->yScroll=oldy+(desty-oldy)*(int)(nowTick-startTick)/dat->scrollTime;
- if(/*dat->backgroundBmpUse&CLBF_SCROLL || dat->hBmpBackground==NULL &&*/FALSE)
+ if (/*dat->backgroundBmpUse&CLBF_SCROLL || dat->hBmpBackground==NULL &&*/FALSE)
ScrollWindowEx(hwnd,0,previousy-dat->yScroll,NULL,NULL,NULL,NULL,SW_INVALIDATE);
else
{
@@ -182,7 +182,7 @@ void cliScrollTo(HWND hwnd,struct ClcData *dat,int desty,int noSmooth)
}
}
dat->yScroll=desty;
- if((dat->backgroundBmpUse&CLBF_SCROLL || dat->hBmpBackground==NULL) && FALSE)
+ if ((dat->backgroundBmpUse&CLBF_SCROLL || dat->hBmpBackground==NULL) && FALSE)
ScrollWindowEx(hwnd,0,previousy-dat->yScroll,NULL,NULL,NULL,NULL,SW_INVALIDATE);
else
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
@@ -367,7 +367,7 @@ int GetDropTargetInformation(HWND hwnd,struct ClcData *dat,POINT pt)
dat->selection=dat->iDragItem;
dat->iInsertionMark=-1;
dat->nInsertionLevel=0;
- if(!PtInRect(&clRect,pt)) return DROPTARGET_OUTSIDE;
+ if (!PtInRect(&clRect,pt)) return DROPTARGET_OUTSIDE;
hit=cliHitTest(hwnd,dat,pt.x,pt.y,&contact,&group,&hitFlags);
cliGetRowByIndex(dat,dat->iDragItem,&movecontact,&movegroup);
@@ -431,7 +431,7 @@ int GetDropTargetInformation(HWND hwnd,struct ClcData *dat,POINT pt)
group=bottomgroup;
if (bottomcontact==movecontact || group==movecontact->group) return DROPTARGET_ONSELF;
dat->nInsertionLevel=-1; // decreasing here
- for(;group;group=group->parent)
+ for (;group;group=group->parent)
{
dat->nInsertionLevel++;
if (group==movecontact->group) return DROPTARGET_ONSELF;
@@ -450,7 +450,7 @@ int GetDropTargetInformation(HWND hwnd,struct ClcData *dat,POINT pt)
if(movecontact->type==CLCIT_GROUP)
{ //check not moving onto its own subgroup
dat->iInsertionMark=hit+1;
- for(;group;group=group->parent)
+ for (;group;group=group->parent)
{
dat->nInsertionLevel++;
if(group==movecontact->group) return DROPTARGET_ONSELF;
@@ -480,9 +480,9 @@ void LoadCLCFonts( HWND hwnd, struct ClcData *dat )
HDC hdc=GetDC(hwnd);
HFONT holdfont = (HFONT)GetCurrentObject( hdc, OBJ_FONT );
- for( int i = 0 ; i <= FONTID_MODERN_MAX; i++ )
+ for ( int i = 0 ; i <= FONTID_MODERN_MAX; i++ )
{
- if( !dat->fontModernInfo[i].changed && dat->fontModernInfo[i].hFont )
+ if ( !dat->fontModernInfo[i].changed && dat->fontModernInfo[i].hFont )
{
DeleteObject(dat->fontModernInfo[i].hFont);
}
@@ -718,13 +718,13 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat )
if (g_CluiData.fDisableSkinEngine)
{
DBVARIANT dbv;
- if(!dat->bkChanged)
+ if (!dat->bkChanged)
{
dat->bkColour=sttGetColor("CLC","BkColour",GetSysColor(COLOR_3DFACE));
{
if(ModernGetSettingByte(NULL,"CLC","UseBitmap",CLCDEFAULT_USEBITMAP))
{
- if(!ModernGetSettingString(NULL,"CLC","BkBitmap",&dbv))
+ if (!ModernGetSettingString(NULL,"CLC","BkBitmap",&dbv))
{
dat->hBmpBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
ModernDBFreeVariant(&dbv);
@@ -740,7 +740,7 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat )
dat->MenuTextHiColor=sttGetColor("Menu","SelTextColour",CLCDEFAULT_MODERN_SELTEXTCOLOUR);
if(ModernGetSettingByte(NULL,"Menu","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if(!ModernGetSettingString(NULL,"Menu","BkBitmap",&dbv)) {
+ if (!ModernGetSettingString(NULL,"Menu","BkBitmap",&dbv)) {
dat->hMenuBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
//mir_free_and_nill(dbv.pszVal);
ModernDBFreeVariant(&dbv);
@@ -755,7 +755,7 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat )
dat->selTextColour=ModernGetSettingDword(NULL,"CLC","SelTextColour",CLCDEFAULT_MODERN_SELTEXTCOLOUR);
dat->hotTextColour=ModernGetSettingDword(NULL,"CLC","HotTextColour",CLCDEFAULT_MODERN_HOTTEXTCOLOUR);
dat->quickSearchColour=ModernGetSettingDword(NULL,"CLC","QuickSearchColour",CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR);
- if(!g_szMetaModuleName && ServiceExists(MS_MC_GETPROTOCOLNAME)) g_szMetaModuleName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
+ if (!g_szMetaModuleName && ServiceExists(MS_MC_GETPROTOCOLNAME)) g_szMetaModuleName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
dat->IsMetaContactsEnabled=(!(GetWindowLong(hwnd,GWL_STYLE)&CLS_MANUALUPDATE)) &&
g_szMetaModuleName && ModernGetSettingByte(NULL,g_szMetaModuleName,"Enabled",1) && ServiceExists(MS_MC_GETDEFAULTCONTACT);
diff --git a/plugins/Modernb/modern_clistevents.cpp b/plugins/Modernb/modern_clistevents.cpp
index 9208ff8c16..e6cadaa02e 100644
--- a/plugins/Modernb/modern_clistevents.cpp
+++ b/plugins/Modernb/modern_clistevents.cpp
@@ -289,7 +289,7 @@ static int ehhEventAreaBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
DBVARIANT dbv;
event_area.bkColour=sttGetColor("EventArea","BkColour",CLCDEFAULT_BKCOLOUR);
if(ModernGetSettingByte(NULL,"EventArea","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if(!ModernGetSettingString(NULL,"EventArea","BkBitmap",&dbv)) {
+ if (!ModernGetSettingString(NULL,"EventArea","BkBitmap",&dbv)) {
event_area.hBmpBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
ModernDBFreeVariant(&dbv);
}
@@ -409,7 +409,7 @@ static void EventArea_HideShowNotifyFrame()
if(desired)
{
- if(!dwVisible)
+ if (!dwVisible)
CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)hNotifyFrame, 0);
}
else
diff --git a/plugins/Modernb/modern_clistmod.cpp b/plugins/Modernb/modern_clistmod.cpp
index 781f2f2896..c22f5550e1 100644
--- a/plugins/Modernb/modern_clistmod.cpp
+++ b/plugins/Modernb/modern_clistmod.cpp
@@ -521,7 +521,7 @@ int cliShowHide(WPARAM wParam,LPARAM lParam)
return 0;
}
- if( (bShow == TRUE || lParam == 1) )
+ if ( (bShow == TRUE || lParam == 1) )
{
Sync( CLUIFrames_ActivateSubContainers, TRUE );
CLUI_ShowWindowMod(pcli->hwndContactList, SW_RESTORE);
diff --git a/plugins/Modernb/modern_clistopts.cpp b/plugins/Modernb/modern_clistopts.cpp
index f778426c37..5d8576dd2f 100644
--- a/plugins/Modernb/modern_clistopts.cpp
+++ b/plugins/Modernb/modern_clistopts.cpp
@@ -404,7 +404,7 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa
SendDlgItemMessage(hwndDlg, IDC_AVATAR_BORDER_COLOR, CPM_SETCOLOUR, 0, (COLORREF)ModernGetSettingDword(NULL,"CList","AvatarsBorderColor",SETTINGS_AVATARBORDERCOLOR_DEFAULT));
- if(!IsDlgButtonChecked(hwndDlg,IDC_SHOW_AVATARS))
+ if (!IsDlgButtonChecked(hwndDlg,IDC_SHOW_AVATARS))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_DRAW_BORDER),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR_L),FALSE);
@@ -427,16 +427,16 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_SIZE_PIXELS3),FALSE);
EnableWindow( GetDlgItem( hwndDlg, IDC_AVATAR_FASTDRAW), FALSE );
}
- if( !IsDlgButtonChecked( hwndDlg, IDC_SHOW_ANIAVATARS ) )
+ if ( !IsDlgButtonChecked( hwndDlg, IDC_SHOW_ANIAVATARS ) )
{
EnableWindow( GetDlgItem( hwndDlg, IDC_AVATAR_FASTDRAW), FALSE );
}
- if(!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_DRAW_BORDER))
+ if (!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_DRAW_BORDER))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR_L),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR),FALSE);
}
- if(!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_ROUND_CORNERS))
+ if (!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_ROUND_CORNERS))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE),FALSE);
@@ -447,7 +447,7 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN),FALSE);
}
- if(!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_OVERLAY_ICONS))
+ if (!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_OVERLAY_ICONS))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_OVERLAY_ICON_NORMAL),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_OVERLAY_ICON_PROTOCOL),FALSE);
@@ -1466,7 +1466,7 @@ INT_PTR CALLBACK DlgProcExtraIconsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
case WM_MOUSEMOVE:
{
- if(!dragging) break;
+ if (!dragging) break;
{
TVHITTESTINFO hti;
hti.pt.x=(short)LOWORD(lParam);
@@ -1496,7 +1496,7 @@ INT_PTR CALLBACK DlgProcExtraIconsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
case WM_LBUTTONUP:
{
- if(!dragging) break;
+ if (!dragging) break;
TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),NULL,0);
dragging=0;
ReleaseCapture();
diff --git a/plugins/Modernb/modern_clistsettings.cpp b/plugins/Modernb/modern_clistsettings.cpp
index c251d2b21a..f04e0a860e 100644
--- a/plugins/Modernb/modern_clistsettings.cpp
+++ b/plugins/Modernb/modern_clistsettings.cpp
@@ -248,7 +248,7 @@ void cliFreeCacheItem( pdisplayNameCacheEntry p )
void FreeDisplayNameCache(SortedList *list)
{
int i;
- for( i=0; i < list->realCount; i++) {
+ for ( i=0; i < list->realCount; i++) {
FreeDisplayNameCacheItem(( pdisplayNameCacheEntry )list->items[i] );
mir_free_and_nill(list->items[i]);
}
@@ -616,7 +616,7 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
}
}
- if(!strcmp(cws->szModule,"CList"))
+ if (!strcmp(cws->szModule,"CList"))
{
//name is null or (setting is myhandle)
if (!strcmp(cws->szSetting,"Rate"))
@@ -642,15 +642,15 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
}
pcli->pfnClcBroadcast(CLM_AUTOREBUILD,0, 0);
}
- else if(!strcmp(cws->szSetting,"noOffline"))
+ else if (!strcmp(cws->szSetting,"noOffline"))
{
InvalidateDNCEbyPointer((HANDLE)wParam,pdnce,cws->value.type);
pcli->pfnClcBroadcast(CLM_AUTOREBUILD,0, 0);
}
}
- else if(!strcmp(cws->szModule,"Protocol"))
+ else if (!strcmp(cws->szModule,"Protocol"))
{
- if(!strcmp(cws->szSetting,"p"))
+ if (!strcmp(cws->szSetting,"p"))
{
char *szProto;
InvalidateDNCEbyPointer((HANDLE)wParam,pdnce,cws->value.type);
diff --git a/plugins/Modernb/modern_clisttray.cpp b/plugins/Modernb/modern_clisttray.cpp
index de84dfea09..f94e25a668 100644
--- a/plugins/Modernb/modern_clisttray.cpp
+++ b/plugins/Modernb/modern_clisttray.cpp
@@ -99,7 +99,7 @@ INT_PTR CListTray_GetGlobalStatus(WPARAM wparam,LPARAM lparam)
int connectingCount=0;
for (i=0;i<pcli->hClcProtoCount;i++)
{
- if(!pcli->pfnGetProtocolVisibility(pcli->clcProto[i].szProto)) continue;
+ if (!pcli->pfnGetProtocolVisibility(pcli->clcProto[i].szProto)) continue;
if (pcli->clcProto[i].dwStatus>=ID_STATUS_CONNECTING &&
pcli->clcProto[i].dwStatus<ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
{
@@ -175,7 +175,7 @@ void cliTrayIconUpdateBase(const char *szChangedProto)
for(i=0,netProtoCount=0;i<count;i++) {
if ( pcli->pfnGetProtocolVisibility(accs[i]->szModuleName)==0 ) continue;
netProtoCount++;
- if(!lstrcmpA(szChangedProto,accs[i]->szModuleName)) pcli->cycleStep=i;
+ if (!lstrcmpA(szChangedProto,accs[i]->szModuleName)) pcli->cycleStep=i;
if(averageMode==0) averageMode=CallProtoService(accs[i]->szModuleName,PS_GETSTATUS,0,0);
else if(averageMode!=CallProtoService(accs[i]->szModuleName,PS_GETSTATUS,0,0)) {averageMode=-1; break;}
}
diff --git a/plugins/Modernb/modern_clui.cpp b/plugins/Modernb/modern_clui.cpp
index 0de5249cc6..4ee09030ff 100644
--- a/plugins/Modernb/modern_clui.cpp
+++ b/plugins/Modernb/modern_clui.cpp
@@ -998,7 +998,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName)
char szRelativePath[MAX_PATH];
GetModuleFileNameA(GetModuleHandle(NULL), szRelativePath, MAX_PATH);
char *str = strrchr( szRelativePath, '\\' );
- if( str != NULL ) *str=0;
+ if ( str != NULL ) *str=0;
CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)szRelativePath, (LPARAM)szFolderPath);
}
@@ -1588,13 +1588,13 @@ int CLUI_TestCursorOnBorders()
{
case 1:
case 2:
- if(!g_CluiData.fDocked||(g_CluiData.fDocked==2 && k==1)||(g_CluiData.fDocked==1 && k==2)){hCurs1 = LoadCursor(NULL, IDC_SIZEWE); break;}
- case 3: if(!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENS); break;}
- case 4: if(!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENWSE); break;}
- case 5: if(!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENESW); break;}
- case 6: if(!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENS); break;}
- case 7: if(!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENESW); break;}
- case 8: if(!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENWSE); break;}
+ if (!g_CluiData.fDocked||(g_CluiData.fDocked==2 && k==1)||(g_CluiData.fDocked==1 && k==2)){hCurs1 = LoadCursor(NULL, IDC_SIZEWE); break;}
+ case 3: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENS); break;}
+ case 4: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENWSE); break;}
+ case 5: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENESW); break;}
+ case 6: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENS); break;}
+ case 7: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENESW); break;}
+ case 8: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENWSE); break;}
}
if (hCurs1) SetCursor(hCurs1);
return k;
@@ -2046,8 +2046,8 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam )
GetWindowRect(m_hWnd, &rc);
CheckFramesPos(&rc);
Sync(CLUIFrames_OnMoving,m_hWnd,&rc);
- if(!IsIconic(m_hWnd)) {
- if(!CallService(MS_CLIST_DOCKINGISDOCKED,0,0))
+ if (!IsIconic(m_hWnd)) {
+ if (!CallService(MS_CLIST_DOCKINGISDOCKED,0,0))
{ //if g_CluiData.fDocked, dont remember pos (except for width)
ModernWriteSettingDword(NULL,"CList","Height",(DWORD)(rc.bottom - rc.top));
ModernWriteSettingDword(NULL,"CList","x",(DWORD)rc.left);
@@ -2087,7 +2087,7 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam )
}
// ske_RedrawCompleteWindow();
- if(!CallService(MS_CLIST_DOCKINGISDOCKED,0,0))
+ if (!CallService(MS_CLIST_DOCKINGISDOCKED,0,0))
{ //if g_CluiData.fDocked, dont remember pos (except for width)
ModernWriteSettingDword(NULL,"CList","Height",(DWORD)(rc.bottom - rc.top));
ModernWriteSettingDword(NULL,"CList","x",(DWORD)rc.left);
@@ -2431,7 +2431,7 @@ LRESULT CLUI::OnAutoAlphaTimer( UINT msg, WPARAM wParam, LPARAM lParam )
CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)(g_bTransparentFlag?ModernGetSettingByte(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT):255), 1);
}
}
- if(!bTransparentFocus) KillTimer(m_hWnd,TM_AUTOALPHA);
+ if (!bTransparentFocus) KillTimer(m_hWnd,TM_AUTOALPHA);
return TRUE;
}
LRESULT CLUI::OnSmoothAlphaTransitionTimer( UINT msg, WPARAM wParam, LPARAM lParam )
@@ -2620,7 +2620,7 @@ LRESULT CLUI::OnNcHitTest( UINT msg, WPARAM wParam, LPARAM lParam )
LRESULT result;
result=DefWindowProc(m_hWnd,WM_NCHITTEST,wParam,lParam);
- if( (g_CluiData.fAutoSize) && ( result == HTSIZE || result == HTTOP ||
+ if ( (g_CluiData.fAutoSize) && ( result == HTSIZE || result == HTTOP ||
result == HTTOPLEFT || result == HTTOPRIGHT ||
result==HTBOTTOM || result==HTBOTTOMRIGHT ||
result==HTBOTTOMLEFT) )
@@ -2876,7 +2876,7 @@ LRESULT CLUI::OnClickNotify( NMCLISTCONTROL * pnmc )
};
if(hItem && !(hitFlags&CLCHT_NOWHERE))
return DefCluiWndProc( WM_NOTIFY, 0, (LPARAM)pnmc );
- if((hitFlags&(CLCHT_NOWHERE|CLCHT_INLEFTMARGIN|CLCHT_BELOWITEMS))==0)
+ if ((hitFlags&(CLCHT_NOWHERE|CLCHT_INLEFTMARGIN|CLCHT_BELOWITEMS))==0)
return DefCluiWndProc( WM_NOTIFY, 0, (LPARAM)pnmc );
if (ModernGetSettingByte(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT)) {
POINT pt;
diff --git a/plugins/Modernb/modern_cluiframes.cpp b/plugins/Modernb/modern_cluiframes.cpp
index 4da12ab2f2..41f1754f81 100644
--- a/plugins/Modernb/modern_cluiframes.cpp
+++ b/plugins/Modernb/modern_cluiframes.cpp
@@ -121,7 +121,7 @@ int CLUIFrames_OnMoving( HWND hwnd, RECT * r)
{
int i;
g_CluiData.mutexPreventDockMoving=0;
- for(i=0;i<g_nFramesCount;i++){
+ for(i=0;i<g_nFramesCount;i++) {
if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow!=NULL &&g_pfwFrames[i].OwnerWindow!=(HWND)-2)
{
@@ -151,7 +151,7 @@ int SetAlpha(BYTE Alpha)
{
int i;
- for(i=0;i<g_nFramesCount;i++){
+ for(i=0;i<g_nFramesCount;i++) {
if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow!=NULL &&g_pfwFrames[i].OwnerWindow!=(HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide )
{
@@ -160,7 +160,7 @@ int SetAlpha(BYTE Alpha)
{
long l;
l=GetWindowLong(hwnd,GWL_EXSTYLE);
- if(!(l&WS_EX_LAYERED))
+ if (!(l&WS_EX_LAYERED))
{
HWND parent=NULL;
if (g_CluiData.fOnDesktop)
@@ -220,7 +220,7 @@ int CLUIFrames_SetParentForContainers( HWND parent )
g_CluiData.fOnDesktop=1;
else
g_CluiData.fOnDesktop=0;
- for(i=0;i<g_nFramesCount;i++){
+ for(i=0;i<g_nFramesCount;i++) {
if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow!=(HWND)0 &&g_pfwFrames[i].OwnerWindow!=(HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide )
{
HWND hwnd=g_pfwFrames[i].OwnerWindow;
@@ -234,7 +234,7 @@ int CLUIFrames_OnShowHide( HWND hwnd, int mode )
{
int i;
int prevFrameCount;
- for(i=0;i<g_nFramesCount;i++){
+ for(i=0;i<g_nFramesCount;i++) {
if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow!=(HWND)0 &&g_pfwFrames[i].OwnerWindow!=(HWND)-2)
{
{
@@ -743,7 +743,7 @@ static int LocateStorePosition(int Frameid,int maxstored)
if(g_pfwFrames[Frameid].Name==NULL)
return -1;
char settingname[255];
- for( int i=0;i<maxstored;i++)
+ for ( int i=0;i<maxstored;i++)
{
mir_snprintf(settingname,SIZEOF(settingname),"Name%d",i);
@@ -751,7 +751,7 @@ static int LocateStorePosition(int Frameid,int maxstored)
if ( ModernGetSettingTString( NULL, CLUIFrameModule, settingname, &dbv ) )
continue;
- if( lstrcmpi( dbv.ptszVal, g_pfwFrames[Frameid].Name ) ==0 )
+ if ( lstrcmpi( dbv.ptszVal, g_pfwFrames[Frameid].Name ) ==0 )
{
ModernDBFreeVariant( &dbv );
return i;
@@ -813,7 +813,7 @@ static int CLUIFramesGetalClientFrame(void)
int i;
if (_fCluiFramesModuleNotStarted) return -1;
- if( _nClientFrameId != eUnknownId ) {
+ if ( _nClientFrameId != eUnknownId ) {
/* this value could become invalid if RemoveItemFromList was called,
* so we double-check */
if (_nClientFrameId<g_nFramesCount) {
@@ -1037,8 +1037,8 @@ static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam)
ModifyMItem((WPARAM)_hmiFloating,(LPARAM)&mi);
mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if( g_CluiData.fLayered ) mi.flags|=CMIF_GRAYED;
- else if((g_pfwFrames[pos].UseBorder)) mi.flags|=CMIF_CHECKED;
+ if ( g_CluiData.fLayered ) mi.flags|=CMIF_GRAYED;
+ else if ((g_pfwFrames[pos].UseBorder)) mi.flags|=CMIF_CHECKED;
ModifyMItem((WPARAM)_hmiBorder,(LPARAM)&mi);
mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
@@ -1056,7 +1056,7 @@ static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam)
mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
if(g_pfwFrames[pos].collapsed) mi.flags|=CMIF_CHECKED;
- if((!g_pfwFrames[pos].visible)||(g_pfwFrames[pos].Locked)||(pos==CLUIFramesGetalClientFrame())) mi.flags|=CMIF_GRAYED;
+ if ((!g_pfwFrames[pos].visible)||(g_pfwFrames[pos].Locked)||(pos==CLUIFramesGetalClientFrame())) mi.flags|=CMIF_GRAYED;
ModifyMItem((WPARAM)_hmiColl,(LPARAM)&mi);
}
return 0;
@@ -1096,8 +1096,8 @@ static int CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam)
mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if( g_CluiData.fLayered ) mi.flags|=CMIF_GRAYED;
- else if((g_pfwFrames[pos].UseBorder)) mi.flags|=CMIF_CHECKED;
+ if ( g_CluiData.fLayered ) mi.flags|=CMIF_GRAYED;
+ else if ((g_pfwFrames[pos].UseBorder)) mi.flags|=CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIBorder,(LPARAM)&mi);
mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP|((g_pfwFrames[pos].align&alClient)?CMIF_GRAYED:0);
@@ -1131,7 +1131,7 @@ static int CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam)
mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
if(g_pfwFrames[pos].collapsed) mi.flags|=CMIF_CHECKED;
- if((!g_pfwFrames[pos].visible)||g_pfwFrames[pos].Locked||(pos==CLUIFramesGetalClientFrame())) mi.flags|=CMIF_GRAYED;
+ if ((!g_pfwFrames[pos].visible)||g_pfwFrames[pos].Locked||(pos==CLUIFramesGetalClientFrame())) mi.flags|=CMIF_GRAYED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIColl,(LPARAM)&mi);
}
@@ -1160,16 +1160,16 @@ static INT_PTR _us_DoGetFrameOptions(WPARAM wParam,LPARAM lParam)
case FO_FLAGS:
retval=0;
if(g_pfwFrames[pos].visible) retval|=F_VISIBLE;
- if(!g_pfwFrames[pos].collapsed) retval|=F_UNCOLLAPSED;
+ if (!g_pfwFrames[pos].collapsed) retval|=F_UNCOLLAPSED;
if(g_pfwFrames[pos].Locked) retval|=F_LOCKED;
if(g_pfwFrames[pos].TitleBar.ShowTitleBar) retval|=F_SHOWTB;
if(g_pfwFrames[pos].TitleBar.ShowTitleBarTip) retval|=F_SHOWTBTIP;
if (!g_CluiData.fLayered)
{
- if(!(GetWindowLong(g_pfwFrames[pos].hWnd,GWL_STYLE)&WS_BORDER)) retval|=F_NOBORDER;
+ if (!(GetWindowLong(g_pfwFrames[pos].hWnd,GWL_STYLE)&WS_BORDER)) retval|=F_NOBORDER;
}
else
- if(!g_pfwFrames[pos].UseBorder) retval|=F_NOBORDER;
+ if (!g_pfwFrames[pos].UseBorder) retval|=F_NOBORDER;
break;
@@ -1287,7 +1287,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam)
style=(int)GetWindowLong(g_pfwFrames[pos].hWnd,GWL_STYLE);
style&=(~WS_BORDER);
- if( !(flag&F_NOBORDER ) && !g_CluiData.fLayered ) style|=WS_BORDER;
+ if ( !(flag&F_NOBORDER ) && !g_CluiData.fLayered ) style|=WS_BORDER;
SetWindowLong(g_pfwFrames[pos].hWnd,GWL_STYLE,(long)style);
SetWindowLong(g_pfwFrames[pos].TitleBar.hwnd,GWL_STYLE,(long)style& ~(WS_VSCROLL | WS_HSCROLL));
@@ -1373,7 +1373,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam)
int oldHeight=g_pfwFrames[pos].height;
retval=g_pfwFrames[pos].height;
g_pfwFrames[pos].height=lParam;
- if(!CLUIFramesFitInSize()) g_pfwFrames[pos].height=retval;
+ if (!CLUIFramesFitInSize()) g_pfwFrames[pos].height=retval;
retval=g_pfwFrames[pos].height;
if (g_pfwFrames[pos].height != oldHeight)
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,(LPARAM)0);
@@ -1382,7 +1382,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam)
{
retval=g_pfwFrames[pos].HeightWhenCollapsed;
g_pfwFrames[pos].HeightWhenCollapsed=lParam;
- if(!CLUIFramesFitInSize()) g_pfwFrames[pos].HeightWhenCollapsed=retval;
+ if (!CLUIFramesFitInSize()) g_pfwFrames[pos].HeightWhenCollapsed=retval;
retval=g_pfwFrames[pos].HeightWhenCollapsed;
}
@@ -1407,7 +1407,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam)
return (-1);
};
- if((lParam&alClient)&&(CLUIFramesGetalClientFrame()>=0)) { //only one alClient frame possible
+ if ((lParam&alClient)&&(CLUIFramesGetalClientFrame()>=0)) { //only one alClient frame possible
_nClientFrameId = eUnknownId;//recalc it
return -1;
@@ -1697,7 +1697,7 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam)
{
RECT rc;
if(CallService(MS_CLIST_DOCKINGISDOCKED,0,0)) {return 0;};
- if(!g_CluiData.fDocked && g_CluiData.fAutoSize) {return 0;};
+ if (!g_CluiData.fDocked && g_CluiData.fAutoSize) {return 0;};
GetWindowRect(pcli->hwndContactList,&rc);
if(g_pfwFrames[FrameId].collapsed==TRUE) {
@@ -1740,7 +1740,7 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam)
if (!g_pfwFrames[FrameId].floating)
{
- if(!CLUIFramesFitInSize()) {
+ if (!CLUIFramesFitInSize()) {
//cant collapse,we can resize only for height<alclient frame height
int alfrm=CLUIFramesGetalClientFrame();
@@ -1754,7 +1754,7 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam)
{
int i,sumheight=0;
for(i=0;i<g_nFramesCount;i++) {
- if((g_pfwFrames[i].align!=alClient)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)) {
+ if ((g_pfwFrames[i].align!=alClient)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)) {
sumheight+=(g_pfwFrames[i].height)+(g_nTitleBarHeight*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar))+2;
return FALSE;
}
@@ -1893,7 +1893,7 @@ static int _us_DoAddFrame(WPARAM wParam,LPARAM lParam)
if(pcli->hwndContactList==0) return -1;
if (_fCluiFramesModuleNotStarted) return -1;
if(clfrm->cbSize!=sizeof(CLISTFrame)) return -1;
- if(!(_hTitleBarFont)) _hTitleBarFont = CLUILoadTitleBarFont();
+ if (!(_hTitleBarFont)) _hTitleBarFont = CLUILoadTitleBarFont();
g_pfwFrames=(FRAMEWND*)realloc(g_pfwFrames,sizeof(FRAMEWND)*(g_nFramesCount+1));
@@ -2222,7 +2222,7 @@ static BOOL CLUIFramesFitInSize(void)
tbh=g_nTitleBarHeight*btoint(g_pfwFrames[clientfrm].TitleBar.ShowTitleBar);
for(i=0;i<g_nFramesCount;i++) {
- if((g_pfwFrames[i].align!=alClient)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)) {
+ if ((g_pfwFrames[i].align!=alClient)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)) {
sumheight+=(g_pfwFrames[i].height)+(g_nTitleBarHeight*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar))+2/*+btoint(Frames[i].UseBorder)*2*/;
if(sumheight>_nContactListHeight-tbh-2)
{
@@ -2245,7 +2245,7 @@ int CLUIFrames_GetTotalHeight()
for(i=0;i<g_nFramesCount;i++)
{
- if((g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating)&&(pcli->hwndContactTree)&& (g_pfwFrames[i].hWnd!=pcli->hwndContactTree))
+ if ((g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating)&&(pcli->hwndContactTree)&& (g_pfwFrames[i].hWnd!=pcli->hwndContactTree))
sumheight+=(g_pfwFrames[i].height)+(g_nTitleBarHeight*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar));
};
@@ -2280,7 +2280,7 @@ int CLUIFramesGetMinHeight()
for(i=0;i<g_nFramesCount;i++)
{
- if((g_pfwFrames[i].align!=alClient)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating))
+ if ((g_pfwFrames[i].align!=alClient)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating))
{
RECT wsize;
@@ -2361,8 +2361,8 @@ static int CLUIFramesResizeFrames(const RECT newsize)
while(sumheight>(newheight-tbh)&&drawitems>0) {
sumheight=0;
drawitems=0;
- for(i=0;i<g_nFramesCount;i++){
- if(((g_pfwFrames[i].align!=alClient))&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)) {
+ for(i=0;i<g_nFramesCount;i++) {
+ if (((g_pfwFrames[i].align!=alClient))&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)) {
drawitems++;
curfrmtbh=(g_nTitleBarHeight+g_CluiData.nGapBetweenTitlebar)*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar);
sumheight+=(g_pfwFrames[i].height)+curfrmtbh+(i > 0 ? sepw : 0)+( (g_pfwFrames[i].UseBorder &&!g_CluiData.fLayered)?2:0);
@@ -2381,7 +2381,7 @@ static int CLUIFramesResizeFrames(const RECT newsize)
for(j=0;j<g_nFramesCount;j++) {
//move all alTop frames
i=sdarray[j].realpos;
- if((!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(g_pfwFrames[i].align==alTop)) {
+ if ((!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(g_pfwFrames[i].align==alTop)) {
curfrmtbh=(g_nTitleBarHeight+g_CluiData.nGapBetweenTitlebar)*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar);
g_pfwFrames[i].wndSize.top=prevframebottomline+(i > 0 ? sepw : 0)+(curfrmtbh);
g_pfwFrames[i].wndSize.bottom=g_pfwFrames[i].height+g_pfwFrames[i].wndSize.top+((g_pfwFrames[i].UseBorder &&!g_CluiData.fLayered)?2:0);
@@ -2396,10 +2396,10 @@ static int CLUIFramesResizeFrames(const RECT newsize)
}
if(sumheight<newheight) {
- for(j=0;j<g_nFramesCount;j++){
+ for(j=0;j<g_nFramesCount;j++) {
//move alClient frame
i=sdarray[j].realpos;
- if((!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(g_pfwFrames[i].align==alClient)) {
+ if ((!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(g_pfwFrames[i].align==alClient)) {
int oldh;
g_pfwFrames[i].wndSize.top=prevframebottomline+(j > 0 ? sepw : 0)+(tbh);
g_pfwFrames[i].wndSize.bottom=g_pfwFrames[i].wndSize.top+newheight-sumheight-tbh-(j > 0 ? sepw : 0);
@@ -2424,7 +2424,7 @@ static int CLUIFramesResizeFrames(const RECT newsize)
for(j=g_nFramesCount-1;j>=0;j--) {
//move all alBottom frames
i=sdarray[j].realpos;
- if((g_pfwFrames[i].visible)&&(!g_pfwFrames[i].floating)&&(!g_pfwFrames[i].needhide)&&(g_pfwFrames[i].align==alBottom)) {
+ if ((g_pfwFrames[i].visible)&&(!g_pfwFrames[i].floating)&&(!g_pfwFrames[i].needhide)&&(g_pfwFrames[i].align==alBottom)) {
curfrmtbh=(g_nTitleBarHeight+g_CluiData.nGapBetweenTitlebar)*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar);
g_pfwFrames[i].wndSize.bottom=prevframebottomline-(j > 0 ? sepw : 0);
@@ -2474,7 +2474,7 @@ int CLUIFrames_ApplyNewSizes(int mode)
{
int i;
g_CluiData.mutexPreventDockMoving=0;
- for(i=0;i<g_nFramesCount;i++){
+ for(i=0;i<g_nFramesCount;i++) {
if ( (mode==1 && g_pfwFrames[i].OwnerWindow!=(HWND)-2 && g_pfwFrames[i].OwnerWindow) ||
(mode==2 && g_pfwFrames[i].OwnerWindow==(HWND)-2) ||
(mode==3) )
@@ -2501,9 +2501,9 @@ static int _us_DoUpdateFrame(WPARAM wParam,LPARAM lParam)
if(lParam&FU_FMPOS) CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,1);
int pos = id2pos( wParam );
- if( pos < 0 || pos >= g_nFramesCount ) { return -1; }
- if( lParam&FU_TBREDRAW ) CLUIFramesForceUpdateTB( &g_pfwFrames[pos] );
- if( lParam&FU_FMREDRAW ) CLUIFramesForceUpdateFrame( &g_pfwFrames[pos] );
+ if ( pos < 0 || pos >= g_nFramesCount ) { return -1; }
+ if ( lParam&FU_TBREDRAW ) CLUIFramesForceUpdateTB( &g_pfwFrames[pos] );
+ if ( lParam&FU_FMREDRAW ) CLUIFramesForceUpdateFrame( &g_pfwFrames[pos] );
return 0;
}
@@ -2781,7 +2781,7 @@ int OnFrameTitleBarBackgroundChange(WPARAM wParam,LPARAM lParam)
if (g_CluiData.fDisableSkinEngine)
{
if(ModernGetSettingByte(NULL,"FrameTitleBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if(!ModernGetSettingString(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
+ if (!ModernGetSettingString(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
hBmpBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
//mir_free_and_nill(dbv.pszVal);
ModernDBFreeVariant(&dbv);
@@ -2900,7 +2900,7 @@ void DrawBackGround(HWND hwnd,HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColou
break;
}
desth=clRect.bottom -clRect.top;
- for(;y<maxy;y+=desth) {
+ for (;y<maxy;y+=desth) {
if(y<rcPaint->top-desth) continue;
for(x=0;x<maxx;x+=destw)
StretchBlt(hdcMem,x,y,destw,desth,hdcBmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY);
@@ -3461,7 +3461,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
if(newh>0) {
prevold=g_pfwFrames[Framemod].height;
g_pfwFrames[Framemod].height=newh;
- if(!CLUIFramesFitInSize()) { g_pfwFrames[Framemod].height=prevold; return TRUE;}
+ if (!CLUIFramesFitInSize()) { g_pfwFrames[Framemod].height=prevold; return TRUE;}
g_pfwFrames[Framemod].height=newh;
if(newh>3) g_pfwFrames[Framemod].collapsed=TRUE;
@@ -3898,7 +3898,7 @@ static int _us_DoSetFrameFloat(WPARAM wParam,LPARAM lParam)
int pos = id2pos( wParam );
- if( pos >= 0&& pos < g_nFramesCount )
+ if ( pos >= 0&& pos < g_nFramesCount )
if (g_pfwFrames[pos].floating || (lParam&2))
{
@@ -4226,7 +4226,7 @@ int CLUIFrames_SetLayeredMode( BOOL fLayeredMode, HWND hwnd )
int CLUIFrames_UpdateBorders()
{
- for( int i = 0; i < g_nFramesCount; i++ )
+ for ( int i = 0; i < g_nFramesCount; i++ )
{
if ( !g_pfwFrames[i].floating )
{
diff --git a/plugins/Modernb/modern_contact.cpp b/plugins/Modernb/modern_contact.cpp
index 58fd7759f4..1184bfda1d 100644
--- a/plugins/Modernb/modern_contact.cpp
+++ b/plugins/Modernb/modern_contact.cpp
@@ -89,7 +89,7 @@ int GetProtoIndex(char * szName)
if (!szName) return -1;
ProtoEnumAccounts( &accCount, &accs );
for (i=0; i<accCount; i++)
- if(!mir_strcmpi(szName,accs[i]->szModuleName))
+ if (!mir_strcmpi(szName,accs[i]->szModuleName))
return accs[i]->iOrder;
return -1;
}
@@ -176,7 +176,7 @@ int cliCompareContacts(const struct ClcContact *contact1,const struct ClcContact
INT_PTR ContactChangeGroup(WPARAM wParam,LPARAM lParam)
{
CallService(MS_CLUI_CONTACTDELETED,wParam,0);
- if((HANDLE)lParam==NULL)
+ if ((HANDLE)lParam==NULL)
ModernDeleteSetting((HANDLE)wParam,"CList","Group");
else
ModernWriteSettingTString((HANDLE)wParam,"CList","Group",pcli->pfnGetGroupName(lParam, NULL));
diff --git a/plugins/Modernb/modern_docking.cpp b/plugins/Modernb/modern_docking.cpp
index d49e15700e..a7ffe8e506 100644
--- a/plugins/Modernb/modern_docking.cpp
+++ b/plugins/Modernb/modern_docking.cpp
@@ -111,7 +111,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam)
if(msg->message==WM_DESTROY)
ModernWriteSettingByte(NULL,"CList","Docked",(BYTE)g_CluiData.fDocked);
- if(!g_CluiData.fDocked && msg->message!=WM_CREATE && msg->message!=WM_MOVING && msg->message!=WM_CREATEDOCKED && msg->message != WM_MOVE && msg->message != WM_SIZE) return 0;
+ if (!g_CluiData.fDocked && msg->message!=WM_CREATE && msg->message!=WM_MOVING && msg->message!=WM_CREATEDOCKED && msg->message != WM_MOVE && msg->message != WM_SIZE) return 0;
switch(msg->message) {
case WM_CREATE:
//if(GetSystemMetrics(SM_CMONITORS)>1) return 0;
@@ -185,7 +185,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam)
dock_drag_dy=rcWindow.top-ptCursor.y;
Docking_GetMonitorRectFromPoint(ptCursor,&rcMonitor);
- if(((ptCursor.x<rcMonitor.left+EDGESENSITIVITY)
+ if (((ptCursor.x<rcMonitor.left+EDGESENSITIVITY)
|| (ptCursor.x>=rcMonitor.right-EDGESENSITIVITY))
&& ModernGetSettingByte(NULL,"CLUI","DockToSides",SETTING_DOCKTOSIDES_DEFAULT))
{
@@ -272,7 +272,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam)
{
if(msg->lParam) return 0;
BOOL toBeDocked = (BOOL) ModernGetSettingByte(NULL,"CLUI","DockToSides",SETTING_DOCKTOSIDES_DEFAULT);
- if((msg->wParam && g_CluiData.fDocked<0) || (!msg->wParam && g_CluiData.fDocked>0)) g_CluiData.fDocked=-g_CluiData.fDocked;
+ if ((msg->wParam && g_CluiData.fDocked<0) || (!msg->wParam && g_CluiData.fDocked>0)) g_CluiData.fDocked=-g_CluiData.fDocked;
ZeroMemory(&abd,sizeof(abd));
abd.cbSize=sizeof(abd);
abd.hWnd=msg->hwnd;
@@ -305,7 +305,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam)
return 0;
}
case WM_SYSCOMMAND:
- if((msg->wParam&0xFFF0)!=SC_MOVE) return 0;
+ if ((msg->wParam&0xFFF0)!=SC_MOVE) return 0;
SetActiveWindow(msg->hwnd);
SetCapture(msg->hwnd);
draggingTitle=1;
@@ -313,11 +313,11 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam)
return TRUE;
case WM_MOUSEMOVE:
- if(!draggingTitle) return 0;
+ if (!draggingTitle) return 0;
{ RECT rc;
POINT pt;
GetClientRect(msg->hwnd,&rc);
- if(((g_CluiData.fDocked==DOCKED_LEFT || g_CluiData.fDocked==-DOCKED_LEFT) && (short)LOWORD(msg->lParam)>rc.right) ||
+ if (((g_CluiData.fDocked==DOCKED_LEFT || g_CluiData.fDocked==-DOCKED_LEFT) && (short)LOWORD(msg->lParam)>rc.right) ||
((g_CluiData.fDocked==DOCKED_RIGHT || g_CluiData.fDocked==-DOCKED_RIGHT) && (short)LOWORD(msg->lParam)<0)) {
ReleaseCapture();
draggingTitle=0;
diff --git a/plugins/Modernb/modern_extraimage.cpp b/plugins/Modernb/modern_extraimage.cpp
index e54abd2628..6f145d3c79 100644
--- a/plugins/Modernb/modern_extraimage.cpp
+++ b/plugins/Modernb/modern_extraimage.cpp
@@ -388,7 +388,7 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact)
{
for (i=0;i<maxpr;i++)
{
- if(!mir_strcmp(ImgIndex[i],szProto))
+ if (!mir_strcmp(ImgIndex[i],szProto))
{
SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_PROTO),i+3));
break;
diff --git a/plugins/Modernb/modern_popup.cpp b/plugins/Modernb/modern_popup.cpp
index 33eebada34..8fa33f370a 100644
--- a/plugins/Modernb/modern_popup.cpp
+++ b/plugins/Modernb/modern_popup.cpp
@@ -55,7 +55,7 @@ void ShowPopup(const char *title, const char *description, int type)
POPUPDATAEX ppd;
int ret;
- if(!ServiceExists(MS_POPUP_ADDPOPUPEX) || !EnablePopups)
+ if (!ServiceExists(MS_POPUP_ADDPOPUPEX) || !EnablePopups)
{
return;
}
diff --git a/plugins/Modernb/modern_rowheight_funcs.cpp b/plugins/Modernb/modern_rowheight_funcs.cpp
index 0518626b62..774f68531b 100644
--- a/plugins/Modernb/modern_rowheight_funcs.cpp
+++ b/plugins/Modernb/modern_rowheight_funcs.cpp
@@ -680,7 +680,7 @@ int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcCon
}
// Checkbox size
- if((style&CLS_CHECKBOXES && contact->type==CLCIT_CONTACT) ||
+ if ((style&CLS_CHECKBOXES && contact->type==CLCIT_CONTACT) ||
(style&CLS_GROUPCHECKBOXES && contact->type==CLCIT_GROUP) ||
(contact->type==CLCIT_INFO && contact->flags&CLCIIF_CHECKBOX))
{
diff --git a/plugins/Modernb/modern_rowtemplateopt.cpp b/plugins/Modernb/modern_rowtemplateopt.cpp
index 2fc93d5c1d..756382b0f8 100644
--- a/plugins/Modernb/modern_rowtemplateopt.cpp
+++ b/plugins/Modernb/modern_rowtemplateopt.cpp
@@ -544,9 +544,9 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
{
case IDC_ROWTREE:
- if( ((LPNMHDR)lParam)->code == NM_SETCURSOR )
+ if ( ((LPNMHDR)lParam)->code == NM_SETCURSOR )
rowOptShowSettings(hwndDlg);
- if( ((LPNMHDR)lParam)->code == NM_CLICK )
+ if ( ((LPNMHDR)lParam)->code == NM_CLICK )
RedrawWindow(hwndDlg,&da,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW);
break;
diff --git a/plugins/Modernb/modern_skineditor.cpp b/plugins/Modernb/modern_skineditor.cpp
index 0f3b95a9df..d98bf9728c 100644
--- a/plugins/Modernb/modern_skineditor.cpp
+++ b/plugins/Modernb/modern_skineditor.cpp
@@ -682,11 +682,11 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
// {
// DWORD tick=GetTickCount();
res=GetOpenFileNameA(&ofn);
-// if(!res)
+// if (!res)
// if (GetTickCount()-tick<100)
// {
// res=GetOpenFileNameA(&ofn);
-// if(!res) break;
+// if (!res) break;
// }
// else break;
//}
diff --git a/plugins/Modernb/modern_skinengine.cpp b/plugins/Modernb/modern_skinengine.cpp
index 54a6c8011c..242f429892 100644
--- a/plugins/Modernb/modern_skinengine.cpp
+++ b/plugins/Modernb/modern_skinengine.cpp
@@ -287,7 +287,7 @@ void IniParser::_DoInit()
void IniParser::_LoadResourceIni( HINSTANCE hInst, const char * resourceName, const char * resourceType )
{
- if( _eType != IT_UNKNOWN ) return;
+ if ( _eType != IT_UNKNOWN ) return;
HRSRC hRSrc = FindResourceA( hInst, resourceName, resourceType );
if ( !hRSrc ) return;
@@ -2962,7 +2962,7 @@ static BOOL ske_DrawTextEffect(BYTE* destPt,BYTE* maskPt, DWORD width, DWORD hei
static int ske_AlphaTextOut (HDC hDC, LPCTSTR lpString, int nCount, RECT * lpRect, UINT format, DWORD ARGBcolor)
{
- if( !( lpString && lpRect ) )
+ if ( !( lpString && lpRect ) )
{
DebugBreak();
return 0;
@@ -2982,7 +2982,7 @@ static int ske_AlphaTextOut (HDC hDC, LPCTSTR lpString, int nCount, RECT * lpRec
BYTE redCf = ModernGetSettingByte(NULL,"ModernData","AlphaTextOutRed Correction", 77 );
BYTE greenCf = ModernGetSettingByte(NULL,"ModernData","AlphaTextOutGreen Correction", 151 );
- for( int i = 0; i < 256; i++ )
+ for ( int i = 0; i < 256; i++ )
{
gammaTbl[i]= (BYTE)( 255 * pow( (double)i / 255, gammaCfPw ) );
blueMulTbl[i] = i * blueCf;
@@ -3168,7 +3168,7 @@ static int ske_AlphaTextOut (HDC hDC, LPCTSTR lpString, int nCount, RECT * lpRec
pDestScanLine = bits + lineBytes;
pBufScanLine = bufbits + lineBytes;
- for( x = 2; x < width - 2; x++)
+ for ( x = 2; x < width - 2; x++)
{
pix = pDestScanLine + ( x<<2 );
bufpix = pBufScanLine + ( x<<2 );
@@ -3710,7 +3710,7 @@ static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam)
GetClientRect(frm->hWnd,&r);
r2=CreateRectRgn(r.left,r.top,r.right,r.bottom);
}
- if(!frm->UpdateRgn)
+ if (!frm->UpdateRgn)
{
frm->UpdateRgn=CreateRectRgn(0,0,1,1);
CombineRgn(frm->UpdateRgn,r2,0,RGN_COPY);
diff --git a/plugins/Modernb/modern_skinopt.cpp b/plugins/Modernb/modern_skinopt.cpp
index aac4aff2ba..adbbc6a895 100644
--- a/plugins/Modernb/modern_skinopt.cpp
+++ b/plugins/Modernb/modern_skinopt.cpp
@@ -233,11 +233,11 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
{
DWORD tick = GetTickCount( );
res = GetOpenFileName( &ofn );
- if( !res )
+ if ( !res )
if ( GetTickCount( )-tick<100 )
{
res = GetOpenFileName( &ofn );
- if( !res ) break;
+ if ( !res ) break;
}
else break;
}
@@ -374,7 +374,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
}
if ( !sd ) return 0;
- if( sd->File && !_tcschr( sd->File, _T('%') ) )
+ if ( sd->File && !_tcschr( sd->File, _T('%') ) )
{
GetPrivateProfileString( _T( "Skin_Description_Section" ), _T( "Author" ), TranslateT( "( unknown )" ), Author, SIZEOF( Author ), sd->File );
GetPrivateProfileString( _T( "Skin_Description_Section" ), _T( "URL" ), _T( "" ), URL, SIZEOF( URL ), sd->File );
diff --git a/plugins/Modernb/modern_skinselector.cpp b/plugins/Modernb/modern_skinselector.cpp
index b7559fa440..aef06d5fb9 100644
--- a/plugins/Modernb/modern_skinselector.cpp
+++ b/plugins/Modernb/modern_skinselector.cpp
@@ -68,21 +68,21 @@ int SkinSelector_DeleteMask(MODERNMASK * mm)
BOOL wildcmpi(TCHAR* name, TCHAR* mask)
{
TCHAR* last='\0';
- for(;; mask++, name++)
+ for (;; mask++, name++)
{
- if(*mask != '?' && _qtoupper(*mask) != _qtoupper(*name)) break;
- if(*name == '\0') return ((BOOL)!*mask);
+ if (*mask != '?' && _qtoupper(*mask) != _qtoupper(*name)) break;
+ if (*name == '\0') return ((BOOL)!*mask);
}
- if(*mask != '*') return FALSE;
- for(;; mask++, name++)
+ if (*mask != '*') return FALSE;
+ for (;; mask++, name++)
{
while(*mask == '*')
{
last = mask++;
- if(*mask == '\0') return ((BOOL)!*mask); /* true */
+ if (*mask == '\0') return ((BOOL)!*mask); /* true */
}
- if(*name == '\0') return ((BOOL)!*mask); /* *mask == EOS */
- if(*mask != '?' && _qtoupper(*mask) != _qtoupper(*name) ) name -= (size_t)(mask - last) - 1, mask = last;
+ if (*name == '\0') return ((BOOL)!*mask); /* *mask == EOS */
+ if (*mask != '?' && _qtoupper(*mask) != _qtoupper(*name) ) name -= (size_t)(mask - last) - 1, mask = last;
}
}
@@ -90,21 +90,21 @@ BOOL wildcmpi(TCHAR* name, TCHAR* mask)
BOOL wildcmpi(char * name, char * mask)
{
char * last='\0';
- for(;; mask++, name++)
+ for (;; mask++, name++)
{
- if(*mask != '?' && _qtoupper(*mask) != _qtoupper(*name)) break;
- if(*name == '\0') return ((BOOL)!*mask);
+ if (*mask != '?' && _qtoupper(*mask) != _qtoupper(*name)) break;
+ if (*name == '\0') return ((BOOL)!*mask);
}
- if(*mask != '*') return FALSE;
- for(;; mask++, name++)
+ if (*mask != '*') return FALSE;
+ for (;; mask++, name++)
{
while(*mask == '*')
{
last = mask++;
- if(*mask == '\0') return ((BOOL)!*mask); /* true */
+ if (*mask == '\0') return ((BOOL)!*mask); /* true */
}
- if(*name == '\0') return ((BOOL)!*mask); /* *mask == EOS */
- if(*mask != '?' && _qtoupper(*mask) != _qtoupper(*name) ) name -= (size_t)(mask - last) - 1, mask = last;
+ if (*name == '\0') return ((BOOL)!*mask); /* *mask == EOS */
+ if (*mask != '?' && _qtoupper(*mask) != _qtoupper(*name) ) name -= (size_t)(mask - last) - 1, mask = last;
}
}
#endif
@@ -112,21 +112,21 @@ BOOL wildcmpi(char * name, char * mask)
BOOL __inline wildcmp(const char * name, const char * mask, BYTE option)
{
const char * last='\0';
- for(;; mask++, name++)
+ for (;; mask++, name++)
{
- if(*mask != '?' && *mask != *name) break;
- if(*name == '\0') return ((BOOL)!*mask);
+ if (*mask != '?' && *mask != *name) break;
+ if (*name == '\0') return ((BOOL)!*mask);
}
- if(*mask != '*') return FALSE;
- for(;; mask++, name++)
+ if (*mask != '*') return FALSE;
+ for (;; mask++, name++)
{
while(*mask == '*')
{
last = mask++;
- if(*mask == '\0') return ((BOOL)!*mask); /* true */
+ if (*mask == '\0') return ((BOOL)!*mask); /* true */
}
- if(*name == '\0') return ((BOOL)!*mask); /* *mask == EOS */
- if(*mask != '?' && *mask != *name) name -= (size_t)(mask - last) - 1, mask = last;
+ if (*name == '\0') return ((BOOL)!*mask); /* *mask == EOS */
+ if (*mask != '?' && *mask != *name) name -= (size_t)(mask - last) - 1, mask = last;
}
}
diff --git a/plugins/Modernb/modern_statusbar.cpp b/plugins/Modernb/modern_statusbar.cpp
index b3af74e802..5e7eb0bc3b 100644
--- a/plugins/Modernb/modern_statusbar.cpp
+++ b/plugins/Modernb/modern_statusbar.cpp
@@ -116,7 +116,7 @@ int LoadStatusBarData()
DBVARIANT dbv;
g_StatusBarData.bkColour=sttGetColor("StatusBar","BkColour",CLCDEFAULT_BKCOLOUR);
if(ModernGetSettingByte(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if(!ModernGetSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
+ if (!ModernGetSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
g_StatusBarData.hBmpBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
ModernDBFreeVariant(&dbv);
}
diff --git a/plugins/Modernb/modern_tbbutton.cpp b/plugins/Modernb/modern_tbbutton.cpp
index 74b2e9e3b0..8e4a146fa5 100644
--- a/plugins/Modernb/modern_tbbutton.cpp
+++ b/plugins/Modernb/modern_tbbutton.cpp
@@ -173,7 +173,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
lpSBData->pbState = 1;
InvalidateParentRect(lpSBData->hWnd, NULL, TRUE);
}
- if(!lpSBData->fSendOnDown)
+ if (!lpSBData->fSendOnDown)
SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM) hwndDlg);
return 0;
}
@@ -380,7 +380,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
lpSBData->nStateId = PBS_NORMAL;
InvalidateParentRect(lpSBData->hWnd, NULL, TRUE);
}
- if(!lpSBData->fSendOnDown && lpSBData->fHotMark)
+ if (!lpSBData->fSendOnDown && lpSBData->fHotMark)
SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM) hwndDlg);
lpSBData->fHotMark = FALSE;
break;
@@ -412,7 +412,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
}
else if ( inClient && lpSBData->nStateId == PBS_HOT && bPressed )
{
- if( lpSBData->fHotMark )
+ if ( lpSBData->fHotMark )
{
lpSBData->nStateId = PBS_PRESSED;
InvalidateParentRect(lpSBData->hWnd, NULL, TRUE);
@@ -524,7 +524,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
}
case BM_SETIMAGE:
{
- if(!lParam)
+ if (!lParam)
break;
if (wParam == IMAGE_ICON)
{
diff --git a/plugins/Modernb/modern_toolbar.cpp b/plugins/Modernb/modern_toolbar.cpp
index 44cf94da05..2746162ee1 100644
--- a/plugins/Modernb/modern_toolbar.cpp
+++ b/plugins/Modernb/modern_toolbar.cpp
@@ -274,7 +274,7 @@ static int ehhToolBarBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
DBVARIANT dbv;
tbdat.mtb_bkColour=sttGetColor("ToolBar","BkColour",CLCDEFAULT_BKCOLOUR);
if(ModernGetSettingByte(NULL,"ToolBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if(!ModernGetSettingString(NULL,"ToolBar","BkBitmap",&dbv)) {
+ if (!ModernGetSettingString(NULL,"ToolBar","BkBitmap",&dbv)) {
tbdat.mtb_hBmpBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
ModernDBFreeVariant(&dbv);
}
@@ -1244,7 +1244,7 @@ static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L
}
case WM_MOUSEMOVE:
{
- if(!dragging) break;
+ if (!dragging) break;
{
TVHITTESTINFO hti;
hti.pt.x=(short)LOWORD(lParam);
@@ -1273,7 +1273,7 @@ static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L
break;
case WM_LBUTTONUP:
{
- if(!dragging) break;
+ if (!dragging) break;
TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_BTNORDER),NULL,0);
dragging=0;
ReleaseCapture();
diff --git a/plugins/Modernb/modern_viewmodebar.cpp b/plugins/Modernb/modern_viewmodebar.cpp
index 4cb22d8c28..0af4d6ba28 100644
--- a/plugins/Modernb/modern_viewmodebar.cpp
+++ b/plugins/Modernb/modern_viewmodebar.cpp
@@ -568,7 +568,7 @@ static void UpdateFilters()
iLen = SendDlgItemMessageA(clvmHwnd, IDC_VIEWMODES, LB_GETTEXTLEN, clvm_curItem, 0);
- if( iLen == 0 )
+ if ( iLen == 0 )
return;
szTempBuf= (TCHAR *)mir_alloc((iLen + 1)*sizeof(TCHAR));
@@ -590,7 +590,7 @@ static void UpdateFilters()
if(ModernGetSettingTString(NULL, CLVM_MODULE, szSetting, &dbv_gf))
goto cleanup;
mir_snprintf(szSetting, 128, "%c%s_OPT", 246, szBuf);
- if((opt = ModernGetSettingDword(NULL, CLVM_MODULE, szSetting, -1)) != -1)
+ if ((opt = ModernGetSettingDword(NULL, CLVM_MODULE, szSetting, -1)) != -1)
{
SendDlgItemMessage(clvmHwnd, IDC_AUTOCLEARSPIN, UDM_SETPOS, 0, MAKELONG(LOWORD(opt), 0));
}
@@ -650,7 +650,7 @@ static void UpdateFilters()
int i;
for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
- if((1 << (i - ID_STATUS_OFFLINE)) & statusMask)
+ if ((1 << (i - ID_STATUS_OFFLINE)) & statusMask)
ListView_SetCheckState(hwndList, i - ID_STATUS_OFFLINE, TRUE)
else
ListView_SetCheckState(hwndList, i - ID_STATUS_OFFLINE, FALSE);
@@ -709,7 +709,7 @@ void DeleteViewMode( char * szName )
mir_snprintf(szSetting, 256, "%c%s_SSM", 246, szName);
ModernDeleteSetting(NULL, CLVM_MODULE, szSetting);
ModernDeleteSetting(NULL, CLVM_MODULE, szName);
- if(!strcmp(g_CluiData.current_viewmode, szName) && lstrlenA(szName) == lstrlenA(g_CluiData.current_viewmode))
+ if (!strcmp(g_CluiData.current_viewmode, szName) && lstrlenA(szName) == lstrlenA(g_CluiData.current_viewmode))
{
g_CluiData.bFilterEffective = 0;
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
@@ -1010,7 +1010,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
hItem = (HANDLE)SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
if(hItem==NULL) break;
- if(!(hitFlags&CLCHT_ONITEMEXTRA))
+ if (!(hitFlags&CLCHT_ONITEMEXTRA))
break;
iImage = SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
if(iImage == nullImage)
@@ -1297,7 +1297,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
KillTimer(hwnd, wParam);
- if(!g_CluiData.old_viewmode[0])
+ if (!g_CluiData.old_viewmode[0])
SendMessage(hwnd, WM_COMMAND, IDC_RESETMODES, 0);
else
ApplyViewMode((const char *)g_CluiData.old_viewmode);
@@ -1356,7 +1356,7 @@ clvm_reset_command:
case IDC_CONFIGUREMODES:
{
clvm_config_command:
- if(!g_ViewModeOptDlg)
+ if (!g_ViewModeOptDlg)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_OPT_VIEWMODES), 0, DlgProcViewModesSetup, 0);
break;
}
@@ -1428,7 +1428,7 @@ static int ehhViewModeBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
DBVARIANT dbv;
view_mode.bkColour=sttGetColor("ViewMode","BkColour",CLCDEFAULT_BKCOLOUR);
if(ModernGetSettingByte(NULL,"ViewMode","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if(!ModernGetSettingString(NULL,"ViewMode","BkBitmap",&dbv)) {
+ if (!ModernGetSettingString(NULL,"ViewMode","BkBitmap",&dbv)) {
view_mode.hBmpBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
ModernDBFreeVariant(&dbv);
}
@@ -1534,7 +1534,7 @@ void ApplyViewMode(const char *Name, bool onlySelector )
if ( !onlySelector )
{
mir_snprintf(szSetting, 256, "%c%s_PF", 246, name);
- if(!ModernGetSettingString(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ if (!ModernGetSettingString(NULL, CLVM_MODULE, szSetting, &dbv)) {
if(lstrlenA(dbv.pszVal) >= 2)
{
strncpy(g_CluiData.protoFilter, dbv.pszVal, SIZEOF(g_CluiData.protoFilter));
@@ -1544,7 +1544,7 @@ void ApplyViewMode(const char *Name, bool onlySelector )
mir_free(dbv.pszVal);
}
mir_snprintf(szSetting, 256, "%c%s_GF", 246, name);
- if(!ModernGetSettingTString(NULL, CLVM_MODULE, szSetting, &dbv))
+ if (!ModernGetSettingTString(NULL, CLVM_MODULE, szSetting, &dbv))
{
if(lstrlen(dbv.ptszVal) >= 2)
{
@@ -1566,7 +1566,7 @@ void ApplyViewMode(const char *Name, bool onlySelector )
/*
mir_snprintf(szSetting, 256, "%c%s_VA", 246, name);
- if(!DBGetContactSetting(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ if (!DBGetContactSetting(NULL, CLVM_MODULE, szSetting, &dbv)) {
strncpy(g_CluiData.varFilter, dbv.pszVal, sizeof(g_CluiData.varFilter));
g_CluiData.varFilter[sizeof(g_CluiData.varFilter) - 1] = 0;
if(lstrlenA(g_CluiData.varFilter) > 10 && ServiceExists(MS_VARS_FORMATSTRING))
@@ -1585,7 +1585,7 @@ void ApplyViewMode(const char *Name, bool onlySelector )
if(szProto) {
id = (char*) CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if(id) {
- if(!DBGetContactSetting(hContact, szProto, id, &dbv)) {
+ if (!DBGetContactSetting(hContact, szProto, id, &dbv)) {
if(dbv.type == DBVT_ASCIIZ) {
mir_snprintf(UIN, 256, "<%s:%s>", szProto, dbv.pszVal);
}
diff --git a/plugins/Mwclist/BkgrCfg.c b/plugins/Mwclist/BkgrCfg.c
index 3bddc786af..adc96b1970 100644
--- a/plugins/Mwclist/BkgrCfg.c
+++ b/plugins/Mwclist/BkgrCfg.c
@@ -69,10 +69,10 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
dat->item[indx].selColor = DBGetContactSettingDword(NULL,module, "SelBkColour", DEFAULT_SELBKCOLOUR);
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(NULL,module,"BkBitmap",&dbv))
+ if (!DBGetContactSettingString(NULL,module,"BkBitmap",&dbv))
{
int retval = CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)dat->item[indx].filename);
- if(!retval || retval == CALLSERVICE_NOTFOUND)
+ if (!retval || retval == CALLSERVICE_NOTFOUND)
lstrcpynA(dat->item[indx].filename, dbv.pszVal, MAX_PATH);
mir_free(dbv.pszVal);
}
@@ -217,7 +217,7 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
ofn.nMaxFile = sizeof(str);
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = "bmp";
- if(!GetOpenFileNameA(&ofn)) break;
+ if (!GetOpenFileNameA(&ofn)) break;
SetDlgItemTextA(hwndDlg, IDC_FILENAME, str);
}
else
@@ -264,12 +264,12 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
COLORREF col;
- if((col = dat->item[indx].bkColor) == DEFAULT_BKCOLOUR)
+ if ((col = dat->item[indx].bkColor) == DEFAULT_BKCOLOUR)
DBDeleteContactSetting(NULL, module, "BkColour");
else
DBWriteContactSettingDword(NULL, module, "BkColour", col);
- if((col = dat->item[indx].selColor) == DEFAULT_SELBKCOLOUR)
+ if ((col = dat->item[indx].selColor) == DEFAULT_SELBKCOLOUR)
DBDeleteContactSetting(NULL, module, "SelBkColour");
else
DBWriteContactSettingDword(NULL, module, "SelBkColour", col);
@@ -279,7 +279,7 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
int retval = CallService(MS_UTILS_PATHTOABSOLUTE,
(WPARAM)dat->item[indx].filename,
(LPARAM)str);
- if(!retval || retval == CALLSERVICE_NOTFOUND)
+ if (!retval || retval == CALLSERVICE_NOTFOUND)
DBWriteContactSettingString(NULL, module, "BkBitmap", dat->item[indx].filename);
else
DBWriteContactSettingString(NULL, module, "BkBitmap", str);
diff --git a/plugins/Mwclist/CLUIFrames/cluiframes.c b/plugins/Mwclist/CLUIFrames/cluiframes.c
index 223a5eae8b..c6c7ba08e9 100644
--- a/plugins/Mwclist/CLUIFrames/cluiframes.c
+++ b/plugins/Mwclist/CLUIFrames/cluiframes.c
@@ -930,7 +930,7 @@ static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam)
ModifyMItem((WPARAM)contMIFloating,(LPARAM)&mi);
mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if((Frames[pos].UseBorder)) mi.flags|=CMIF_CHECKED;
+ if ((Frames[pos].UseBorder)) mi.flags|=CMIF_CHECKED;
ModifyMItem((WPARAM)contMIBorder,(LPARAM)&mi);
@@ -950,7 +950,7 @@ static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam)
mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
if(Frames[pos].collapsed) mi.flags|=CMIF_CHECKED;
- if((!Frames[pos].visible)||(Frames[pos].Locked)||(pos==CLUIFramesGetalClientFrame())) mi.flags|=CMIF_GRAYED;
+ if ((!Frames[pos].visible)||(Frames[pos].Locked)||(pos==CLUIFramesGetalClientFrame())) mi.flags|=CMIF_GRAYED;
ModifyMItem((WPARAM)contMIColl,(LPARAM)&mi);
}
ulockfrm();
@@ -990,7 +990,7 @@ INT_PTR CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam)
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIFloating,(LPARAM)&mi);
mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if((Frames[pos].UseBorder)) mi.flags|=CMIF_CHECKED;
+ if ((Frames[pos].UseBorder)) mi.flags|=CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIBorder,(LPARAM)&mi);
mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
@@ -1024,7 +1024,7 @@ INT_PTR CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam)
mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
if(Frames[pos].collapsed) mi.flags|=CMIF_CHECKED;
- if((!Frames[pos].visible)||Frames[pos].Locked||(pos==CLUIFramesGetalClientFrame())) mi.flags|=CMIF_GRAYED;
+ if ((!Frames[pos].visible)||Frames[pos].Locked||(pos==CLUIFramesGetalClientFrame())) mi.flags|=CMIF_GRAYED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIColl,(LPARAM)&mi);
}
ulockfrm();
@@ -1051,11 +1051,11 @@ INT_PTR CLUIFramesGetFrameOptions(WPARAM wParam,LPARAM lParam)
case FO_FLAGS:
retval=0;
if(Frames[pos].visible) retval|=F_VISIBLE;
- if(!Frames[pos].collapsed) retval|=F_UNCOLLAPSED;
+ if (!Frames[pos].collapsed) retval|=F_UNCOLLAPSED;
if(Frames[pos].Locked) retval|=F_LOCKED;
if(Frames[pos].TitleBar.ShowTitleBar) retval|=F_SHOWTB;
if(Frames[pos].TitleBar.ShowTitleBarTip) retval|=F_SHOWTBTIP;
- if(!(GetWindowLong(Frames[pos].hWnd,GWL_STYLE)&WS_BORDER)) retval|=F_NOBORDER;
+ if (!(GetWindowLong(Frames[pos].hWnd,GWL_STYLE)&WS_BORDER)) retval|=F_NOBORDER;
break;
case FO_NAME:
@@ -1191,7 +1191,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam,LPARAM lParam)
if(lParam<0) {ulockfrm(); return -1;}
retval=Frames[pos].height;
Frames[pos].height=lParam;
- if(!CLUIFramesFitInSize()) Frames[pos].height=retval;
+ if (!CLUIFramesFitInSize()) Frames[pos].height=retval;
retval=Frames[pos].height;
ulockfrm();
@@ -1216,7 +1216,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam,LPARAM lParam)
return (-1);
}
- if((lParam&alClient)&&(CLUIFramesGetalClientFrame()>=0)) { //only one alClient frame possible
+ if ((lParam&alClient)&&(CLUIFramesGetalClientFrame()>=0)) { //only one alClient frame possible
alclientFrame=-1;//recalc it
ulockfrm();
return -1;
@@ -1488,7 +1488,7 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam,LPARAM lParam)
if (!Frames[FrameId].floating)
{
- if(!CLUIFramesFitInSize()) {
+ if (!CLUIFramesFitInSize()) {
//cant collapse,we can resize only for height<alclient frame height
int alfrm=CLUIFramesGetalClientFrame();
@@ -1502,7 +1502,7 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam,LPARAM lParam)
{
int i,sumheight=0;
for(i=0;i<nFramescount;i++) {
- if((Frames[i].align!=alClient)&&(!Frames[i].floating)&&(Frames[i].visible)&&(!Frames[i].needhide)) {
+ if ((Frames[i].align!=alClient)&&(!Frames[i].floating)&&(Frames[i].visible)&&(!Frames[i].needhide)) {
sumheight+=(Frames[i].height)+(TitleBarH*btoint(Frames[i].TitleBar.ShowTitleBar))+2;
return FALSE;
}
@@ -1702,7 +1702,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam,LPARAM lParam)
if(pcli->hwndContactList==0) return -1;
if (FramesSysNotStarted) return -1;
if(clfrm->cbSize!=sizeof(CLISTFrame)) return -1;
- if(!(TitleBarFont)) TitleBarFont=CLUILoadTitleBarFont();
+ if (!(TitleBarFont)) TitleBarFont=CLUILoadTitleBarFont();
lockfrm();
if(nFramescount>=MAX_FRAMES) { ulockfrm(); return -1;}
@@ -1913,7 +1913,7 @@ BOOLEAN CLUIFramesFitInSize(void)
tbh=TitleBarH*btoint(Frames[clientfrm].TitleBar.ShowTitleBar);
for(i=0;i<nFramescount;i++) {
- if((Frames[i].align!=alClient)&&(!Frames[i].floating)&&(Frames[i].visible)&&(!Frames[i].needhide)) {
+ if ((Frames[i].align!=alClient)&&(!Frames[i].floating)&&(Frames[i].visible)&&(!Frames[i].needhide)) {
sumheight+=(Frames[i].height)+(TitleBarH*btoint(Frames[i].TitleBar.ShowTitleBar))+2;
if(sumheight>ContactListHeight-tbh-2)
return FALSE;
@@ -1938,7 +1938,7 @@ int CLUIFramesGetMinHeight()
for(i=0;i<nFramescount;i++)
{
- if((Frames[i].align!=alClient)&&(Frames[i].visible)&&(!Frames[i].needhide)&&(!Frames[i].floating))
+ if ((Frames[i].align!=alClient)&&(Frames[i].visible)&&(!Frames[i].needhide)&&(!Frames[i].floating))
{
RECT wsize;
@@ -2016,7 +2016,7 @@ int CLUIFramesResize(const RECT newsize)
sumheight=0;
drawitems=0;
for(i=0;i<nFramescount;i++) {
- if(((Frames[i].align!=alClient))&&(!Frames[i].floating)&&(Frames[i].visible)&&(!Frames[i].needhide)) {
+ if (((Frames[i].align!=alClient))&&(!Frames[i].floating)&&(Frames[i].visible)&&(!Frames[i].needhide)) {
drawitems++;
curfrmtbh=(TitleBarH+GapBetweenTitlebar)*btoint(Frames[i].TitleBar.ShowTitleBar);
sumheight+=(Frames[i].height)+curfrmtbh+sepw+(Frames[i].UseBorder?2:0);
@@ -2035,7 +2035,7 @@ int CLUIFramesResize(const RECT newsize)
for(j=0;j<nFramescount;j++) {
//move all alTop frames
i=sdarray[j].realpos;
- if((!Frames[i].needhide)&&(!Frames[i].floating)&&(Frames[i].visible)&&(Frames[i].align==alTop)) {
+ if ((!Frames[i].needhide)&&(!Frames[i].floating)&&(Frames[i].visible)&&(Frames[i].align==alTop)) {
curfrmtbh=(TitleBarH+GapBetweenTitlebar)*btoint(Frames[i].TitleBar.ShowTitleBar);
Frames[i].wndSize.top=prevframebottomline+sepw+(curfrmtbh);
Frames[i].wndSize.bottom=Frames[i].height+Frames[i].wndSize.top+(Frames[i].UseBorder?2:0);
@@ -2053,7 +2053,7 @@ int CLUIFramesResize(const RECT newsize)
for(j=0;j<nFramescount;j++) {
//move alClient frame
i=sdarray[j].realpos;
- if((!Frames[i].needhide)&&(!Frames[i].floating)&&(Frames[i].visible)&&(Frames[i].align==alClient)) {
+ if ((!Frames[i].needhide)&&(!Frames[i].floating)&&(Frames[i].visible)&&(Frames[i].align==alClient)) {
int oldh;
Frames[i].wndSize.top=prevframebottomline+sepw+(tbh);
Frames[i].wndSize.bottom=Frames[i].wndSize.top+newheight-sumheight-tbh-sepw;
@@ -2078,7 +2078,7 @@ int CLUIFramesResize(const RECT newsize)
for(j=nFramescount-1;j>=0;j--) {
//move all alBottom frames
i=sdarray[j].realpos;
- if((Frames[i].visible)&&(!Frames[i].floating)&&(!Frames[i].needhide)&&(Frames[i].align==alBottom)) {
+ if ((Frames[i].visible)&&(!Frames[i].floating)&&(!Frames[i].needhide)&&(Frames[i].align==alBottom)) {
curfrmtbh=(TitleBarH+GapBetweenTitlebar)*btoint(Frames[i].TitleBar.ShowTitleBar);
Frames[i].wndSize.bottom=prevframebottomline-sepw;
@@ -2094,7 +2094,7 @@ int CLUIFramesResize(const RECT newsize)
if (sdarray!=NULL){free(sdarray);sdarray=NULL;}
- for(i=0;i<nFramescount;i++){
+ for(i=0;i<nFramescount;i++) {
if (Frames[i].floating){
CLUIFrameResizeFloatingFrame(i);
@@ -2117,7 +2117,7 @@ INT_PTR CLUIFramesUpdateFrame(WPARAM wParam,LPARAM lParam)
if(wParam<0||(int)wParam>=nFramescount) { ulockfrm(); return -1;}
if(lParam&FU_TBREDRAW) CLUIFramesForceUpdateTB(&Frames[wParam]);
if(lParam&FU_FMREDRAW) CLUIFramesForceUpdateFrame(&Frames[wParam]);
- //if (){}
+ //if () {}
ulockfrm();
return 0;
@@ -2193,7 +2193,7 @@ int OnFrameTitleBarBackgroundChange()
if(hBmpBackground) {DeleteObject(hBmpBackground); hBmpBackground=NULL;}
if(DBGetContactSettingByte(NULL,"FrameTitleBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if(!DBGetContactSetting(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
+ if (!DBGetContactSetting(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
hBmpBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
mir_free(dbv.pszVal);
}
@@ -2306,7 +2306,7 @@ void DrawBackGroundTTB(HWND hwnd,HDC mhdc)
break;
}
desth=clRect.bottom -clRect.top;
- for(;y<maxy;y+=desth) {
+ for (;y<maxy;y+=desth) {
if(y<rcPaint->top-desth) continue;
for(x=0;x<maxx;x+=destw)
StretchBlt(hdcMem,x,y,destw,desth,hdcBmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY);
@@ -2881,7 +2881,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
if(newh>0) {
prevold=Frames[Framemod].height;
Frames[Framemod].height=newh;
- if(!CLUIFramesFitInSize()) { Frames[Framemod].height=prevold; ulockfrm();return TRUE;}
+ if (!CLUIFramesFitInSize()) { Frames[Framemod].height=prevold; ulockfrm();return TRUE;}
Frames[Framemod].height=newh;
if(newh>3) Frames[Framemod].collapsed=TRUE;
diff --git a/plugins/Mwclist/CLUIFrames/extraimage.c b/plugins/Mwclist/CLUIFrames/extraimage.c
index 941732c4ff..2124612a5d 100644
--- a/plugins/Mwclist/CLUIFrames/extraimage.c
+++ b/plugins/Mwclist/CLUIFrames/extraimage.c
@@ -297,7 +297,7 @@ void SetAllExtraIcons(HWND hwndList,HANDLE hContact)
maxpr=0;
//calc only needed protocols
- for( i=0; i < count; i++ ) {
+ for ( i=0; i < count; i++ ) {
if ( !IsAccountEnabled( accs[i] ) || CallProtoService( accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0 ) == 0 )
continue;
ImgIndex[maxpr] = accs[i]->szModuleName;
@@ -374,7 +374,7 @@ void SetAllExtraIcons(HWND hwndList,HANDLE hContact)
{
for (i=0;i<maxpr;i++)
{
- if(!MyStrCmp(ImgIndex[i],szProto))
+ if (!MyStrCmp(ImgIndex[i],szProto))
{
SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraToColumnNum(EXTRA_ICON_PROTO),i+3));
break;
diff --git a/plugins/Mwclist/CLUIFrames/statusbar.c b/plugins/Mwclist/CLUIFrames/statusbar.c
index 4e84805214..f761c5cb18 100644
--- a/plugins/Mwclist/CLUIFrames/statusbar.c
+++ b/plugins/Mwclist/CLUIFrames/statusbar.c
@@ -35,7 +35,7 @@ int OnStatusBarBackgroundChange()
bkColour=DBGetContactSettingDword(NULL,"StatusBar","BkColour",CLCDEFAULT_BKCOLOUR);
if(hBmpBackground) {DeleteObject(hBmpBackground); hBmpBackground=NULL;}
if(DBGetContactSettingByte(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if(!DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
+ if (!DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
hBmpBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
mir_free(dbv.pszVal);
}
@@ -230,7 +230,7 @@ void DrawBackGround(HWND hwnd,HDC mhdc)
break;
}
desth=clRect.bottom -clRect.top;
- for(;y<maxy;y+=desth) {
+ for (;y<maxy;y+=desth) {
if(y<rcPaint->top-desth) continue;
for(x=0;x<maxx;x+=destw)
StretchBlt(hdcMem,x,y,destw,desth,hdcBmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY);
diff --git a/plugins/Mwclist/clc.c b/plugins/Mwclist/clc.c
index 831e4e5eb6..45bb1100b4 100644
--- a/plugins/Mwclist/clc.c
+++ b/plugins/Mwclist/clc.c
@@ -102,9 +102,9 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam)
pcli->pfnClcBroadcast( INTM_NAMEORDERCHANGED, 0, 0 );
if ((HANDLE)wParam!=NULL&&!strcmp(cws->szModule,"CList")) {
- if( !strcmp( cws->szSetting, "noOffline" ))
+ if ( !strcmp( cws->szSetting, "noOffline" ))
pcli->pfnClcBroadcast( INTM_NAMEORDERCHANGED, wParam, lParam );
- else if(!strcmp(cws->szSetting,"StatusMsg"))
+ else if (!strcmp(cws->szSetting,"StatusMsg"))
pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED, wParam, lParam );
}
return 0;
@@ -157,7 +157,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
else status=cacheEntry->status;
shouldShow=(GetWindowLong(hwnd,GWL_STYLE)&CLS_SHOWHIDDEN || !cacheEntry->Hidden) && (!pcli->pfnIsHiddenMode(dat,status)||cacheEntry->noHiddenOffline || CallService(MS_CLIST_GETCONTACTICON,wParam,0)!=LOWORD(lParam)); //this means an offline msg is flashing, so the contact should be shown
- if(!FindItem(hwnd,dat,(HANDLE)wParam,&contact,&group,NULL)) {
+ if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,&group,NULL)) {
if(shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if(dat->selection>=0 && GetRowByIndex(dat,dat->selection,&selcontact,NULL)!=-1)
hSelItem=pcli->pfnContactToHItem(selcontact);
@@ -178,7 +178,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
if(contact->iImage== (WORD)lParam) break;
if (sortByStatus) dat->NeedResort=1;
- if(!shouldShow && !(style&CLS_NOHIDEOFFLINE) && (style&CLS_HIDEOFFLINE || group->hideOffline)) {
+ if (!shouldShow && !(style&CLS_NOHIDEOFFLINE) && (style&CLS_HIDEOFFLINE || group->hideOffline)) {
if(dat->selection>=0 && GetRowByIndex(dat,dat->selection,&selcontact,NULL)!=-1)
hSelItem=pcli->pfnContactToHItem(selcontact);
RemoveItemFromGroup(hwnd,group,contact,0);
@@ -189,7 +189,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
int oldflags;
contact->iImage=(WORD)lParam;
oldflags=contact->flags;
- if(!pcli->pfnIsHiddenMode(dat,status)||cacheEntry->noHiddenOffline) contact->flags|=CONTACTF_ONLINE;
+ if (!pcli->pfnIsHiddenMode(dat,status)||cacheEntry->noHiddenOffline) contact->flags|=CONTACTF_ONLINE;
else contact->flags&=~CONTACTF_ONLINE;
if (oldflags!=contact->flags)
dat->NeedResort=1;
diff --git a/plugins/Mwclist/clcidents.c b/plugins/Mwclist/clcidents.c
index be6be4c2d6..09a68588bc 100644
--- a/plugins/Mwclist/clcidents.c
+++ b/plugins/Mwclist/clcidents.c
@@ -46,7 +46,7 @@ int GetRowsPriorTo(struct ClcGroup *group,struct ClcGroup *subgroup,int contactI
int count=0;
group->scanIndex=0;
- for(;;) {
+ for (;;) {
if(group->scanIndex==group->cl.count) {
group=group->parent;
if(group==NULL) break;
@@ -131,7 +131,7 @@ void ClearClcContactCache(struct ClcData *dat,HANDLE hContact)
OutputDebugStringA(buf);
}
}
- if(!IsHContactGroup(hContact)&&!IsHContactInfo(hContact))
+ if (!IsHContactGroup(hContact)&&!IsHContactInfo(hContact))
{
cacheEntry=GetCLCFullCacheEntry(dat,hContact);
if (cacheEntry!=NULL)
@@ -142,7 +142,7 @@ void ClearClcContactCache(struct ClcData *dat,HANDLE hContact)
void SetClcContactCacheItem(struct ClcData *dat,HANDLE hContact,void *contact)
{
pdisplayNameCacheEntry cacheEntry;
- if(!IsHContactGroup(hContact)&&!IsHContactInfo(hContact))
+ if (!IsHContactGroup(hContact)&&!IsHContactInfo(hContact))
{
cacheEntry=GetCLCFullCacheEntry(dat,hContact);
if (cacheEntry!=NULL)
@@ -205,25 +205,25 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont
group=&dat->list;
- for(;;) {
+ for (;;) {
if(group->scanIndex==group->cl.count) {
struct ClcGroup *tgroup;
group=group->parent;
if(group==NULL) break;
nowVisible=1;
for(tgroup=group;tgroup;tgroup=tgroup->parent)
- if(!group->expanded) {nowVisible=0; break;}
+ if (!group->expanded) {nowVisible=0; break;}
group->scanIndex++;
continue;
}
if(nowVisible) index++;
- if((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type==CLCIT_GROUP && ((UINT_PTR)hItem&~HCONTACT_ISGROUP)==group->cl.items[group->scanIndex]->groupId) ||
+ if ((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type==CLCIT_GROUP && ((UINT_PTR)hItem&~HCONTACT_ISGROUP)==group->cl.items[group->scanIndex]->groupId) ||
(IsHContactContact(hItem) && group->cl.items[group->scanIndex]->type==CLCIT_CONTACT && group->cl.items[group->scanIndex]->hContact==hItem) ||
(IsHContactInfo(hItem) && group->cl.items[group->scanIndex]->type==CLCIT_INFO && group->cl.items[group->scanIndex]->hContact==(HANDLE)((UINT_PTR)hItem&~HCONTACT_ISINFO))) {
if(isVisible) {
- if(!nowVisible) *isVisible=0;
+ if (!nowVisible) *isVisible=0;
else {
- if((index+1)*dat->rowHeight<dat->yScroll) *isVisible=0;
+ if ((index+1)*dat->rowHeight<dat->yScroll) *isVisible=0;
else {
RECT clRect;
GetClientRect(hwnd,&clRect);
@@ -283,7 +283,7 @@ int GetRowByIndex(struct ClcData *dat,int testindex,struct ClcContact **contact,
// }else
{
group->scanIndex=0;
- for(;;) {
+ for (;;) {
if(group->scanIndex==group->cl.count) {
group=group->parent;
if(group==NULL) break;
diff --git a/plugins/Mwclist/clcitems.c b/plugins/Mwclist/clcitems.c
index 9a0f1548f3..f2aec5029e 100644
--- a/plugins/Mwclist/clcitems.c
+++ b/plugins/Mwclist/clcitems.c
@@ -225,21 +225,21 @@ void AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int updateTo
int i,len;
DWORD groupFlags;
TCHAR *szGroupName;
- if(!(style&CLS_HIDEEMPTYGROUPS)) {/*mir_free(dbv.pszVal);*/return;}
+ if (!(style&CLS_HIDEEMPTYGROUPS)) {/*mir_free(dbv.pszVal);*/return;}
if(checkHideOffline && pcli->pfnIsHiddenMode(dat,status)) {
for(i=1;;i++) {
szGroupName = pcli->pfnGetGroupName(i,&groupFlags);
if(szGroupName==NULL) {/*mir_free(dbv.pszVal);*/ return;} //never happens
- if(!lstrcmp(szGroupName,cacheEntry->szGroup)) break;
+ if (!lstrcmp(szGroupName,cacheEntry->szGroup)) break;
}
if(groupFlags&GROUPF_HIDEOFFLINE) {/*mir_free(dbv.pszVal);*/ return;}
}
for(i=1;;i++) {
szGroupName=pcli->pfnGetGroupName(i,&groupFlags);
if(szGroupName==NULL) {/*mir_free(dbv.pszVal);*/ return;} //never happens
- if(!lstrcmp(szGroupName,cacheEntry->szGroup)) break;
+ if (!lstrcmp(szGroupName,cacheEntry->szGroup)) break;
len=lstrlen(szGroupName);
- if(!_tcsncmp(szGroupName,cacheEntry->szGroup,len) && cacheEntry->szGroup[len]=='\\')
+ if (!_tcsncmp(szGroupName,cacheEntry->szGroup,len) && cacheEntry->szGroup[len]=='\\')
AddGroup(hwnd,dat,szGroupName,groupFlags,i,1);
}
group=AddGroup(hwnd,dat,cacheEntry->szGroup,groupFlags,i,1);
@@ -289,10 +289,10 @@ void DeleteItemFromTree(HWND hwnd,HANDLE hItem)
ClearRowByIndexCache();
dat->NeedResort=1;
- if(!FindItem(hwnd,dat,hItem,&contact,&group,NULL)) {
+ if (!FindItem(hwnd,dat,hItem,&contact,&group,NULL)) {
DBVARIANT dbv;
int i,nameOffset;
- if(!IsHContactContact(hItem)) return;
+ if (!IsHContactContact(hItem)) return;
ClearClcContactCache(dat,hItem);
if(DBGetContactSettingTString(hItem,"CList","Group",&dbv)) return;
@@ -304,7 +304,7 @@ void DeleteItemFromTree(HWND hwnd,HANDLE hItem)
if(group->scanIndex==group->cl.count) break;
if(group->cl.items[i]->type==CLCIT_GROUP) {
int len=lstrlen(group->cl.items[i]->szText);
- if(!_tcsncmp(group->cl.items[i]->szText,dbv.ptszVal+nameOffset,len) && (dbv.ptszVal[nameOffset+len]=='\\' || dbv.pszVal[nameOffset+len]=='\0')) {
+ if (!_tcsncmp(group->cl.items[i]->szText,dbv.ptszVal+nameOffset,len) && (dbv.ptszVal[nameOffset+len]=='\\' || dbv.pszVal[nameOffset+len]=='\0')) {
group->totalMembers--;
if(dbv.pszVal[nameOffset+len]=='\0') break;
}
@@ -375,14 +375,14 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat)
if(group!=NULL) {
group->totalMembers++;
- if(!(style&CLS_NOHIDEOFFLINE) && (style&CLS_HIDEOFFLINE || group->hideOffline)) {
+ if (!(style&CLS_NOHIDEOFFLINE) && (style&CLS_HIDEOFFLINE || group->hideOffline)) {
//szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
if(cacheEntry->szProto==NULL) {
- if(!pcli->pfnIsHiddenMode(dat,ID_STATUS_OFFLINE)||cacheEntry->noHiddenOffline)
+ if (!pcli->pfnIsHiddenMode(dat,ID_STATUS_OFFLINE)||cacheEntry->noHiddenOffline)
cont=AddContactToGroup(dat,group,cacheEntry);
}
else
- if(!pcli->pfnIsHiddenMode(dat,cacheEntry->status)||cacheEntry->noHiddenOffline)
+ if (!pcli->pfnIsHiddenMode(dat,cacheEntry->status)||cacheEntry->noHiddenOffline)
cont=AddContactToGroup(dat,group,cacheEntry);
}
else cont=AddContactToGroup(dat,group,cacheEntry);
@@ -401,7 +401,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat)
if(style&CLS_HIDEEMPTYGROUPS) {
group=&dat->list;
group->scanIndex=0;
- for(;;) {
+ for (;;) {
if(group->scanIndex==group->cl.count) {
group=group->parent;
if(group==NULL) break;
@@ -441,7 +441,7 @@ int GetNewSelection(struct ClcGroup *group, int selection, int direction)
return 0;
}
group->scanIndex=0;
- for(;;) {
+ for (;;) {
if(group->scanIndex==group->cl.count) {
group=group->parent;
if(group==NULL) break;
@@ -474,7 +474,7 @@ int GetGroupContentsCount(struct ClcGroup *group,int visibleOnly)
struct ClcGroup *topgroup=group;
group->scanIndex=0;
- for(;;) {
+ for (;;) {
if(group->scanIndex==group->cl.count) {
if(group==topgroup) break;
group=group->parent;
@@ -568,7 +568,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat)
group = &dat->list;
group->scanIndex=0;
- for(;;) {
+ for (;;) {
if(group->scanIndex==group->cl.count) {
group=group->parent;
if(group==NULL) break;
@@ -576,7 +576,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat)
else if(group->cl.items[group->scanIndex]->type==CLCIT_GROUP) {
group=group->cl.items[group->scanIndex]->group;
group->scanIndex=0;
- if(++savedGroupCount>savedGroupAlloced) {
+ if (++savedGroupCount>savedGroupAlloced) {
savedGroupAlloced+=allocstep;
savedGroup=(struct SavedGroupState_t*)mir_realloc(savedGroup,sizeof(struct SavedGroupState_t)*savedGroupAlloced);
}
@@ -585,7 +585,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat)
continue;
}
else if(group->cl.items[group->scanIndex]->type==CLCIT_CONTACT) {
- if(++savedContactCount>savedContactAlloced) {
+ if (++savedContactCount>savedContactAlloced) {
savedContactAlloced+=allocstep;
savedContact=(struct SavedContactState_t*)mir_realloc(savedContact,sizeof(struct SavedContactState_t)*savedContactAlloced);
}
@@ -597,7 +597,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat)
int l;
for (l=0; l<group->cl.items[group->scanIndex]->SubAllocated; l++)
{
- if(++savedContactCount>savedContactAlloced) {
+ if (++savedContactCount>savedContactAlloced) {
savedContactAlloced+=allocstep;
savedContact=(struct SavedContactState_t*)mir_realloc(savedContact,sizeof(struct SavedContactState_t)*savedContactAlloced);
}
@@ -608,7 +608,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat)
}
}
else if(group->cl.items[group->scanIndex]->type==CLCIT_INFO) {
- if(++savedInfoCount>savedInfoAlloced) {
+ if (++savedInfoCount>savedInfoAlloced) {
savedInfoAlloced+=allocstep;
savedInfo=(struct SavedInfoState_t*)mir_realloc(savedInfo,sizeof(struct SavedInfoState_t)*savedInfoAlloced);
}
@@ -624,7 +624,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat)
group=&dat->list;
group->scanIndex=0;
- for(;;) {
+ for (;;) {
if(group->scanIndex==group->cl.count) {
group=group->parent;
if(group==NULL) break;
@@ -665,7 +665,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat)
for(i=0;i<savedInfoCount;i++) {
if(savedInfo[i].parentId==-1) group=&dat->list;
else {
- if(!FindItem(hwnd,dat,(HANDLE)(savedInfo[i].parentId|HCONTACT_ISGROUP),&contact,NULL,NULL)) continue;
+ if (!FindItem(hwnd,dat,(HANDLE)(savedInfo[i].parentId|HCONTACT_ISGROUP),&contact,NULL,NULL)) continue;
group=contact->group;
}
j=AddInfoItemToGroup(group,savedInfo[i].contact.flags,_T(""));
diff --git a/plugins/Mwclist/clcopts.c b/plugins/Mwclist/clcopts.c
index 11fe5c1b86..bea2252081 100644
--- a/plugins/Mwclist/clcopts.c
+++ b/plugins/Mwclist/clcopts.c
@@ -172,7 +172,7 @@ static DWORD MakeCheckBoxTreeFlags(HWND hwndTree)
tvi.hItem=TreeView_GetRoot(hwndTree);
while(tvi.hItem) {
TreeView_GetItem(hwndTree,&tvi);
- if(((tvi.state&TVIS_STATEIMAGEMASK)>>12==2)) flags|=tvi.lParam;
+ if (((tvi.state&TVIS_STATEIMAGEMASK)>>12==2)) flags|=tvi.lParam;
tvi.hItem=TreeView_GetNextSibling(hwndTree,tvi.hItem);
}
return flags;
@@ -268,14 +268,14 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam
EnableWindow(GetDlgItem(hwndDlg,IDC_SMOOTHTIME),IsDlgButtonChecked(hwndDlg,IDC_NOTNOSMOOTHSCROLLING));
if(LOWORD(wParam)==IDC_GREYOUT)
EnableWindow(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),IsDlgButtonChecked(hwndDlg,IDC_GREYOUT));
- if((LOWORD(wParam)==IDC_LEFTMARGIN || LOWORD(wParam)==IDC_SMOOTHTIME || LOWORD(wParam)==IDC_GROUPINDENT) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
+ if ((LOWORD(wParam)==IDC_LEFTMARGIN || LOWORD(wParam)==IDC_SMOOTHTIME || LOWORD(wParam)==IDC_GROUPINDENT) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case WM_NOTIFY:
switch(((LPNMHDR)lParam)->idFrom) {
case IDC_GREYOUTOPTS:
case IDC_HIDEOFFLINEOPTS:
- if(((LPNMHDR)lParam)->code==NM_CLICK) {
+ if (((LPNMHDR)lParam)->code==NM_CLICK) {
TVHITTESTINFO hti;
hti.pt.x=(short)LOWORD(GetMessagePos());
hti.pt.y=(short)HIWORD(GetMessagePos());
@@ -299,7 +299,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam
{ int i;
DWORD exStyle=0;
for(i=0;i < SIZEOF(checkBoxToStyleEx);i++)
- if((IsDlgButtonChecked(hwndDlg,checkBoxToStyleEx[i].id)==0)==checkBoxToStyleEx[i].not)
+ if ((IsDlgButtonChecked(hwndDlg,checkBoxToStyleEx[i].id)==0)==checkBoxToStyleEx[i].not)
exStyle|=checkBoxToStyleEx[i].flag;
DBWriteContactSettingDword(NULL,"CLC","ExStyle",exStyle);
}
@@ -348,7 +348,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETDEFAULTCOLOUR,0,CLCDEFAULT_SELBKCOLOUR);
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"StatusBar","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
{ DBVARIANT dbv;
- if(!DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
+ if (!DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
char szPath[MAX_PATH];
@@ -411,7 +411,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w
ofn.nMaxFile = SIZEOF(str);
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = "bmp";
- if(!GetOpenFileNameA(&ofn)) break;
+ if (!GetOpenFileNameA(&ofn)) break;
SetDlgItemTextA(hwndDlg,IDC_FILENAME,str);
}
else if(LOWORD(wParam)==IDC_FILENAME && HIWORD(wParam)!=EN_CHANGE) break;
@@ -487,7 +487,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETDEFAULTCOLOUR,0,CLCDEFAULT_SELBKCOLOUR);
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLC","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
{ DBVARIANT dbv;
- if(!DBGetContactSettingString(NULL,"CLC","BkBitmap",&dbv)) {
+ if (!DBGetContactSettingString(NULL,"CLC","BkBitmap",&dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
char szPath[MAX_PATH];
@@ -542,7 +542,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
ofn.nMaxFile = SIZEOF(str);
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = "bmp";
- if(!GetOpenFileNameA(&ofn)) break;
+ if (!GetOpenFileNameA(&ofn)) break;
SetDlgItemTextA(hwndDlg,IDC_FILENAME,str);
}
else if(LOWORD(wParam)==IDC_FILENAME && HIWORD(wParam)!=EN_CHANGE) break;
@@ -643,7 +643,7 @@ static const int fontListOrder[FONTID_MAX+1]={FONTID_CONTACTS,FONTID_INVIS,FONTI
static int CALLBACK EnumFontsProc(ENUMLOGFONTEX *lpelfe,NEWTEXTMETRICEX *lpntme,int FontType,LPARAM lParam)
{
- if(!IsWindow((HWND)lParam)) return FALSE;
+ if (!IsWindow((HWND)lParam)) return FALSE;
if(SendMessage((HWND)lParam,CB_FINDSTRINGEXACT,-1,(LPARAM)lpelfe->elfLogFont.lfFaceName)==CB_ERR)
SendMessage((HWND)lParam,CB_ADDSTRING,0,(LPARAM)lpelfe->elfLogFont.lfFaceName);
return TRUE;
@@ -708,7 +708,7 @@ static INT_PTR CALLBACK DlgProcClcTextOpts(HWND hwndDlg, UINT msg, WPARAM wParam
hFontSample=NULL;
SetDlgItemTextA(hwndDlg,IDC_SAMPLE,"Sample");
TranslateDialogDefault(hwndDlg);
- if(!SendMessage(GetParent(hwndDlg),PSM_ISEXPERT,0,0))
+ if (!SendMessage(GetParent(hwndDlg),PSM_ISEXPERT,0,0))
SwitchTextDlgToMode(hwndDlg,0);
mir_forkthread(FillFontListThread,hwndDlg);
{
@@ -817,7 +817,7 @@ static INT_PTR CALLBACK DlgProcClcTextOpts(HWND hwndDlg, UINT msg, WPARAM wParam
break;
}
case WM_CTLCOLORSTATIC:
- if((HWND)lParam==GetDlgItem(hwndDlg,IDC_SAMPLE)) {
+ if ((HWND)lParam==GetDlgItem(hwndDlg,IDC_SAMPLE)) {
SetTextColor((HDC)wParam,SendDlgItemMessage(hwndDlg,IDC_COLOUR,CPM_GETCOLOUR,0,0));
SetBkColor((HDC)wParam,GetSysColor(COLOR_3DFACE));
return (INT_PTR)GetSysColorBrush(COLOR_3DFACE);
@@ -966,7 +966,7 @@ static INT_PTR CALLBACK DlgProcClcTextOpts(HWND hwndDlg, UINT msg, WPARAM wParam
case M_GUESSSAMEASBOXES: //guess suitable values for the 'same as' checkboxes for fontId wParam
fontSettings[wParam].sameAsFlags=0;
if(fontSettings[wParam].sameAs==0xFF) break;
- if(!lstrcmp(fontSettings[wParam].szFace,fontSettings[fontSettings[wParam].sameAs].szFace) &&
+ if (!lstrcmp(fontSettings[wParam].szFace,fontSettings[fontSettings[wParam].sameAs].szFace) &&
fontSettings[wParam].charset==fontSettings[fontSettings[wParam].sameAs].charset)
fontSettings[wParam].sameAsFlags|=SAMEASF_FACE;
if(fontSettings[wParam].size==fontSettings[fontSettings[wParam].sameAs].size)
@@ -1000,7 +1000,7 @@ static INT_PTR CALLBACK DlgProcClcTextOpts(HWND hwndDlg, UINT msg, WPARAM wParam
if(HIWORD(wParam)!=CBN_SELCHANGE) return FALSE;
if(SendDlgItemMessage(hwndDlg,IDC_SAMEAS,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_SAMEAS,CB_GETCURSEL,0,0),0)==fontId)
SendDlgItemMessage(hwndDlg,IDC_SAMEAS,CB_SETCURSEL,0,0);
- if(!SendMessage(GetParent(hwndDlg),PSM_ISEXPERT,0,0)) {
+ if (!SendMessage(GetParent(hwndDlg),PSM_ISEXPERT,0,0)) {
int sameAs=SendDlgItemMessage(hwndDlg,IDC_SAMEAS,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_SAMEAS,CB_GETCURSEL,0,0),0);
if(sameAs!=0xFF) SendMessage(hwndDlg,M_LOADFONT,sameAs,0);
SendMessage(hwndDlg,M_SAVEFONT,fontId,0);
@@ -1027,7 +1027,7 @@ static INT_PTR CALLBACK DlgProcClcTextOpts(HWND hwndDlg, UINT msg, WPARAM wParam
case IDC_UNDERLINE:
case IDC_COLOUR:
SendMessage(hwndDlg,M_SAVEFONT,fontId,0);
- if(!SendMessage(GetParent(hwndDlg),PSM_ISEXPERT,0,0)) {
+ if (!SendMessage(GetParent(hwndDlg),PSM_ISEXPERT,0,0)) {
SendMessage(hwndDlg,M_GUESSSAMEASBOXES,fontId,0);
SendMessage(hwndDlg,M_REFRESHSAMEASBOXES,fontId,0);
}
diff --git a/plugins/Mwclist/clcpaint.c b/plugins/Mwclist/clcpaint.c
index a150c30836..670da591f0 100644
--- a/plugins/Mwclist/clcpaint.c
+++ b/plugins/Mwclist/clcpaint.c
@@ -270,7 +270,7 @@ void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint)
}
break;
}
- for(;y<maxy;y+=desth) {
+ for (;y<maxy;y+=desth) {
if(y<rcPaint->top-desth) continue;
for(x=0;x<maxx;x+=destw)
StretchBlt(hdcMem,x,y,destw,desth,hdcBmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY);
@@ -377,7 +377,7 @@ void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint)
}
}
- if((style&CLS_CHECKBOXES && Drawing->type==CLCIT_CONTACT) ||
+ if ((style&CLS_CHECKBOXES && Drawing->type==CLCIT_CONTACT) ||
(style&CLS_GROUPCHECKBOXES && Drawing->type==CLCIT_GROUP) ||
(Drawing->type==CLCIT_INFO && Drawing->flags&CLCIIF_CHECKBOX))
checkboxWidth=dat->checkboxSize+2;
@@ -698,7 +698,7 @@ void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint)
SelectObject(hdcMem,hoBrush);
DeleteObject(hBrush);
}
- if(!grey)
+ if (!grey)
BitBlt(hdc,rcPaint->left,rcPaint->top,rcPaint->right-rcPaint->left,rcPaint->bottom-rcPaint->top,hdcMem,rcPaint->left,rcPaint->top,SRCCOPY);
//DeleteDC(hdcMem);
if(hBrushAlternateGrey) DeleteObject(hBrushAlternateGrey);
diff --git a/plugins/Mwclist/clcutils.c b/plugins/Mwclist/clcutils.c
index 5a7aa3d992..35ddf0ccdc 100644
--- a/plugins/Mwclist/clcutils.c
+++ b/plugins/Mwclist/clcutils.c
@@ -177,11 +177,11 @@ void ScrollTo(HWND hwnd,struct ClcData *dat,int desty,int noSmooth)
if(desty>maxy) desty=maxy;
if(desty<0) desty=0;
if(abs(desty-dat->yScroll)<4) noSmooth=1;
- if(!noSmooth && dat->exStyle&CLS_EX_NOSMOOTHSCROLLING) noSmooth=1;
+ if (!noSmooth && dat->exStyle&CLS_EX_NOSMOOTHSCROLLING) noSmooth=1;
previousy=dat->yScroll;
- if(!noSmooth) {
+ if (!noSmooth) {
startTick=GetTickCount();
- for(;;) {
+ for (;;) {
nowTick=GetTickCount();
if(nowTick>=startTick+dat->scrollTime) break;
dat->yScroll=oldy+(desty-oldy)*(int)(nowTick-startTick)/dat->scrollTime;
diff --git a/plugins/Mwclist/clistopts.c b/plugins/Mwclist/clistopts.c
index 07cef251af..4be31595a5 100644
--- a/plugins/Mwclist/clistopts.c
+++ b/plugins/Mwclist/clistopts.c
@@ -94,8 +94,8 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIME),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
{ DWORD caps=CallService(MS_CLUI_GETCAPS,CLUICAPS_FLAGS1,0);
- if(!(caps&CLUIF_HIDEEMPTYGROUPS)) ShowWindow(GetDlgItem(hwndDlg,IDC_HIDEEMPTYGROUPS),SW_HIDE);
- if(!(caps&CLUIF_DISABLEGROUPS)) ShowWindow(GetDlgItem(hwndDlg,IDC_DISABLEGROUPS),SW_HIDE);
+ if (!(caps&CLUIF_HIDEEMPTYGROUPS)) ShowWindow(GetDlgItem(hwndDlg,IDC_HIDEEMPTYGROUPS),SW_HIDE);
+ if (!(caps&CLUIF_DISABLEGROUPS)) ShowWindow(GetDlgItem(hwndDlg,IDC_DISABLEGROUPS),SW_HIDE);
if(caps&CLUIF_HASONTOPOPTION) ShowWindow(GetDlgItem(hwndDlg,IDC_ONTOP),SW_HIDE);
if(caps&CLUIF_HASAUTOHIDEOPTION) {
ShowWindow(GetDlgItem(hwndDlg,IDC_AUTOHIDE),SW_HIDE);
@@ -148,7 +148,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETCURSEL,item,0);
}
}
- if(-1==(int)SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETCURSEL,0,0))
+ if (-1==(int)SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETCURSEL,0,0))
SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETCURSEL,0,0);
SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETBUDDY,(WPARAM)GetDlgItem(hwndDlg,IDC_BLINKTIME),0); // set buddy
SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETRANGE,0,MAKELONG(0x3FFF,250));
@@ -165,9 +165,9 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),IsDlgButtonChecked(hwndDlg,IDC_CYCLE));
EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSMULTI),IsDlgButtonChecked(hwndDlg,IDC_MULTITRAY));
}
- if((LOWORD(wParam)==IDC_HIDETIME || LOWORD(wParam)==IDC_CYCLETIME) && HIWORD(wParam)!=EN_CHANGE) break;
+ if ((LOWORD(wParam)==IDC_HIDETIME || LOWORD(wParam)==IDC_CYCLETIME) && HIWORD(wParam)!=EN_CHANGE) break;
if(LOWORD(wParam)==IDC_PRIMARYSTATUS && HIWORD(wParam)!=CBN_SELCHANGE) break;
- if((LOWORD(wParam)==IDC_HIDETIME || LOWORD(wParam)==IDC_CYCLETIME) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
+ if ((LOWORD(wParam)==IDC_HIDETIME || LOWORD(wParam)==IDC_CYCLETIME) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
if (LOWORD(wParam)==IDC_BLINKTIME && HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0; // dont make apply enabled during buddy set crap
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
@@ -181,11 +181,11 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{ DWORD caps=CallService(MS_CLUI_GETCAPS,CLUICAPS_FLAGS1,0);
if(caps&CLUIF_HIDEEMPTYGROUPS) DBWriteContactSettingByte(NULL,"CList","HideEmptyGroups",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEEMPTYGROUPS));
if(caps&CLUIF_DISABLEGROUPS) DBWriteContactSettingByte(NULL,"CList","UseGroups",(BYTE)!IsDlgButtonChecked(hwndDlg,IDC_DISABLEGROUPS));
- if(!(caps&CLUIF_HASONTOPOPTION)) {
+ if (!(caps&CLUIF_HASONTOPOPTION)) {
DBWriteContactSettingByte(NULL,"CList","OnTop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONTOP));
SetWindowPos(pcli->hwndContactList,IsDlgButtonChecked(hwndDlg,IDC_ONTOP)?HWND_TOPMOST:HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
- if(!(caps&CLUIF_HASAUTOHIDEOPTION)) {
+ if (!(caps&CLUIF_HASAUTOHIDEOPTION)) {
DBWriteContactSettingByte(NULL,"CList","AutoHide",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
DBWriteContactSettingWord(NULL,"CList","HideTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_GETPOS,0,0));
}
diff --git a/plugins/Mwclist/clistsettings.c b/plugins/Mwclist/clistsettings.c
index 01207fb503..ba3ef3befa 100644
--- a/plugins/Mwclist/clistsettings.c
+++ b/plugins/Mwclist/clistsettings.c
@@ -74,7 +74,7 @@ void FreeDisplayNameCache(SortedList *list)
{
int i;
- for( i=0; i < list->realCount; i++) {
+ for ( i=0; i < list->realCount; i++) {
FreeDisplayNameCacheItem(list->items[i] );
mir_free(list->items[i]);
}
@@ -333,7 +333,7 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
SortContacts();
} }
- if(!strcmp(cws->szModule,"CList")) {
+ if (!strcmp(cws->szModule,"CList")) {
/*
sprintf(buf,"CHANGE: module:CList setting:%s %s\r\n",cws->szSetting,cws->value.pszVal);
OutputDebugStringA(buf);
@@ -343,22 +343,22 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
if(pdnce->name == NULL||(!strcmp(cws->szSetting,"MyHandle")) )
InvalidateDisplayNameCacheEntryByPDNE((HANDLE)wParam,pdnce,cws->value.type);
- if((!strcmp(cws->szSetting,"Group")) )
+ if ((!strcmp(cws->szSetting,"Group")) )
InvalidateDisplayNameCacheEntryByPDNE((HANDLE)wParam,pdnce,cws->value.type);
- if(!strcmp(cws->szSetting,"Hidden")) {
+ if (!strcmp(cws->szSetting,"Hidden")) {
InvalidateDisplayNameCacheEntryByPDNE((HANDLE)wParam,pdnce,cws->value.type);
if(cws->value.type == DBVT_DELETED || cws->value.bVal == 0) {
char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0);
ChangeContactIcon((HANDLE)wParam,ExtIconFromStatusMode((HANDLE)wParam,szProto,szProto == NULL?ID_STATUS_OFFLINE:DBGetContactSettingWord((HANDLE)wParam,szProto,"Status",ID_STATUS_OFFLINE)),1); //by FYR
} }
- if(!strcmp(cws->szSetting,"noOffline"))
+ if (!strcmp(cws->szSetting,"noOffline"))
InvalidateDisplayNameCacheEntryByPDNE((HANDLE)wParam,pdnce,cws->value.type);
}
- if(!strcmp(cws->szModule,"Protocol")) {
- if(!strcmp(cws->szSetting,"p")) {
+ if (!strcmp(cws->szModule,"Protocol")) {
+ if (!strcmp(cws->szSetting,"p")) {
char *szProto;
OutputDebugStringA("CHANGE: proto\r\n");
diff --git a/plugins/Mwclist/clui.c b/plugins/Mwclist/clui.c
index fd2838cd08..358da9ef83 100644
--- a/plugins/Mwclist/clui.c
+++ b/plugins/Mwclist/clui.c
@@ -595,7 +595,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
CLUIFramesOnClistResize((WPARAM)hwnd,(LPARAM)0);
GetWindowRect(hwnd, &rc);
- if(!CallService(MS_CLIST_DOCKINGISDOCKED,0,0)) {
+ if (!CallService(MS_CLIST_DOCKINGISDOCKED,0,0)) {
//if docked, dont remember pos (except for width)
DBWriteContactSettingDword(NULL,"CList","Height",(DWORD)(rc.bottom - rc.top));
DBWriteContactSettingDword(NULL,"CList","x",(DWORD)rc.left);
@@ -774,7 +774,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
} } } }
if(hItem) break;
- if((hitFlags&(CLCHT_NOWHERE|CLCHT_INLEFTMARGIN|CLCHT_BELOWITEMS))==0) break;
+ if ((hitFlags&(CLCHT_NOWHERE|CLCHT_INLEFTMARGIN|CLCHT_BELOWITEMS))==0) break;
if (DBGetContactSettingByte(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT)) {
POINT pt;
pt=nm->pt;
@@ -785,7 +785,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
}
}
}
- else if(((LPNMHDR)lParam)->hwndFrom==pcli->hwndStatus) {
+ else if (((LPNMHDR)lParam)->hwndFrom==pcli->hwndStatus) {
if (((LPNMHDR)lParam)->code == NM_CLICK ) {
int nParts=0, nPanel=0;
NMMOUSE *nm=(NMMOUSE*)lParam;
@@ -935,7 +935,7 @@ int LoadCLUIModule(void)
{ //int state=DBGetContactSettingByte(NULL,"CList","State",SETTING_STATE_NORMAL);
hMenuMain=GetMenu(pcli->hwndContactList);
- if(!DBGetContactSettingByte(NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT)) SetMenu(pcli->hwndContactList,NULL);
+ if (!DBGetContactSettingByte(NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT)) SetMenu(pcli->hwndContactList,NULL);
SetWindowPos(pcli->hwndContactList, DBGetContactSettingByte(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
}
diff --git a/plugins/Mwclist/cluiopts.c b/plugins/Mwclist/cluiopts.c
index 58c0063638..68ff31ca78 100644
--- a/plugins/Mwclist/cluiopts.c
+++ b/plugins/Mwclist/cluiopts.c
@@ -75,7 +75,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
CheckDlgButton(hwndDlg, IDC_SHOWCAPTION, DBGetContactSettingByte(NULL,"CLUI","ShowCaption",SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, DBGetContactSettingByte(NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, DBGetContactSettingByte(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- if(!IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) {
+ if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),FALSE);
@@ -93,7 +93,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIME),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC01),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
- if(!IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE)) {
+ if (!IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC21),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC22),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_MAXSIZEHEIGHT),FALSE);
@@ -125,29 +125,29 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
wsprintfA(szUin,"%u",DBGetContactSettingDword(NULL,"ICQ","UIN",0));
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)szUin);
- if(!DBGetContactSettingString(NULL,"ICQ","Nick",&dbv)) {
+ if (!DBGetContactSettingString(NULL,"ICQ","Nick",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
mir_free(dbv.pszVal);
dbv.pszVal=NULL;
}
- if(!DBGetContactSettingString(NULL,"ICQ","FirstName",&dbv)) {
+ if (!DBGetContactSettingString(NULL,"ICQ","FirstName",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
mir_free(dbv.pszVal);
dbv.pszVal=NULL;
}
- if(!DBGetContactSettingString(NULL,"ICQ","e-mail",&dbv)) {
+ if (!DBGetContactSettingString(NULL,"ICQ","e-mail",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
mir_free(dbv.pszVal);
dbv.pszVal=NULL;
}
}
- if(!IsWinVer2000Plus()) {
+ if (!IsWinVer2000Plus()) {
EnableWindow(GetDlgItem(hwndDlg,IDC_FADEINOUT),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSPARENT),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_DROPSHADOW),FALSE);
}
else CheckDlgButton(hwndDlg,IDC_TRANSPARENT,DBGetContactSettingByte(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT)?BST_CHECKED:BST_UNCHECKED);
- if(!IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
+ if (!IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC11),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC12),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSACTIVE),FALSE);
@@ -269,7 +269,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
else
SetWindowLong(pcli->hwndContactList,GWL_STYLE,GetWindowLong(pcli->hwndContactList,GWL_STYLE)&~(WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX));
- if(!IsDlgButtonChecked(hwndDlg,IDC_SHOWMAINMENU)) SetMenu(pcli->hwndContactList,NULL);
+ if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWMAINMENU)) SetMenu(pcli->hwndContactList,NULL);
else SetMenu(pcli->hwndContactList,hMenuMain);
SetWindowPos(pcli->hwndContactList,0,0,0,0,0,SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_FRAMECHANGED);
@@ -347,7 +347,7 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLUI","SBarBKColor",CLR_DEFAULT));
- if(!IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)) {
+ if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWICON),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWPROTO),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWSTATUS),FALSE);
diff --git a/plugins/Mwclist/contact.c b/plugins/Mwclist/contact.c
index 6e602a6624..578dae5441 100644
--- a/plugins/Mwclist/contact.c
+++ b/plugins/Mwclist/contact.c
@@ -84,7 +84,7 @@ void LoadContactTree(void)
tick=GetTickCount();
CallService(MS_CLUI_LISTBEGINREBUILD,0,0);
for(i=1;;i++) {
- if((char*)CallService(MS_CLIST_GROUPGETNAME2,i,(LPARAM)(int*)NULL)==NULL) break;
+ if ((char*)CallService(MS_CLIST_GROUPGETNAME2,i,(LPARAM)(int*)NULL)==NULL) break;
CallService(MS_CLUI_GROUPADDED,i,0);
}
@@ -99,7 +99,7 @@ void LoadContactTree(void)
break;
}
status=cacheEntry->status;
- if((!hideOffline || status!=ID_STATUS_OFFLINE) && !cacheEntry->Hidden)
+ if ((!hideOffline || status!=ID_STATUS_OFFLINE) && !cacheEntry->Hidden)
ChangeContactIcon(hContact,ExtIconFromStatusMode(hContact,(char*)cacheEntry->szProto,status),1);
hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
}
@@ -137,7 +137,7 @@ int CompareContacts( const struct ClcContact *contact1, const struct ClcContact
/* deal with statuses, online contacts have to go above offline */
if (sortNoOfflineBottom==0)
- if((statusa==ID_STATUS_OFFLINE)!=(statusb==ID_STATUS_OFFLINE)) {
+ if ((statusa==ID_STATUS_OFFLINE)!=(statusb==ID_STATUS_OFFLINE)) {
return 2*(statusa==ID_STATUS_OFFLINE)-1;
}
/* both are online, now check protocols */
@@ -156,7 +156,7 @@ int CompareContacts( const struct ClcContact *contact1, const struct ClcContact
//one is offline: offline goes below online
if (sortNoOfflineBottom==0)
{
- if((statusa==ID_STATUS_OFFLINE)!=(statusb==ID_STATUS_OFFLINE)) {
+ if ((statusa==ID_STATUS_OFFLINE)!=(statusb==ID_STATUS_OFFLINE)) {
return 2*(statusa==ID_STATUS_OFFLINE)-1;
}
}
@@ -188,7 +188,7 @@ void SortContacts(void)
INT_PTR ContactChangeGroup(WPARAM wParam,LPARAM lParam)
{
CallService(MS_CLUI_CONTACTDELETED,wParam,0);
- if((HANDLE)lParam==NULL)
+ if ((HANDLE)lParam==NULL)
DBDeleteContactSetting((HANDLE)wParam,"CList","Group");
else
DBWriteContactSettingString((HANDLE)wParam,"CList","Group",(char*)CallService(MS_CLIST_GROUPGETNAME2,lParam,(LPARAM)(int*)NULL));
diff --git a/plugins/Mwclist/init.c b/plugins/Mwclist/init.c
index 6d5810c561..25eb944257 100644
--- a/plugins/Mwclist/init.c
+++ b/plugins/Mwclist/init.c
@@ -129,7 +129,7 @@ static int systemModulesLoaded(WPARAM wParam, LPARAM lParam)
__try {
int *disableDefaultModule = 0;
disableDefaultModule=(int*)CallService(MS_PLUGINS_GETDISABLEDEFAULTARRAY,0,0);
- if(!disableDefaultModule[DEFMOD_UICLUI]) if( LoadCLUIModule()) return 1;
+ if (!disableDefaultModule[DEFMOD_UICLUI]) if ( LoadCLUIModule()) return 1;
}
__except (exceptFunction(GetExceptionInformation()) )
{
diff --git a/plugins/NewXstatusNotify/indsnd.cpp b/plugins/NewXstatusNotify/indsnd.cpp
index 2934c25256..f98c62fb6a 100644
--- a/plugins/NewXstatusNotify/indsnd.cpp
+++ b/plugins/NewXstatusNotify/indsnd.cpp
@@ -565,7 +565,7 @@ INT_PTR CALLBACK DlgProcFiltering(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
// Find clicked item
HANDLE hItem = (HANDLE)SendMessage(hList, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
if (hItem == NULL) break;
- if(!(hitFlags & CLCHT_ONITEMEXTRA)) break;
+ if (!(hitFlags & CLCHT_ONITEMEXTRA)) break;
int itemType = SendMessage(hList, CLM_GETITEMTYPE, (WPARAM)hItem, 0);
diff --git a/plugins/NewXstatusNotify/main.cpp b/plugins/NewXstatusNotify/main.cpp
index 8559d52cbf..b631bafc93 100644
--- a/plugins/NewXstatusNotify/main.cpp
+++ b/plugins/NewXstatusNotify/main.cpp
@@ -467,7 +467,7 @@ TCHAR* AddCR(const TCHAR *statusmsg) {
else {
break;
}
- if(j == 0 || *(statusmsg + j - 1) != _T('\r')){
+ if(j == 0 || *(statusmsg + j - 1) != _T('\r')) {
tmp = lstrcat(tmp, _T("\r"));
}
tmp = lstrcat(tmp, _T("\n"));
diff --git a/plugins/NewXstatusNotify/utils.cpp b/plugins/NewXstatusNotify/utils.cpp
index 0037639827..bfa8184ddf 100644
--- a/plugins/NewXstatusNotify/utils.cpp
+++ b/plugins/NewXstatusNotify/utils.cpp
@@ -48,7 +48,7 @@ TCHAR *db2t(DBVARIANT *dbv)
int DBGetStringDefault(HANDLE hContact, const char *szModule, const char *szSetting, TCHAR *setting, int size, const TCHAR *defaultValue)
{
DBVARIANT dbv;
- if(!DBGetContactSettingTString(hContact, szModule, szSetting, &dbv))
+ if (!DBGetContactSettingTString(hContact, szModule, szSetting, &dbv))
{
_tcsncpy(setting, dbv.ptszVal, size);
DBFreeVariant(&dbv);
diff --git a/plugins/NewsAggregstor/NewsAggregator_10.vcxproj b/plugins/NewsAggregstor/NewsAggregator_10.vcxproj
index 55c2cba5f7..cb0471ee90 100644
--- a/plugins/NewsAggregstor/NewsAggregator_10.vcxproj
+++ b/plugins/NewsAggregstor/NewsAggregator_10.vcxproj
@@ -193,6 +193,7 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Src\Services.cpp" />
<ClCompile Include="Src\Update.cpp" />
diff --git a/plugins/NewsAggregstor/Src/Entities.cpp b/plugins/NewsAggregstor/Src/Entities.cpp
index 7d6daf4a94..46a00d2d8d 100644
--- a/plugins/NewsAggregstor/Src/Entities.cpp
+++ b/plugins/NewsAggregstor/Src/Entities.cpp
@@ -313,7 +313,7 @@ static size_t putc_utf8(unsigned long cp, char *buffer)
static BOOL parse_entity(const char *current, char **to, const char **from)
{
const char *end = strchr(current, ';');
- if(!end) return 0;
+ if (!end) return 0;
if(current[1] == '#')
{
@@ -353,7 +353,7 @@ static BOOL parse_entity(const char *current, char **to, const char **from)
size_t decode_html_entities_utf8(char *dest, const char *src)
{
- if(!src) src = dest;
+ if (!src) src = dest;
char *to = dest;
const char *from = src;
diff --git a/plugins/NewsAggregstor/Src/Options.cpp b/plugins/NewsAggregstor/Src/Options.cpp
index 74249b1a64..b9dc78b90c 100644
--- a/plugins/NewsAggregstor/Src/Options.cpp
+++ b/plugins/NewsAggregstor/Src/Options.cpp
@@ -619,7 +619,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
case LVN_ITEMCHANGED:
{
NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
- if(((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK) && !UpdateListFlag)
+ if (((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK) && !UpdateListFlag)
{
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
diff --git a/plugins/NewsAggregstor/Src/Services.cpp b/plugins/NewsAggregstor/Src/Services.cpp
index b47d688f08..0c23983c79 100644
--- a/plugins/NewsAggregstor/Src/Services.cpp
+++ b/plugins/NewsAggregstor/Src/Services.cpp
@@ -115,7 +115,7 @@ INT_PTR NewsAggrGetCaps(WPARAM wp,LPARAM lp)
INT_PTR NewsAggrSetStatus(WPARAM wp,LPARAM /*lp*/)
{
int nStatus = wp;
- if((ID_STATUS_ONLINE == nStatus) || (ID_STATUS_OFFLINE == nStatus))
+ if ((ID_STATUS_ONLINE == nStatus) || (ID_STATUS_OFFLINE == nStatus))
{
int nOldStatus = g_nStatus;
if(nStatus != g_nStatus)
@@ -182,7 +182,7 @@ INT_PTR ChangeFeed(WPARAM wParam,LPARAM lParam)
{
HANDLE hContact = (HANDLE) wParam;
HWND hChangeFeedDlg = WindowList_Find(hChangeFeedDlgList,hContact);
- if(!hChangeFeedDlg)
+ if (!hChangeFeedDlg)
{
hChangeFeedDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ADDFEED), NULL, DlgProcChangeFeedMenu, (LPARAM)hContact);
ShowWindow(hChangeFeedDlg, SW_SHOW);
@@ -219,7 +219,7 @@ INT_PTR NewsAggrGetAvatarInfo(WPARAM wParam,LPARAM lParam)
{
PROTO_AVATAR_INFORMATION* pai = (PROTO_AVATAR_INFORMATION*) lParam;
- if(!IsMyContact(pai->hContact))
+ if (!IsMyContact(pai->hContact))
return GAIR_NOAVATAR;
// if GAIF_FORCE is set, we are updating the feed
diff --git a/plugins/NewsAggregstor/Src/Utils.cpp b/plugins/NewsAggregstor/Src/Utils.cpp
index 85503966ce..c42a3f7dd1 100644
--- a/plugins/NewsAggregstor/Src/Utils.cpp
+++ b/plugins/NewsAggregstor/Src/Utils.cpp
@@ -487,7 +487,7 @@ BOOL DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal)
if(pReply)
{
- if((200 == pReply->resultCode) && (pReply->dataLength > 0))
+ if ((200 == pReply->resultCode) && (pReply->dataLength > 0))
{
char *date = NULL, *size = NULL;
for (int i = 0; i < pReply->headersCount; i++)
@@ -834,7 +834,7 @@ VOID CheckCurrentFeed(HANDLE hContact)
pai.hContact = hContact;
DBVARIANT dbVar = {0};
- if(!DBGetContactSettingTString(hContact, MODULE, "Nick", &dbVar))
+ if (!DBGetContactSettingTString(hContact, MODULE, "Nick", &dbVar))
{
TCHAR *ext = _tcsrchr((TCHAR*)url, _T('.')) + 1;
pai.format = GetImageFormat(ext);
@@ -1161,7 +1161,7 @@ VOID CheckCurrentFeed(HANDLE hContact)
pai.hContact = hContact;
DBVARIANT dbVar = {0};
- if(!DBGetContactSettingTString(hContact, MODULE, "Nick", &dbVar))
+ if (!DBGetContactSettingTString(hContact, MODULE, "Nick", &dbVar))
{
TCHAR *ext = _tcsrchr((TCHAR*)url, _T('.')) + 1;
pai.format = GetImageFormat(ext);
diff --git a/plugins/Nudge/main.cpp b/plugins/Nudge/main.cpp
index 470ac43765..5af3d90205 100644
--- a/plugins/Nudge/main.cpp
+++ b/plugins/Nudge/main.cpp
@@ -54,7 +54,7 @@ INT_PTR NudgeShowMenu(WPARAM wParam,LPARAM lParam)
for(NudgeElementList *n = NudgeList;n != NULL; n = n->next)
{
- if(!strcmp((char *) wParam,n->item.ProtocolName))
+ if (!strcmp((char *) wParam,n->item.ProtocolName))
{
return n->item.ShowContactMenu(lParam != 0);
}
@@ -77,7 +77,7 @@ INT_PTR NudgeSend(WPARAM wParam,LPARAM lParam)
{
for(NudgeElementList *n = NudgeList;n != NULL; n = n->next)
{
- if(!strcmp(protoName,n->item.ProtocolName))
+ if (!strcmp(protoName,n->item.ProtocolName))
{
Nudge_ShowPopup(n->item, (HANDLE) wParam, msg);
}
@@ -97,7 +97,7 @@ INT_PTR NudgeSend(WPARAM wParam,LPARAM lParam)
NudgeElementList *n;
for(n = NudgeList;n != NULL; n = n->next)
{
- if(!strcmp(protoName,n->item.ProtocolName))
+ if (!strcmp(protoName,n->item.ProtocolName))
{
//if(n->item.showPopup)
// Nudge_ShowPopup(n->item, (HANDLE) wParam, n->item.senText);
@@ -145,7 +145,7 @@ int NudgeRecieved(WPARAM wParam,LPARAM lParam)
{
for(NudgeElementList *n = NudgeList;n != NULL; n = n->next)
{
- if(!strcmp(protoName,n->item.ProtocolName))
+ if (!strcmp(protoName,n->item.ProtocolName))
{
if(n->item.enabled)
@@ -155,7 +155,7 @@ int NudgeRecieved(WPARAM wParam,LPARAM lParam)
DWORD Status = CallProtoService(protoName,PS_GETSTATUS,0,0);
- if( ((n->item.statusFlags & NUDGE_ACC_ST0) && (Status<=ID_STATUS_OFFLINE)) ||
+ if ( ((n->item.statusFlags & NUDGE_ACC_ST0) && (Status<=ID_STATUS_OFFLINE)) ||
((n->item.statusFlags & NUDGE_ACC_ST1) && (Status==ID_STATUS_ONLINE)) ||
((n->item.statusFlags & NUDGE_ACC_ST2) && (Status==ID_STATUS_AWAY)) ||
((n->item.statusFlags & NUDGE_ACC_ST3) && (Status==ID_STATUS_DND)) ||
@@ -202,7 +202,7 @@ int NudgeRecieved(WPARAM wParam,LPARAM lParam)
if(DefaultNudge.useIgnoreSettings && CallService(MS_IGNORE_ISIGNORED,wParam,IGNOREEVENT_USERONLINE))
return 0;
DWORD Status = CallService(MS_CLIST_GETSTATUSMODE,0,0);
- if( ((DefaultNudge.statusFlags & NUDGE_ACC_ST0) && (Status<=ID_STATUS_OFFLINE)) ||
+ if ( ((DefaultNudge.statusFlags & NUDGE_ACC_ST0) && (Status<=ID_STATUS_OFFLINE)) ||
((DefaultNudge.statusFlags & NUDGE_ACC_ST1) && (Status==ID_STATUS_ONLINE)) ||
((DefaultNudge.statusFlags & NUDGE_ACC_ST2) && (Status==ID_STATUS_AWAY)) ||
((DefaultNudge.statusFlags & NUDGE_ACC_ST3) && (Status==ID_STATUS_DND)) ||
@@ -378,7 +378,7 @@ void LoadProtocols(void)
void RegisterToTrigger(void)
{
- if( ServiceExists(MS_TRIGGER_REGISTERACTION))
+ if ( ServiceExists(MS_TRIGGER_REGISTERACTION))
{
ACTIONREGISTER ar;
ZeroMemory(&ar, sizeof(ar));
@@ -437,7 +437,7 @@ static int TabsrmmButtonPressed(WPARAM wParam, LPARAM lParam)
{
CustomButtonClickData *cbcd=(CustomButtonClickData *)lParam;
- if(!strcmp(cbcd->pszModule,"Nudge"))
+ if (!strcmp(cbcd->pszModule,"Nudge"))
NudgeSend(wParam, 0);
return 0;
@@ -627,7 +627,7 @@ void LoadPopupClass()
int Preview()
{
HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST,0,0);
- if( GlobalNudge.useByProtocol )
+ if ( GlobalNudge.useByProtocol )
{
for(NudgeElementList *n = NudgeList;n != NULL; n = n->next)
{
diff --git a/plugins/Nudge/nudge.cpp b/plugins/Nudge/nudge.cpp
index 73f831d35f..0afa6edee0 100644
--- a/plugins/Nudge/nudge.cpp
+++ b/plugins/Nudge/nudge.cpp
@@ -95,7 +95,7 @@ void CNudgeElement::Load(void)
mir_snprintf(SectionName,512,"%s-statusFlags", ProtocolName);
this->statusFlags = DBGetContactSettingDword(NULL, "Nudge", SectionName, 967);
mir_snprintf(SectionName,512,"%s-recText", ProtocolName);
- if(!DBGetContactSettingTString(NULL,"Nudge",SectionName,&dbv))
+ if (!DBGetContactSettingTString(NULL,"Nudge",SectionName,&dbv))
{
_tcsncpy(this->recText,dbv.ptszVal,TEXT_LEN);
if(_tcsclen(this->recText) < 1)
@@ -105,7 +105,7 @@ void CNudgeElement::Load(void)
else
_tcsncpy(this->recText,TranslateT("You received a nudge"),TEXT_LEN);
mir_snprintf(SectionName,512,"%s-senText", ProtocolName);
- if(!DBGetContactSettingTString(NULL,"Nudge",SectionName,&dbv))
+ if (!DBGetContactSettingTString(NULL,"Nudge",SectionName,&dbv))
{
_tcsncpy(this->senText,dbv.ptszVal,TEXT_LEN);
if(_tcsclen(this->senText) < 1)
diff --git a/plugins/Nudge/options.cpp b/plugins/Nudge/options.cpp
index 1416ba83b7..15bd1e224b 100644
--- a/plugins/Nudge/options.cpp
+++ b/plugins/Nudge/options.cpp
@@ -74,7 +74,7 @@ INT_PTR CALLBACK DlgProcShakeOpt(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
break;
}
case WM_HSCROLL:
- if((HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CLIST) || (HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CHAT)
+ if ((HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CLIST) || (HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CHAT)
|| (HWND)lParam == GetDlgItem(hwnd, IDC_SSCALE_CLIST) || (HWND)lParam == GetDlgItem(hwnd, IDC_SSCALE_CHAT))
{
TCHAR szBuf[20];
diff --git a/plugins/Nudge/shake.cpp b/plugins/Nudge/shake.cpp
index 16f58d9183..c39d79c57b 100644
--- a/plugins/Nudge/shake.cpp
+++ b/plugins/Nudge/shake.cpp
@@ -46,7 +46,7 @@ INT_PTR ShakeClist( WPARAM wParam, LPARAM lParam )
INT_PTR ShakeChat( WPARAM wParam, LPARAM lParam )
{
- if(((HANDLE) wParam) == NULL) return -1;
+ if (((HANDLE) wParam) == NULL) return -1;
DWORD tid;
//char srmmName[100];
@@ -142,7 +142,7 @@ int TriggerShakeChat( WPARAM wParam, LPARAM lParam )
int CShake::ShakeChat(HWND hWnd)
{
- if(!ShakingChat)
+ if (!ShakingChat)
{
ShakingChat = true;
RECT rect;
@@ -166,7 +166,7 @@ int CShake::ShakeChat(HWND hWnd)
int CShake::ShakeClist(HWND hWnd)
{
- if(!Shaking)
+ if (!Shaking)
{
Shaking = true;
RECT rect;
diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp
index 7c4efd6a82..edf69e2b09 100644
--- a/plugins/PackUpdater/Src/Notifications.cpp
+++ b/plugins/PackUpdater/Src/Notifications.cpp
@@ -320,7 +320,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
mir_free(descr);
DBVARIANT dbv;
bool check = todo[i].enabled;
- if(!DBGetContactSettingTString(0, MODNAME, stored_setting, &dbv))
+ if (!DBGetContactSettingTString(0, MODNAME, stored_setting, &dbv))
{
if(dbv.ptszVal && lstrcmp(dbv.ptszVal, todo[i].tszNewVer) == 0)
check = false;
@@ -343,7 +343,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
}
case WM_NOTIFY:
{
- if(((LPNMHDR) lParam)->hwndFrom == hwndList)
+ if (((LPNMHDR) lParam)->hwndFrom == hwndList)
{
switch (((LPNMHDR) lParam)->code)
{
@@ -361,14 +361,14 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
ListView_GetItem(hwndList, &lvI);
vector<FILEINFO> &todo = *(vector<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
- if((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK)
+ if ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK)
{
todo[lvI.iItem].enabled = ListView_GetCheckState(hwndList, nmlv->iItem);
/*char stored_setting[256];
mir_snprintf(stored_setting, 256, "DisabledVer%s", ((UpdateInternal *)lvI.lParam)->update.szComponentName);
- if(((UpdateInternal *)lvI.lParam)->update_options.enabled)
+ if (((UpdateInternal *)lvI.lParam)->update_options.enabled)
DBDeleteContactSetting(0, "Updater", stored_setting); // user has re-enabled update to this version - remove setting from db
else
DBWriteContactSettingString(0, "Updater", stored_setting, ((UpdateInternal *)lvI.lParam)->newVersion);
@@ -399,7 +399,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
mir_snprintf(stored_setting, 256, "DisabledVer%s", descr);
mir_free(descr);
DBVARIANT dbv;
- if(!DBGetContactSettingTString(0, MODNAME, stored_setting, &dbv))
+ if (!DBGetContactSettingTString(0, MODNAME, stored_setting, &dbv))
{
if(dbv.ptszVal && lstrcmp(dbv.ptszVal, todo[lvI.iItem].tszNewVer) == 0)
CheckDlgButton(hDlg, IDC_DONOTREMIND, BST_CHECKED);
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp
index 3665fdbb90..735e347f2e 100644
--- a/plugins/PackUpdater/Src/Utils.cpp
+++ b/plugins/PackUpdater/Src/Utils.cpp
@@ -145,7 +145,7 @@ BOOL DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal)
if(pReply)
{
- if((200 == pReply->resultCode) && (pReply->dataLength > 0))
+ if ((200 == pReply->resultCode) && (pReply->dataLength > 0))
{
hFile = CreateFile(tszLocal, GENERIC_READ | GENERIC_WRITE, NULL, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
WriteFile(hFile, pReply->pData, (DWORD)pReply->dataLength, &dwBytes, NULL);
@@ -202,7 +202,7 @@ static void CheckUpdates(void *)
DBVARIANT dbVar = {0};
vector<FILEINFO> UpdateFiles;
- if(!Exists(tszRoot))
+ if (!Exists(tszRoot))
CreateDirectory(tszRoot, NULL);
Files.clear();
Reminder = DBGetContactSettingByte(NULL, MODNAME, "Reminder", DEFAULT_REMINDER);
@@ -369,7 +369,7 @@ static void CheckUpdates(void *)
mir_free(tszSysRoot);
mir_free(tszProgFiles);
} // end compare versions
- } //end checking all files in for()
+ } //end checking all files in for ()
// Show dialog
if (UpdateFiles.size()>0)
diff --git a/plugins/Popup/src/common.h b/plugins/Popup/src/common.h
index d975e0df0c..3b5ecae721 100644
--- a/plugins/Popup/src/common.h
+++ b/plugins/Popup/src/common.h
@@ -127,7 +127,7 @@ inline INT_PTR DBGetContactSettingStringX(HANDLE hContact, const char *ModuleNam
ret = (INT_PTR)mir_strdup(result ? Default : dbv.pszVal);
break;
case DBVT_WCHAR:
- if(!result) {
+ if (!result) {
ret = (INT_PTR)mir_wstrdup(dbv.pwszVal);
}
else {
@@ -137,7 +137,7 @@ inline INT_PTR DBGetContactSettingStringX(HANDLE hContact, const char *ModuleNam
default:
break;
}
- if(!result)
+ if (!result)
CallService(MS_DB_CONTACT_FREEVARIANT, 0, (LPARAM)&dbv);
return ret;
}
diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp
index 5831de512e..0f4dbb1309 100644
--- a/plugins/Popup/src/config.cpp
+++ b/plugins/Popup/src/config.cpp
@@ -112,7 +112,7 @@ void LoadOptions() {
#endif
//Load PopUp Options
- if(!OptionLoaded){
+ if (!OptionLoaded){
LoadOption_General();
LoadOption_Skins();
LoadOption_Actions();
diff --git a/plugins/Popup/src/formula.cpp b/plugins/Popup/src/formula.cpp
index 37002c9d18..86f102890a 100644
--- a/plugins/Popup/src/formula.cpp
+++ b/plugins/Popup/src/formula.cpp
@@ -98,16 +98,16 @@ int Formula::eval_mul(char *&s, Args *args, bool *vars) const
{
++s;
} else
- if(*s == '*')
+ if (*s == '*')
{
left *= eval_atom(++s, args, vars);
} else
- if(*s == '/')
+ if (*s == '/')
{
if (int right = eval_atom(++s, args, vars))
left /= right;
} else
- if(*s == '%')
+ if (*s == '%')
{
if (int right = eval_atom(++s, args, vars))
left %= right;
diff --git a/plugins/Popup/src/formula.h b/plugins/Popup/src/formula.h
index b0239c5551..d227613fd0 100644
--- a/plugins/Popup/src/formula.h
+++ b/plugins/Popup/src/formula.h
@@ -88,8 +88,8 @@ private:
int eval_atom(char *&s, Args *args, bool *vars) const;
public:
- Formula():m_str(mir_strdup("")){}
- Formula(char *s):m_str(mir_strdup(s)){}
+ Formula():m_str(mir_strdup("")) {}
+ Formula(char *s):m_str(mir_strdup(s)) {}
~Formula() {mir_free(m_str);}
void set(char *s){mir_free(m_str);m_str=mir_strdup(s);}
int eval(Args *args, bool *vars = 0) const;
diff --git a/plugins/Popup/src/icons.cpp b/plugins/Popup/src/icons.cpp
index cb6e87dcc7..5bfd22f49c 100644
--- a/plugins/Popup/src/icons.cpp
+++ b/plugins/Popup/src/icons.cpp
@@ -101,7 +101,7 @@ void InitIcons()
TCHAR selfDLL[1024];
GetModuleFileName(hInst, selfDLL, 1024);
- for(int i = 0; i < SIZEOF(icoDesc); i++){
+ for(int i = 0; i < SIZEOF(icoDesc); i++) {
sid.pszName = icoDesc[i].pszName;
sid.ptszDescription = icoDesc[i].ptszDesc; // [TRANSLATED-BY-CORE]
sid.ptszSection = icoDesc[i].ptszSection; //must be always untranslatet !!!!!
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index 41ad1b56ce..ab89e61d5f 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -349,7 +349,7 @@ INT_PTR GetStatus(WPARAM wp, LPARAM lp)
}
//register Updatersupport
-void registerUpdate(){
+void registerUpdate() {
Update update = {0};
char szVersion[16];
update.cbSize = sizeof(Update);
@@ -374,7 +374,7 @@ void registerUpdate(){
}
//register Hotkey
-void LoadHotkey(){
+void LoadHotkey() {
HOTKEYDESC hk = {0};
hk.cbSize = sizeof(hk);
hk.dwFlags = HKD_TCHAR;
@@ -429,7 +429,7 @@ static int ModulesLoaded(WPARAM wParam,LPARAM lParam)
}
//check if OptionLoaded
- if(!OptionLoaded){
+ if (!OptionLoaded){
LoadOptions();
}
/*/deprecatet stuff
@@ -661,7 +661,7 @@ MIRAPI int Load(PLUGINLINK *link)
hbmNoAvatar = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_NOAVATAR));
- if(!OptionLoaded){
+ if (!OptionLoaded){
LoadOptions();
}
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp
index 89cf7d8991..c693405bdc 100644
--- a/plugins/Popup/src/notifications.cpp
+++ b/plugins/Popup/src/notifications.cpp
@@ -244,7 +244,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification)
HANDLE FindTreeData(LPTSTR group, LPTSTR name, BYTE typ)
{
for(int i = 0; i < gTreeData.getCount(); i++) {
- if( gTreeData[i]->typ == typ &&
+ if ( gTreeData[i]->typ == typ &&
(!group || (_tcscmp(gTreeData[i]->pszTreeRoot, group) == 0)) &&
(!name || (_tcscmp(gTreeData[i]->pszDescription, name) == 0)) )
{
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp
index f8fcd5f619..7ada1662f2 100644
--- a/plugins/Popup/src/opt_adv.cpp
+++ b/plugins/Popup/src/opt_adv.cpp
@@ -405,7 +405,7 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
break;
case EN_CHANGE: //Edit controls change
- if(!bDlgInit) break;
+ if (!bDlgInit) break;
switch(idCtrl) {
//lParam = Handle to the control
case IDC_MAXPOPUPS:
@@ -420,7 +420,7 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_HISTORYSIZE:
{
int histSize = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if( histSize > 0 &&
+ if ( histSize > 0 &&
histSize <= SETTING_HISTORYSIZE_MAX){
PopUpOptions.HistorySize = histSize;
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
@@ -430,7 +430,7 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_AVT_RADIUS:
{
int avtRadius = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if( avtRadius <= SETTING_AVTSIZE_MAX / 2 ){
+ if ( avtRadius <= SETTING_AVTSIZE_MAX / 2 ) {
PopUpOptions.avatarRadius = avtRadius;
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
}
@@ -439,8 +439,8 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_FADEIN:
{
int fadeIn = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if( fadeIn >= SETTING_FADEINTIME_MIN &&
- fadeIn <= SETTING_FADEINTIME_MAX ){
+ if ( fadeIn >= SETTING_FADEINTIME_MIN &&
+ fadeIn <= SETTING_FADEINTIME_MAX ) {
PopUpOptions.FadeIn = fadeIn;
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
}
@@ -449,7 +449,7 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_FADEOUT:
{
int fadeOut = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if( fadeOut >= SETTING_FADEOUTTIME_MIN &&
+ if ( fadeOut >= SETTING_FADEOUTTIME_MIN &&
fadeOut <= SETTING_FADEOUTTIME_MAX){
PopUpOptions.FadeOut = fadeOut;
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp
index 582a85ae77..16a1963e14 100644
--- a/plugins/Popup/src/opt_contacts.cpp
+++ b/plugins/Popup/src/opt_contacts.cpp
@@ -88,7 +88,7 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
if(nm->iColumn==-1) break;
hItem=(HANDLE)SendDlgItemMessage(hwnd,IDC_LIST,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
if(hItem==NULL) break;
- if(!(hitFlags&CLCHT_ONITEMEXTRA)) break;
+ if (!(hitFlags&CLCHT_ONITEMEXTRA)) break;
iImage=SendDlgItemMessage(hwnd,IDC_LIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
if (iImage != 0xFF)
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp
index 109598ee87..4538e2b9fa 100644
--- a/plugins/Popup/src/opt_gen.cpp
+++ b/plugins/Popup/src/opt_gen.cpp
@@ -307,7 +307,7 @@ INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopUpOptions.DynamicResize && PopUpOptions.UseMinimumWidth);
EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopUpOptions.DynamicResize && PopUpOptions.UseMinimumWidth);
SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopUpOptions.DynamicResize ? TranslateT("Maximum width"): TranslateT("Width"));
- if(!PopUpOptions.DynamicResize) {
+ if (!PopUpOptions.DynamicResize) {
PopUpOptions.UseMaximumWidth = TRUE;
CheckDlgButton(hwnd, IDC_USEMAXIMUMWIDTH, BST_CHECKED);
EnableWindow(GetDlgItem(hwnd, IDC_USEMAXIMUMWIDTH), TRUE);
@@ -328,7 +328,7 @@ INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_USEMAXIMUMWIDTH:
{
PopUpOptions.UseMaximumWidth= Button_GetCheck((HWND)lParam);
- if(!PopUpOptions.DynamicResize) { //ugly - set always on if DynamicResize = off
+ if (!PopUpOptions.DynamicResize) { //ugly - set always on if DynamicResize = off
CheckDlgButton(hwnd, idCtrl, BST_CHECKED);
PopUpOptions.UseMaximumWidth = TRUE;
}
@@ -432,7 +432,7 @@ INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
break;
case EN_CHANGE: //Edit controls change
- if(!bDlgInit) break;
+ if (!bDlgInit) break;
switch(idCtrl) {
//lParam = Handle to the control
case IDC_SECONDS:
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp
index d91efe5afd..033c26c6a7 100644
--- a/plugins/Popup/src/opt_skins.cpp
+++ b/plugins/Popup/src/opt_skins.cpp
@@ -211,7 +211,7 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos
LPTSTR pszName = NULL;
if (skin = skins.getSkin(PopUpOptions.SkinPack)) {
for (int i = 1; i <= 10; i++) {
- if(!skin->getFlagName(i))
+ if (!skin->getFlagName(i))
continue;
*OptionsCount += 1;
options = (OPTTREE_OPTION*)mir_realloc(options,sizeof(OPTTREE_OPTION)*(*OptionsCount));
@@ -249,17 +249,17 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos
bCheck = PopUpOptions.DisplayTime;
break;
case 1:
- if(!IsWinVerXPPlus()) continue;
+ if (!IsWinVerXPPlus()) continue;
*dwGlobalOptions |= PopUpOptions.DropShadow ? (1 << i) : 0;
bCheck = PopUpOptions.DropShadow;
break;
case 2:
- if(!IsWinVerXPPlus()) continue;
+ if (!IsWinVerXPPlus()) continue;
*dwGlobalOptions |= PopUpOptions.EnableFreeformShadows ? (1 << i) : 0;
bCheck = PopUpOptions.EnableFreeformShadows;
break;
case 3:
- if(!MyDwmEnableBlurBehindWindow) continue;
+ if (!MyDwmEnableBlurBehindWindow) continue;
*dwGlobalOptions |= PopUpOptions.EnableAeroGlass ? (1 << i) : 0;
bCheck = PopUpOptions.EnableAeroGlass;
break;
@@ -268,7 +268,7 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos
bCheck = PopUpOptions.UseWinColors;
break;
case 5:
- if(!(htuText&&htuTitle)) continue;
+ if (!(htuText&&htuTitle)) continue;
*dwGlobalOptions |= PopUpOptions.UseMText ? (1 << i) : 0;
bCheck = PopUpOptions.UseMText;
break;
@@ -521,7 +521,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
return FALSE;
case WM_NOTIFY: {
- if(!bDlgInit) return FALSE;
+ if (!bDlgInit) return FALSE;
switch (((LPNMHDR)lParam)->idFrom) {
case 0: {
switch (((LPNMHDR)lParam)->code) {
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp
index 785c0e706e..7658e0ff76 100644
--- a/plugins/Popup/src/popup_wnd2.cpp
+++ b/plugins/Popup/src/popup_wnd2.cpp
@@ -242,7 +242,7 @@ void PopupWnd2::create()
if (m_options->DropShadow && !(style & CS_DROPSHADOW)) {
style |= CS_DROPSHADOW;
}
- else if (!m_options->DropShadow && (style & CS_DROPSHADOW)){
+ else if (!m_options->DropShadow && (style & CS_DROPSHADOW)) {
style &= ~CS_DROPSHADOW;
}
SetClassLongPtr(m_hwnd, GCL_STYLE, style);
@@ -1092,7 +1092,7 @@ BOOL IsUtfSendAvailable(HANDLE hContact)
//check for MetaContact and get szProto from subcontact
if(strcmp(szProto, gszMetaProto)==0) {
HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT, (WPARAM)hContact, 0);
- if(!hSubContact) return FALSE;
+ if (!hSubContact) return FALSE;
szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hSubContact, 0);
}
return(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_IMSENDUTF) ? TRUE : FALSE;
@@ -1470,7 +1470,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
if (i == m_actionCount)
{
- if(PopUpOptions.overrideLeft!=false && (m_hContact!=NULL || PopUpOptions.overrideLeft == 5 || PopUpOptions.overrideLeft == 6)){
+ if(PopUpOptions.overrideLeft!=false && (m_hContact!=NULL || PopUpOptions.overrideLeft == 5 || PopUpOptions.overrideLeft == 6)) {
switch (PopUpOptions.overrideLeft){
default:
case 1:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_MESSAGE); break;
@@ -1493,7 +1493,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
case WM_MBUTTONUP:
{
- if(PopUpOptions.overrideMiddle!=false && (m_hContact!=NULL || PopUpOptions.overrideMiddle == 5 || PopUpOptions.overrideMiddle == 6)){
+ if(PopUpOptions.overrideMiddle!=false && (m_hContact!=NULL || PopUpOptions.overrideMiddle == 5 || PopUpOptions.overrideMiddle == 6)) {
switch (PopUpOptions.overrideMiddle){
default:
case 1:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_MESSAGE); break;
@@ -1510,7 +1510,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
case WM_CONTEXTMENU:
{
- if(PopUpOptions.overrideRight!=false && (m_hContact!=NULL || PopUpOptions.overrideRight == 5 || PopUpOptions.overrideRight == 6)){
+ if(PopUpOptions.overrideRight!=false && (m_hContact!=NULL || PopUpOptions.overrideRight == 5 || PopUpOptions.overrideRight == 6)) {
switch (PopUpOptions.overrideRight){
default:
case 1:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_MESSAGE); break;
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp
index 48f1919d12..ca1c700781 100644
--- a/plugins/Popup/src/services.cpp
+++ b/plugins/Popup/src/services.cpp
@@ -424,7 +424,7 @@ INT_PTR PopUp_Change2(WPARAM wParam, LPARAM lParam)
//===== PopUp/ShowMessage
INT_PTR PopUp_ShowMessage(WPARAM wParam, LPARAM lParam) {
- if(!gbPopupLoaded || !wParam || !lParam) return -1;
+ if (!gbPopupLoaded || !wParam || !lParam) return -1;
if(closing) return 0;
POPUPDATA2 ppd2 = {0};
@@ -460,7 +460,7 @@ INT_PTR PopUp_ShowMessage(WPARAM wParam, LPARAM lParam) {
}
INT_PTR PopUp_ShowMessageW(WPARAM wParam, LPARAM lParam) {
- if(!gbPopupLoaded || !wParam || !lParam) return -1;
+ if (!gbPopupLoaded || !wParam || !lParam) return -1;
if(closing) return 0;
POPUPDATA2 ppd2 = {0};
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp
index d3847f6f7c..c18dcde07f 100644
--- a/plugins/Popup/src/skin.cpp
+++ b/plugins/Popup/src/skin.cpp
@@ -1152,7 +1152,7 @@ void PopupSkin::loadSkin(std::istream &f)
void PopupSkin::loadSkin(LPCTSTR fn)
{
- if(!fn) return;
+ if (!fn) return;
#if defined (_UNICODE) && _MSC_VER <= 1200
char* temp= mir_t2a(fn);
std::ifstream theFile;
diff --git a/plugins/QuickMessages/Utils.c b/plugins/QuickMessages/Utils.c
index 787d74800b..8adf1a13bd 100644
--- a/plugins/QuickMessages/Utils.c
+++ b/plugins/QuickMessages/Utils.c
@@ -205,7 +205,7 @@ void CleanSettings(int buttonnum,int from)
}
mir_snprintf(szMEntry,255,"EntryName_%u_%u",buttonnum,from);
- while(!DBGetContactSettingTString(NULL, PLGNAME,szMEntry,&dbv)){
+ while(!DBGetContactSettingTString(NULL, PLGNAME,szMEntry,&dbv)) {
DBDeleteContactSetting(NULL, PLGNAME,szMEntry);
mir_snprintf(szMEntry,255,"EntryValue_%u_%u",buttonnum,from);
DBDeleteContactSetting(NULL, PLGNAME,szMEntry);
@@ -274,7 +274,7 @@ void InitButtonsList()
{
TCHAR* pszBName=NULL;
ListData* ld=NULL;
- if(!(pszBName=getMenuEntry(i,0,3))){
+ if (!(pszBName=getMenuEntry(i,0,3))) {
g_iButtonsCount=i;
DBWriteContactSettingByte(NULL, PLGNAME,"ButtonsCount", (BYTE)g_iButtonsCount);
break;}
@@ -292,7 +292,7 @@ void InitButtonsList()
TCHAR* pszEntry=NULL;
ButtonData *bd=NULL;
- if(!(pszEntry=getMenuEntry(i,j,0)))
+ if (!(pszEntry=getMenuEntry(i,j,0)))
break;
bd=mir_alloc(sizeof(ButtonData));
@@ -415,12 +415,12 @@ TCHAR* ParseString(HANDLE hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptsz
if(TextSize&&ptszText[TextSize-1]=='\0') TextSize--;
if(ClipSize&&ptszClip[ClipSize-1]=='\0') ClipSize--;
- if(!_tcschr(ptszQValue,varstr))
+ if (!_tcschr(ptszQValue,varstr))
return ptszQValue;
while(ptszQValue[i])
{
- if(ptszQValue[i]=='%'){
+ if(ptszQValue[i]=='%') {
switch(ptszQValue[i+1])
{
case 't':{
@@ -439,7 +439,7 @@ TCHAR* ParseString(HANDLE hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptsz
ptszQValue[QVSize]='\0';
- if(!_tcschr(ptszQValue,varstr))
+ if (!_tcschr(ptszQValue,varstr))
return ptszQValue;
ptszQValue=tempPointer;
@@ -461,7 +461,7 @@ TCHAR* ParseString(HANDLE hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptsz
ptszQValue[QVSize]='\0';
- if(!_tcschr(ptszQValue,varstr))
+ if (!_tcschr(ptszQValue,varstr))
return ptszQValue;
ptszQValue=tempPointer;
@@ -493,7 +493,7 @@ TCHAR* ParseString(HANDLE hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptsz
ptszQValue[QVSize]='\0';
if(ptszName) mir_free(ptszName);
- if(!_tcschr(ptszQValue,varstr))
+ if (!_tcschr(ptszQValue,varstr))
return ptszQValue;
ptszQValue=tempPointer;
@@ -522,7 +522,7 @@ TCHAR* ParseString(HANDLE hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptsz
ptszQValue[QVSize]='\0';
- if(!_tcschr(ptszQValue,varstr))
+ if (!_tcschr(ptszQValue,varstr))
return ptszQValue;
ptszQValue=tempPointer;
@@ -544,7 +544,7 @@ TCHAR* ParseString(HANDLE hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptsz
ci.dwFlag =CNF_FIRSTNAME;
#endif
ci.szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if(!CallService(MS_CONTACT_GETCONTACTINFO,(WPARAM)0,(LPARAM)&ci)&&ci.pszVal){
+ if (!CallService(MS_CONTACT_GETCONTACTINFO,(WPARAM)0,(LPARAM)&ci)&&ci.pszVal){
NameLenght=(int)_tcslen(ci.pszVal);
ptszName=ci.pszVal;
}
@@ -561,7 +561,7 @@ TCHAR* ParseString(HANDLE hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptsz
ptszQValue[QVSize]='\0';
- if(!_tcschr(ptszQValue,varstr))
+ if (!_tcschr(ptszQValue,varstr))
return ptszQValue;
ptszQValue=tempPointer;
@@ -583,7 +583,7 @@ TCHAR* ParseString(HANDLE hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptsz
#else
ci.dwFlag =CNF_LASTNAME;
#endif
- if(!CallService(MS_CONTACT_GETCONTACTINFO,(WPARAM)0,(LPARAM)&ci)&&ci.pszVal){
+ if (!CallService(MS_CONTACT_GETCONTACTINFO,(WPARAM)0,(LPARAM)&ci)&&ci.pszVal){
NameLenght=(int)_tcslen(ci.pszVal);
ptszName=ci.pszVal;
}
@@ -598,7 +598,7 @@ TCHAR* ParseString(HANDLE hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptsz
ptszQValue[QVSize]='\0';
- if(!_tcschr(ptszQValue,varstr))
+ if (!_tcschr(ptszQValue,varstr))
return ptszQValue;
ptszQValue=tempPointer;
diff --git a/plugins/QuickMessages/main.c b/plugins/QuickMessages/main.c
index ea6016c5c5..30d22df47d 100644
--- a/plugins/QuickMessages/main.c
+++ b/plugins/QuickMessages/main.c
@@ -102,7 +102,7 @@ static int InputMenuPopup(WPARAM wParam,LPARAM lParam)
for(i=0;i<QuickList->realCount;i++)
{
QuickData* qd= (QuickData *)QuickList->items[i];
- if((qd->dwPos+254)==mwpd->selection)
+ if ((qd->dwPos+254)==mwpd->selection)
{
CHARRANGE cr;
UINT textlenght=0;
@@ -111,8 +111,8 @@ static int InputMenuPopup(WPARAM wParam,LPARAM lParam)
TCHAR* pszCBText=NULL;
BOOL bIsService=0;
- if(IsClipboardFormatAvailable(CF_TEXT)){
- if (OpenClipboard(mwpd->hwnd)){
+ if(IsClipboardFormatAvailable(CF_TEXT)) {
+ if (OpenClipboard(mwpd->hwnd)) {
HANDLE hData=NULL;
TCHAR* chBuffer=NULL;
int textLength=0;
@@ -140,7 +140,7 @@ static int InputMenuPopup(WPARAM wParam,LPARAM lParam)
}
if(qd->ptszValue){
ptszQValue=ParseString(mwpd->hContact,qd->ptszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)_tcslen(qd->ptszValue),textlenght,pszCBText?(int)_tcslen(pszCBText):0);
- if((bIsService=qd->bIsService)&&ptszQValue)
+ if ((bIsService=qd->bIsService)&&ptszQValue)
#ifdef _UNICODE
CallService(mir_u2a(ptszQValue),(WPARAM)mwpd->hContact,0);
#else
@@ -184,14 +184,14 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
if(strcmp(cbcd->pszModule,PLGNAME)) return 0;
- if(!ButtonsList[cbcd->dwButtonId]) return 1;
+ if (!ButtonsList[cbcd->dwButtonId]) return 1;
sl=ButtonsList[cbcd->dwButtonId]->sl;
- if(!sl) return 1;
+ if (!sl) return 1;
- if(IsClipboardFormatAvailable(CF_TEXT)){
- if (OpenClipboard(cbcd->hwndFrom)){
+ if(IsClipboardFormatAvailable(CF_TEXT)) {
+ if (OpenClipboard(cbcd->hwndFrom)) {
HANDLE hData=NULL;
TCHAR* chBuffer=NULL;
int textLength=0;
@@ -214,7 +214,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
qsort(sl->items,sl->realCount,sizeof(ButtonData *),sstSortButtons);
hEdit=GetDlgItem(cbcd->hwndFrom,IDC_MESSAGE);
- if(!hEdit) hEdit=GetDlgItem(cbcd->hwndFrom,IDC_CHATMESSAGE);
+ if (!hEdit) hEdit=GetDlgItem(cbcd->hwndFrom,IDC_CHATMESSAGE);
cr.cpMin = cr.cpMax = 0;
SendMessage(hEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
@@ -240,7 +240,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
case 1:
if(ButtonsList[cbcd->dwButtonId]->ptszQValue)
ptszQValue=ParseString(cbcd->hContact,ButtonsList[cbcd->dwButtonId]->ptszQValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)_tcslen(ButtonsList[cbcd->dwButtonId]->ptszQValue),textlenght,pszCBText?(int)_tcslen(pszCBText):0);
- if((bIsService=ButtonsList[cbcd->dwButtonId]->bIsServName)&&ptszQValue)
+ if ((bIsService=ButtonsList[cbcd->dwButtonId]->bIsServName)&&ptszQValue)
#ifdef _UNICODE
CallService(mir_u2a(ptszQValue),(WPARAM)cbcd->hContact,0);
#else
@@ -253,7 +253,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
bd=(ButtonData *)sl->items[0];
if(bd&&bd->pszValue){
ptszQValue=ParseString(cbcd->hContact,bd->pszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)_tcslen(bd->pszValue),textlenght,pszCBText?(int)_tcslen(pszCBText):0);
- if((bIsService=bd->bIsServName)&&ptszQValue)
+ if ((bIsService=bd->bIsServName)&&ptszQValue)
#ifdef _UNICODE
CallService(mir_u2a(ptszQValue),(WPARAM)cbcd->hContact,0);
#else
@@ -304,7 +304,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
bCTRL=(GetKeyState(VK_CONTROL)&0x8000)?1:0;
if(bd->pszValue){
ptszQValue=ParseString(cbcd->hContact,bd->pszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)_tcslen(bd->pszValue),textlenght,pszCBText?(int)_tcslen(pszCBText):0);
- if((bIsService=bd->bIsServName)&&ptszQValue)
+ if ((bIsService=bd->bIsServName)&&ptszQValue)
#ifdef _UNICODE
CallService(mir_u2a(ptszQValue),(WPARAM)cbcd->hContact,0);
#else
@@ -316,10 +316,10 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
if(ptszQValue){
- if(!bIsService){
+ if (!bIsService){
SendMessage(hEdit, EM_REPLACESEL, TRUE, (LPARAM)ptszQValue);
- if((g_bLClickAuto&&state!=1)||(g_bRClickAuto&&state==1)||cbcd->flags&BBCF_CONTROLPRESSED||bCTRL)
+ if ((g_bLClickAuto&&state!=1)||(g_bRClickAuto&&state==1)||cbcd->flags&BBCF_CONTROLPRESSED||bCTRL)
SendMessage(cbcd->hwndFrom, WM_COMMAND,IDOK,0);
}
free(ptszQValue);
diff --git a/plugins/QuickMessages/options.c b/plugins/QuickMessages/options.c
index ec2a43288c..7e7aeb978e 100644
--- a/plugins/QuickMessages/options.c
+++ b/plugins/QuickMessages/options.c
@@ -164,7 +164,7 @@ void SetMenuEntryProperties(HWND hdlg)
bd->dwOPPos=pos++;
- if(hItem=TreeView_GetChild(hMenuTree, tvi.hItem)){
+ if(hItem=TreeView_GetChild(hMenuTree, tvi.hItem)) {
bd->fEntryOpType&=~QMF_EX_CHILD;
@@ -184,14 +184,14 @@ void SetMenuEntryProperties(HWND hdlg)
}}
else
{
- if(!bd->pszOpValue)
+ if (!bd->pszOpValue)
bd->pszOpValue=mir_tstrdup(_T("Enter Value"));
}
if(TreeView_GetParent(hMenuTree, tvi.hItem))
bd->fEntryOpType|=QMF_EX_CHILD;
else bd->fEntryOpType&=~QMF_EX_CHILD;
- if(!(hItem=TreeView_GetNextSibling(hMenuTree, tvi.hItem)))
+ if (!(hItem=TreeView_GetNextSibling(hMenuTree, tvi.hItem)))
tvi.hItem=TreeView_GetNextSibling(hMenuTree, TreeView_GetParent(hMenuTree,tvi.hItem));
else
tvi.hItem=hItem;
@@ -228,7 +228,7 @@ void SaveMenuTree(HWND hdlg)
SortedList * sl=NULL;
ListData* ld=ButtonsList[iBl];
- if(!ld->sl) break;
+ if (!ld->sl) break;
sl=ld->sl;
@@ -345,7 +345,7 @@ void RestoreModuleData(HWND hdlg)
SortedList * sl=NULL;
ListData* ld=ButtonsList[iBl];
- if(!(sl=ld->sl)) break;
+ if (!(sl=ld->sl)) break;
if(ld->dwOPFlags&QMF_NEW)
{
@@ -425,11 +425,11 @@ static int BuildMenuTree(HWND hToolBarTree,SortedList * sl)
hParent=TreeView_InsertItem( hToolBarTree, &tvis );
if(tvis.hParent) TreeView_Expand( hMenuTree, tvis.hParent, TVE_EXPAND );
- if(!bd->pszOpValue&&bd->fEntryOpType==0)
+ if (!bd->pszOpValue&&bd->fEntryOpType==0)
{
tvis.hParent = hParent;
}
-// else if(!(bd->fEntryOpType&QMF_EX_CHILD))
+// else if (!(bd->fEntryOpType&QMF_EX_CHILD))
// tvis.hParent = NULL;
}
@@ -466,9 +466,9 @@ void MoveItem( HTREEITEM hItem, HTREEITEM hInsertAfter, BOOLEAN bAsChild )
//TCHAR strbuf[128];
HTREEITEM hParent, hChild, hNewItem;
- if( !hItem || !hInsertAfter )
+ if ( !hItem || !hInsertAfter )
return;
- if( hItem == hInsertAfter )
+ if ( hItem == hInsertAfter )
return;
switch( ( ULONG_PTR )hInsertAfter ) {
@@ -483,7 +483,7 @@ void MoveItem( HTREEITEM hItem, HTREEITEM hInsertAfter, BOOLEAN bAsChild )
break;
}
// do not move a parent next to its own children!
- if( hItem == hParent )
+ if ( hItem == hParent )
return;
// prepare the insert structure
@@ -498,7 +498,7 @@ void MoveItem( HTREEITEM hItem, HTREEITEM hInsertAfter, BOOLEAN bAsChild )
}
// item should be inserted as the first child of an existing root item
- if( bAsChild ) {
+ if ( bAsChild ) {
tvis.hParent = hInsertAfter;
tvis.hInsertAfter = ( bAsChild == 2 ) ? TVI_LAST : TVI_FIRST ;
}
@@ -508,7 +508,7 @@ void MoveItem( HTREEITEM hItem, HTREEITEM hInsertAfter, BOOLEAN bAsChild )
tvis.hInsertAfter = hInsertAfter;
}
// insert the item
- if( !( hNewItem = TreeView_InsertItem( hMenuTree, &tvis ) ) )
+ if ( !( hNewItem = TreeView_InsertItem( hMenuTree, &tvis ) ) )
return;
// move children
@@ -574,7 +574,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
SetWindowLong(hMenuTree,GWL_STYLE, style);
BuildButtonsList(hButtonsList);
- if(!TreeView_GetCount(hButtonsList)) EnableWindow(GetDlgItem(hdlg,IDC_RCLICKVALUE),FALSE);
+ if (!TreeView_GetCount(hButtonsList)) EnableWindow(GetDlgItem(hdlg,IDC_RCLICKVALUE),FALSE);
oldBNameProc = (WNDPROC) SetWindowLong(GetDlgItem(hdlg,IDC_BUTTONNAME), GWLP_WNDPROC, (LONG) EditSubclassProc);
oldMNameProc = (WNDPROC) SetWindowLong(GetDlgItem(hdlg,IDC_MENUNAME) , GWLP_WNDPROC, (LONG) EditSubclassProc);
@@ -617,34 +617,34 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
break;
- if( hti.flags & TVHT_ABOVE ) {
+ if ( hti.flags & TVHT_ABOVE ) {
htiAfter = TVI_FIRST;
}
else
- if( hti.flags & ( TVHT_NOWHERE|TVHT_BELOW ) ) {
+ if ( hti.flags & ( TVHT_NOWHERE|TVHT_BELOW ) ) {
htiAfter = TVI_LAST;
}
else
- if( hti.flags & ( TVHT_ONITEM|TVHT_ONITEMRIGHT ) ) {
+ if ( hti.flags & ( TVHT_ONITEM|TVHT_ONITEMRIGHT ) ) {
// check where over the item, the pointer is
- if( !TreeView_GetItemRect( hMenuTree, hti.hItem, &rc, FALSE ) ) {
+ if ( !TreeView_GetItemRect( hMenuTree, hti.hItem, &rc, FALSE ) ) {
drag=0;
break;
}
height = ( BYTE )( rc.bottom - rc.top );
- if( hti.pt.y - ( height / 3 ) < rc.top ) {
+ if ( hti.pt.y - ( height / 3 ) < rc.top ) {
HTREEITEM hItem = hti.hItem;
- if( !( hti.hItem = TreeView_GetPrevSibling( hMenuTree, hItem ) ) ) {
- if( !( hti.hItem = TreeView_GetParent(hMenuTree, hItem ) ))
+ if ( !( hti.hItem = TreeView_GetPrevSibling( hMenuTree, hItem ) ) ) {
+ if ( !( hti.hItem = TreeView_GetParent(hMenuTree, hItem ) ))
htiAfter = TVI_FIRST;
else
bAsChild = TRUE;
}
}
else
- if( hti.pt.y + ( height / 3 ) <= rc.bottom ) {
+ if ( hti.pt.y + ( height / 3 ) <= rc.bottom ) {
bAsChild = TRUE;
}
}
@@ -658,7 +658,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
tvi.hItem=hti.hItem;
tvi.mask=TVIF_PARAM |TVIF_HANDLE;
TreeView_GetItem(hMenuTree,&tvi);
- if((bd=(ButtonData*)tvi.lParam)&&(bd->fEntryOpType&QMF_EX_SEPARATOR))
+ if ((bd=(ButtonData*)tvi.lParam)&&(bd->fEntryOpType&QMF_EX_SEPARATOR))
bAsChild = FALSE;
}
@@ -687,19 +687,19 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
ClientToScreen(hdlg,&hti.pt);
ScreenToClient(hMenuTree,&hti.pt);
TreeView_HitTest(hMenuTree,&hti);
- if( hti.flags & ( TVHT_ONITEM|TVHT_ONITEMRIGHT ) ) {
+ if ( hti.flags & ( TVHT_ONITEM|TVHT_ONITEMRIGHT ) ) {
RECT rc;
BYTE height;
- if( TreeView_GetItemRect(hMenuTree, hti.hItem, &rc, FALSE ) ) {
+ if ( TreeView_GetItemRect(hMenuTree, hti.hItem, &rc, FALSE ) ) {
height = ( BYTE )( rc.bottom - rc.top );
- if( hti.pt.y - ( height / 3 ) < rc.top ) {
+ if ( hti.pt.y - ( height / 3 ) < rc.top ) {
SetCursor( LoadCursor( NULL, IDC_ARROW ) );
TreeView_SetInsertMark( hMenuTree, hti.hItem, 0 );
}
else
- if( hti.pt.y + ( height / 3 ) > rc.bottom ) {
+ if ( hti.pt.y + ( height / 3 ) > rc.bottom ) {
SetCursor( LoadCursor( NULL, IDC_ARROW ) );
TreeView_SetInsertMark( hMenuTree, hti.hItem, 1 );
}
@@ -710,8 +710,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
}
}
else {
- if( hti.flags & TVHT_ABOVE ) SendMessage( hMenuTree, WM_VSCROLL, MAKEWPARAM( SB_LINEUP, 0 ), 0 );
- if( hti.flags & TVHT_BELOW ) SendMessage( hMenuTree, WM_VSCROLL, MAKEWPARAM( SB_LINEDOWN, 0 ), 0 );
+ if ( hti.flags & TVHT_ABOVE ) SendMessage( hMenuTree, WM_VSCROLL, MAKEWPARAM( SB_LINEUP, 0 ), 0 );
+ if ( hti.flags & TVHT_BELOW ) SendMessage( hMenuTree, WM_VSCROLL, MAKEWPARAM( SB_LINEDOWN, 0 ), 0 );
TreeView_SetInsertMark( hMenuTree, NULL, 0 );
}
}
@@ -727,7 +727,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
switch(((LPNMHDR)lparam)->idFrom) {
case 0:{
if (((LPNMHDR)lparam)->code == PSN_APPLY ) {
- if(!bNeedRestart){
+ if (!bNeedRestart){
SetMenuEntryProperties(hdlg);
SaveMenuTree(hdlg);
}
@@ -737,7 +737,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
return 1;
}
else if (((LPNMHDR)lparam)->code == PSN_RESET ) {
- if(!bNeedRestart)
+ if (!bNeedRestart)
RestoreModuleData(hdlg);
return 1;
}
@@ -779,9 +779,9 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
GetWindowText(hwndEdit, szLabel, sizeof(szLabel));
hwndEdit=NULL;
- if(!_tcslen(szLabel)) break;
+ if (!_tcslen(szLabel)) break;
if (bd = (ButtonData*)tvi.lParam){
- if(!_tcscmp(szLabel,_T("---"))){
+ if (!_tcscmp(szLabel,_T("---"))) {
if(TreeView_GetChild(hMenuTree,tvi.hItem))
break;
else{
@@ -871,7 +871,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
bd = ( ButtonData* )tvi.lParam;
if (bd) {
- if(!TreeView_GetChild(hMenuTree, tvi.hItem)&&!(bd->fEntryOpType&QMF_EX_SEPARATOR))
+ if (!TreeView_GetChild(hMenuTree, tvi.hItem)&&!(bd->fEntryOpType&QMF_EX_SEPARATOR))
{
EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),TRUE);
EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),TRUE);
@@ -882,7 +882,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
{
EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),FALSE);
EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),FALSE);
- if(!(bd->fEntryOpType&QMF_EX_SEPARATOR))
+ if (!(bd->fEntryOpType&QMF_EX_SEPARATOR))
EnableWindow(GetDlgItem(hdlg,IDC_INQMENU),FALSE);
SetWindowText(GetDlgItem(hdlg,IDC_MENUVALUE),_T(""));
}
@@ -925,7 +925,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
GetWindowText(hwndEdit, szLabel, sizeof(szLabel));
hwndEdit=NULL;
- if(!_tcslen(szLabel)) break;
+ if (!_tcslen(szLabel)) break;
tvi.pszText=szLabel;
((ListData*)tvi.lParam)->dwOPFlags|=QMF_RENAMED;
@@ -946,7 +946,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
hti=TreeView_GetSelection(hButtonsList);
- if(hti==NULL||!TreeView_GetCount(hButtonsList)){
+ if(hti==NULL||!TreeView_GetCount(hButtonsList)) {
EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),FALSE);
EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),FALSE);
EnableWindow(GetDlgItem(hdlg,IDC_INQMENU),FALSE);
@@ -968,7 +968,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME2),TRUE);
CheckDlgButton(hdlg,IDC_ISSERVNAME2,((ListData*)tvi.lParam)->bIsOpServName);
- if(((ListData*)tvi.lParam)->ptszOPQValue)
+ if (((ListData*)tvi.lParam)->ptszOPQValue)
SetWindowText(GetDlgItem(hdlg,IDC_RCLICKVALUE),((ListData*)tvi.lParam)->ptszOPQValue);
else
SetWindowText(GetDlgItem(hdlg,IDC_RCLICKVALUE),_T(""));
@@ -979,9 +979,9 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
}break;
case WM_COMMAND:{
- switch(LOWORD(wparam)){
+ switch(LOWORD(wparam)) {
case IDC_VARHELP:{
- if(!g_varhelpDlg)
+ if (!g_varhelpDlg)
g_varhelpDlg=CreateDialog(hinstance,MAKEINTRESOURCE(IDD_HELPDIALOG), 0, HelpDlgProc);
else
//ShowWindow(g_varhelpDlg,SW_SHOWDEFAULT);
@@ -1027,7 +1027,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
TVITEM tvi;
ListData* ld;
- if(!(tvi.hItem=TreeView_GetSelection(hButtonsList)))
+ if (!(tvi.hItem=TreeView_GetSelection(hButtonsList)))
break;
tvi.mask=TVIF_HANDLE|TVIF_PARAM;
@@ -1038,7 +1038,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
ld->dwOPFlags|=QMF_DELETNEEDED;
TreeView_DeleteItem(hButtonsList,tvi.hItem);
- if(!TreeView_GetCount(hButtonsList))
+ if (!TreeView_GetCount(hButtonsList))
{
TreeView_DeleteAllItems(hMenuTree);
EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),FALSE);
@@ -1058,8 +1058,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
SortedList *sl=NULL;
TCHAR namebuff[MAX_PATH]={'\0'};
- if(!TreeView_GetCount(hButtonsList)) break;
- if(!(tvi.hItem=TreeView_GetSelection(hButtonsList))) break;
+ if (!TreeView_GetCount(hButtonsList)) break;
+ if (!(tvi.hItem=TreeView_GetSelection(hButtonsList))) break;
bd=mir_alloc(sizeof(ButtonData));
memset(bd,0,sizeof(ButtonData));
@@ -1097,7 +1097,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
HTREEITEM hti=NULL;
ButtonData *bd=NULL;
tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- if(!(tvi.hItem=TreeView_GetSelection(hMenuTree)))
+ if (!(tvi.hItem=TreeView_GetSelection(hMenuTree)))
break;
TreeView_GetItem(hMenuTree,&tvi);
hti=tvi.hItem;
@@ -1105,7 +1105,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
bd= (ButtonData*)tvi.lParam;
bd->dwOPFlags|=QMF_DELETNEEDED;
- if(tvi.hItem=TreeView_GetChild(hMenuTree,tvi.hItem)){
+ if(tvi.hItem=TreeView_GetChild(hMenuTree,tvi.hItem)) {
TCHAR strbuf[128];
while(tvi.hItem){
tvis.hInsertAfter=hti;
@@ -1122,7 +1122,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
}
TreeView_DeleteItem(hMenuTree,hti);
- if(!TreeView_GetCount(hMenuTree)){
+ if (!TreeView_GetCount(hMenuTree)) {
EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),FALSE);
EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),FALSE);
EnableWindow(GetDlgItem(hdlg,IDC_INQMENU),FALSE);
diff --git a/plugins/QuickReplies/common.h b/plugins/QuickReplies/common.h
index 688bf21f03..1955edfded 100644
--- a/plugins/QuickReplies/common.h
+++ b/plugins/QuickReplies/common.h
@@ -67,9 +67,9 @@ extern HANDLE hOnPreShutdown;
INT_PTR QuickRepliesService(WPARAM wParam, LPARAM lParam);
-INT_PTR OnModulesLoaded(WPARAM wParam, LPARAM lParam);
-INT_PTR OnOptInitialized(WPARAM wParam, LPARAM lParam);
-INT_PTR OnButtonPressed(WPARAM wParam, LPARAM lParam);
-INT_PTR OnPreShutdown(WPARAM wParam, LPARAM lParam);
+int OnModulesLoaded(WPARAM wParam, LPARAM lParam);
+int OnOptInitialized(WPARAM wParam, LPARAM lParam);
+int OnButtonPressed(WPARAM wParam, LPARAM lParam);
+int OnPreShutdown(WPARAM wParam, LPARAM lParam);
#endif //__QUICK_REPLY_H__ \ No newline at end of file
diff --git a/plugins/QuickReplies/events.cpp b/plugins/QuickReplies/events.cpp
index 1dfa8c898d..fd4991423d 100644
--- a/plugins/QuickReplies/events.cpp
+++ b/plugins/QuickReplies/events.cpp
@@ -32,7 +32,7 @@ INT_PTR QuickRepliesService(WPARAM, LPARAM)
return TRUE;
}
-INT_PTR OnModulesLoaded(WPARAM wParam, LPARAM lParam)
+int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
UnhookEvent(hOnModulesLoaded);
HICON hIcon = NULL;
@@ -90,7 +90,7 @@ INT_PTR OnModulesLoaded(WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR OnButtonPressed(WPARAM wParam, LPARAM lParam)
+int OnButtonPressed(WPARAM wParam, LPARAM lParam)
{
char key[64];
int index = 0;
@@ -175,7 +175,7 @@ INT_PTR OnButtonPressed(WPARAM wParam, LPARAM lParam)
return 1;
}
-INT_PTR OnPreShutdown(WPARAM wParam, LPARAM lParam)
+int OnPreShutdown(WPARAM wParam, LPARAM lParam)
{
if (ServiceExists(MS_BB_REMOVEBUTTON))
{
diff --git a/plugins/QuickReplies/options.cpp b/plugins/QuickReplies/options.cpp
index 36776884ae..1c26b9c385 100644
--- a/plugins/QuickReplies/options.cpp
+++ b/plugins/QuickReplies/options.cpp
@@ -62,7 +62,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam
return CallWindowProc(OldMessageEditProc, hwnd, msg, wParam, lParam);
}
-BOOL CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
@@ -186,27 +186,25 @@ BOOL CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
static UINT expertOnlyControls[] = { IDC_VARIABLES, IDC_VARIABLES_HINT };
-INT_PTR OnOptInitialized(WPARAM wParam, LPARAM lParam)
+int OnOptInitialized(WPARAM wParam, LPARAM lParam)
{
TCHAR tabName[32];
mir_sntprintf(tabName, SIZEOF(tabName), _T("Button %x"), iNumber + 1);
OPTIONSDIALOGPAGE odp = {0};
-
- odp.cbSize = sizeof(odp);
- odp.ptszGroup = _T("Message Sessions");
- odp.ptszTitle = _T("Quick Replies");
- odp.ptszTab = tabName;
- odp.position = iNumber;
- odp.hInstance = hInstance;
- odp.flags = ODPF_TCHAR;
-
- odp.expertOnlyControls = expertOnlyControls;
- odp.nExpertOnlyControls = SIZEOF(expertOnlyControls);
-
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_PAGE);
- odp.pfnDlgProc = DlgProcOptionsPage;
-
+ odp.cbSize = sizeof(odp);
+ odp.ptszGroup = _T("Message Sessions");
+ odp.ptszTitle = _T("Quick Replies");
+ odp.ptszTab = tabName;
+ odp.position = iNumber;
+ odp.hInstance = hInstance;
+ odp.flags = ODPF_TCHAR;
+
+ odp.expertOnlyControls = expertOnlyControls;
+ odp.nExpertOnlyControls = SIZEOF(expertOnlyControls);
+
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_PAGE);
+ odp.pfnDlgProc = DlgProcOptionsPage;
CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
return 0;
diff --git a/plugins/Quotes/CurrencyConverter.cpp b/plugins/Quotes/CurrencyConverter.cpp
index 946901dd29..0e04d2562e 100644
--- a/plugins/Quotes/CurrencyConverter.cpp
+++ b/plugins/Quotes/CurrencyConverter.cpp
@@ -212,17 +212,17 @@ namespace
tstring sText = get_window_text(hwndAmount);
double dAmount = 1.0;
- if((true == str2double(sText,dAmount)) && (dAmount > 0.0))
+ if ((true == str2double(sText,dAmount)) && (dAmount > 0.0))
{
Quotes_DBWriteDouble(NULL,QUOTES_MODULE_NAME,DB_STR_CC_AMOUNT,dAmount);
size_t nFrom = static_cast<size_t>(::SendMessage(::GetDlgItem(hDlg,IDC_COMBO_CONVERT_FROM),CB_GETCURSEL,0,0));
size_t nTo = static_cast<size_t>(::SendMessage(::GetDlgItem(hDlg,IDC_COMBO_CONVERT_INTO),CB_GETCURSEL,0,0));
- if((CB_ERR != nFrom) && (CB_ERR != nTo) && (nFrom != nTo))
+ if ((CB_ERR != nFrom) && (CB_ERR != nTo) && (nFrom != nTo))
{
const CQuotesProviderGoogle::CQuoteSection& rSection = get_quotes();
size_t cQuotes = rSection.GetQuoteCount();
- if((nFrom < cQuotes) && (nTo < cQuotes))
+ if ((nFrom < cQuotes) && (nTo < cQuotes))
{
CQuotesProviderGoogle::CRateInfo ri;
CQuotesProviderGoogle::CQuote from = rSection.GetQuote(nFrom);
diff --git a/plugins/Quotes/Forex.cpp b/plugins/Quotes/Forex.cpp
index a661958302..d99d2aa952 100644
--- a/plugins/Quotes/Forex.cpp
+++ b/plugins/Quotes/Forex.cpp
@@ -292,18 +292,18 @@ namespace
INT_PTR QuoteProtoFunc_SetStatus(WPARAM wp,LPARAM /*lp*/)
{
int nStatus = wp;
- if((ID_STATUS_ONLINE == nStatus) || (ID_STATUS_OFFLINE == nStatus))
+ if ((ID_STATUS_ONLINE == nStatus) || (ID_STATUS_OFFLINE == nStatus))
{
int nOldStatus = g_nStatus;
if(nStatus != g_nStatus)
{
g_nStatus = nStatus;
- if((ID_STATUS_ONLINE == nOldStatus) && (ID_STATUS_OFFLINE == g_nStatus))
+ if ((ID_STATUS_ONLINE == nOldStatus) && (ID_STATUS_OFFLINE == g_nStatus))
{
BOOL b = ::SetEvent(g_hEventWorkThreadStop);
assert(b);
}
- else if((ID_STATUS_ONLINE == g_nStatus) && (ID_STATUS_OFFLINE == nOldStatus))
+ else if ((ID_STATUS_ONLINE == g_nStatus) && (ID_STATUS_OFFLINE == nOldStatus))
{
BOOL b = ::ResetEvent(g_hEventWorkThreadStop);
assert(b && "Failed to reset event");
@@ -370,7 +370,7 @@ namespace
INT_PTR QuoteProtoFunc_LoadIcon(WPARAM wp,LPARAM /*lp*/)
{
- if((wp & 0xffff) == PLI_PROTOCOL)
+ if ((wp & 0xffff) == PLI_PROTOCOL)
{
return reinterpret_cast<int>(::CopyIcon(Quotes_LoadIconEx(ICON_STR_MAIN)));
}
@@ -459,7 +459,7 @@ extern "C"
mir_getMMI(&mmi);
mir_getUTFI(&utfi);
mir_getLP(&Global_pluginInfo);
-// if((mirandaVersion >= 0x0800) && (1 == mir_getXI(&xi)))
+// if ((mirandaVersion >= 0x0800) && (1 == mir_getXI(&xi)))
// {
// CModuleInfo::SetXMLEnginePtr(CModuleInfo::TXMLEnginePtr(new CXMLEngineMI));
// }
diff --git a/plugins/Quotes/HTTPSession.cpp b/plugins/Quotes/HTTPSession.cpp
index 837be0de0a..aa66948ae9 100644
--- a/plugins/Quotes/HTTPSession.cpp
+++ b/plugins/Quotes/HTTPSession.cpp
@@ -6,8 +6,8 @@
class CHTTPSession::CImpl
{
public:
- CImpl(){}
- virtual ~CImpl(){}
+ CImpl() {}
+ virtual ~CImpl() {}
virtual bool OpenURL(const tstring& rsURL) = 0;
virtual bool ReadResponce(tstring& rsResponce)const = 0;
@@ -112,7 +112,7 @@ namespace
class CImplMI : public CHTTPSession::CImpl
{
public:
- CImplMI(){}
+ CImplMI() {}
static bool Init()
{
@@ -182,7 +182,7 @@ namespace
if(pReply)
{
- if((200 == pReply->resultCode) && (pReply->dataLength > 0))
+ if ((200 == pReply->resultCode) && (pReply->dataLength > 0))
{
TBuffer apBuffer;
apBuffer.insert(apBuffer.begin(),pReply->pData,pReply->pData+pReply->dataLength);
@@ -190,7 +190,7 @@ namespace
char* pResult = &*(apBuffer.begin());
int nIndex = find_header(pReply,"Content-Type");
- if((-1 != nIndex) && (NULL != strstr(_strlwr(pReply->headers[nIndex].szValue),"utf-8")))
+ if ((-1 != nIndex) && (NULL != strstr(_strlwr(pReply->headers[nIndex].szValue),"utf-8")))
{
TCHAR* p = mir_utf8decodeT(pResult);
rsResponce = p;
diff --git a/plugins/Quotes/IHTMLEngine.h b/plugins/Quotes/IHTMLEngine.h
index 8fe54d5ec5..7df3074d3e 100644
--- a/plugins/Quotes/IHTMLEngine.h
+++ b/plugins/Quotes/IHTMLEngine.h
@@ -10,7 +10,7 @@ public:
public:
IHTMLEngine(void){}
- virtual ~IHTMLEngine(){}
+ virtual ~IHTMLEngine() {}
virtual THTMLParserPtr GetParserPtr()const = 0;
};
diff --git a/plugins/Quotes/IHTMLParser.h b/plugins/Quotes/IHTMLParser.h
index 2b124b0f6c..defc6f61cb 100644
--- a/plugins/Quotes/IHTMLParser.h
+++ b/plugins/Quotes/IHTMLParser.h
@@ -14,8 +14,8 @@ public:
};
public:
- IHTMLNode(){}
- virtual ~IHTMLNode(){}
+ IHTMLNode() {}
+ virtual ~IHTMLNode() {}
virtual size_t GetChildCount()const = 0;
virtual THTMLNodePtr GetChildPtr(size_t nIndex) = 0;
@@ -32,8 +32,8 @@ class IHTMLParser
public:
typedef IHTMLNode::THTMLNodePtr THTMLNodePtr;
public:
- IHTMLParser(){}
- virtual ~IHTMLParser(){}
+ IHTMLParser() {}
+ virtual ~IHTMLParser() {}
virtual THTMLNodePtr ParseString(const tstring& rsHTML) = 0;
};
diff --git a/plugins/Quotes/IQuotesProvider.h b/plugins/Quotes/IQuotesProvider.h
index d0d4197023..a03a2a9bcd 100644
--- a/plugins/Quotes/IQuotesProvider.h
+++ b/plugins/Quotes/IQuotesProvider.h
@@ -19,8 +19,8 @@ public:
};
public:
- IQuotesProvider(){}
- virtual ~IQuotesProvider(){}
+ IQuotesProvider() {}
+ virtual ~IQuotesProvider() {}
virtual bool Init() = 0;
virtual const CProviderInfo& GetInfo()const = 0;
diff --git a/plugins/Quotes/IXMLEngine.h b/plugins/Quotes/IXMLEngine.h
index e20fc0e64e..910c3efea0 100644
--- a/plugins/Quotes/IXMLEngine.h
+++ b/plugins/Quotes/IXMLEngine.h
@@ -7,8 +7,8 @@ public:
typedef boost::shared_ptr<IXMLNode> TXMLNodePtr;
public:
- IXMLNode(){}
- virtual ~IXMLNode(){}
+ IXMLNode() {}
+ virtual ~IXMLNode() {}
virtual size_t GetChildCount()const = 0;
virtual TXMLNodePtr GetChildNode(size_t nIndex)const = 0;
@@ -31,9 +31,9 @@ inline tostream& operator<<(tostream& o,const IXMLNode& node)
class IXMLEngine
{
public:
- IXMLEngine(){}
+ IXMLEngine() {}
- virtual ~IXMLEngine(){}
+ virtual ~IXMLEngine() {}
virtual IXMLNode::TXMLNodePtr LoadFile(const tstring& rsFileName)const = 0;
virtual bool SaveFile(const tstring& rsFileName,const IXMLNode::TXMLNodePtr& pNode)const = 0;
diff --git a/plugins/Quotes/IconLib.cpp b/plugins/Quotes/IconLib.cpp
index 2c7a3de436..9702bfe3d8 100644
--- a/plugins/Quotes/IconLib.cpp
+++ b/plugins/Quotes/IconLib.cpp
@@ -56,7 +56,7 @@ void Quotes_IconsInit()
// TCHAR* szRootSection = TranslateTS(A2T(QUOTES_PROTOCOL_NAME));
- for( int i = 0; i < SIZEOF(iconList); i++ )
+ for ( int i = 0; i < SIZEOF(iconList); i++ )
{
// char szSettingName[100];
// TCHAR szSectionName[100];
diff --git a/plugins/Quotes/ImportExport.cpp b/plugins/Quotes/ImportExport.cpp
index 1fba49ba28..2e38be0c0f 100644
--- a/plugins/Quotes/ImportExport.cpp
+++ b/plugins/Quotes/ImportExport.cpp
@@ -381,7 +381,7 @@ namespace
}
}
- if((false == sName.empty()) && (false == sType.empty()))
+ if ((false == sName.empty()) && (false == sType.empty()))
{
std::string s = quotes_t2a(sName.c_str());
dbs.szSetting = s.c_str();//T2CA(sName.c_str());
@@ -475,7 +475,7 @@ namespace
}
}
- if((true == bCListModule) && (0 == quotes_stricmp(sName.c_str(),_T("Group"))))
+ if ((true == bCListModule) && (0 == quotes_stricmp(sName.c_str(),_T("Group"))))
{
CallService(MS_CLIST_GROUPCREATE,NULL,reinterpret_cast<LPARAM>(sValue.c_str()));
}
@@ -546,7 +546,7 @@ namespace
{
IXMLNode::TXMLNodePtr pNode = pXmlContact->GetChildNode(i);
tstring sName = pNode->GetName();
- if((0 == quotes_stricmp(g_pszXmlModule,sName.c_str()))
+ if ((0 == quotes_stricmp(g_pszXmlModule,sName.c_str()))
&& (0 == quotes_stricmp(g_sQuotes.c_str(),pNode->GetText().c_str())))
{
return pNode;
@@ -593,7 +593,7 @@ namespace
if(pXMLSetting && (0 == quotes_stricmp(g_pszXmlSetting,pXMLSetting->GetName().c_str())))
{
TNameValue Item = parse_setting_node(pXMLSetting);
- if((0 == quotes_stricmp(g_sQuotesProvider.c_str(),Item.first.c_str())) && (false == Item.second.empty()))
+ if ((0 == quotes_stricmp(g_sQuotesProvider.c_str(),Item.first.c_str())) && (false == Item.second.empty()))
{
return CModuleInfo::GetInstance().GetQuoteProvidersPtr()->FindProvider(Item.second);
}
@@ -649,7 +649,7 @@ namespace
}
}
- if((false == sFromID.empty()) && (false == sToID.empty()))
+ if ((false == sFromID.empty()) && (false == sToID.empty()))
{
m_hContact = rProvider.GetContactByID(sFromID,sToID);
}
diff --git a/plugins/Quotes/IsWithinAccuracy.h b/plugins/Quotes/IsWithinAccuracy.h
index 708c101a27..5e39281719 100644
--- a/plugins/Quotes/IsWithinAccuracy.h
+++ b/plugins/Quotes/IsWithinAccuracy.h
@@ -5,7 +5,7 @@ inline bool IsWithinAccuracy(double dValue1, double dValue2, double dAccuracy =
{
double dDifference = dValue1 - dValue2 ;
- if((-dAccuracy <= dDifference) && (dDifference <= dAccuracy))
+ if ((-dAccuracy <= dDifference) && (dDifference <= dAccuracy))
return true ;
else
return false ;
diff --git a/plugins/Quotes/Locale.cpp b/plugins/Quotes/Locale.cpp
index 66c9cf5c14..c01f67148a 100644
--- a/plugins/Quotes/Locale.cpp
+++ b/plugins/Quotes/Locale.cpp
@@ -14,12 +14,12 @@ namespace
HKEY hKey = NULL;
LONG lResult = ::RegOpenKeyEx(HKEY_CURRENT_USER,
_T("Control Panel\\International"),0,KEY_QUERY_VALUE,&hKey);
- if((ERROR_SUCCESS == lResult) && (NULL != hKey))
+ if ((ERROR_SUCCESS == lResult) && (NULL != hKey))
{
DWORD dwType = 0;
DWORD dwSize = 0;
lResult = ::RegQueryValueEx(hKey,pszValueName,nullptr,&dwType,nullptr,&dwSize);
- if((ERROR_SUCCESS == lResult) && ((REG_SZ == dwType) || (REG_EXPAND_SZ == dwType)))
+ if ((ERROR_SUCCESS == lResult) && ((REG_SZ == dwType) || (REG_EXPAND_SZ == dwType)))
{
std::vector<TCHAR> aBuffer(dwSize);
lResult = ::RegQueryValueEx(hKey,pszValueName,nullptr,nullptr,reinterpret_cast<LPBYTE>(&*aBuffer.begin()),&dwSize);
diff --git a/plugins/Quotes/ModuleInfo.cpp b/plugins/Quotes/ModuleInfo.cpp
index f9a8513b41..69a835409e 100644
--- a/plugins/Quotes/ModuleInfo.cpp
+++ b/plugins/Quotes/ModuleInfo.cpp
@@ -80,10 +80,10 @@ CModuleInfo::TQuotesProvidersPtr CModuleInfo::GetQuoteProvidersPtr()
CModuleInfo::TXMLEnginePtr CModuleInfo::GetXMLEnginePtr()
{
- if(!g_pXMLEngine)
+ if (!g_pXMLEngine)
{
CGuard<CLightMutex> cs(g_lmParsers);
- if(!g_pXMLEngine)
+ if (!g_pXMLEngine)
{
mir_getXI(&xi);
g_pXMLEngine = TXMLEnginePtr(new CXMLEngineMI);
@@ -100,10 +100,10 @@ CModuleInfo::TXMLEnginePtr CModuleInfo::GetXMLEnginePtr()
CModuleInfo::THTMLEnginePtr CModuleInfo::GetHTMLEngine()
{
- if(!g_pHTMLEngine)
+ if (!g_pHTMLEngine)
{
CGuard<CLightMutex> cs(g_lmParsers);
- if(!g_pHTMLEngine)
+ if (!g_pHTMLEngine)
{
g_pHTMLEngine = THTMLEnginePtr(new CHTMLEngineMS);
}
@@ -127,13 +127,13 @@ bool CModuleInfo::Verify()
return false;
}
- if(!GetXMLEnginePtr())
+ if (!GetXMLEnginePtr())
{
Quotes_MessageBox(NULL,TranslateT("Miranda could not load Quotes plugin. XML parser is missing."),MB_OK|MB_ICONERROR);
return false;
}
- if(!g_pHTMLEngine && (false == CHTMLParserMS::IsInstalled()))
+ if (!g_pHTMLEngine && (false == CHTMLParserMS::IsInstalled()))
{
Quotes_MessageBox(NULL,
TranslateT("Miranda could not load Quotes plugin. Microsoft HTML parser is missing."),
diff --git a/plugins/Quotes/QuoteChart.cpp b/plugins/Quotes/QuoteChart.cpp
index 68fdbf57cb..3746540d23 100644
--- a/plugins/Quotes/QuoteChart.cpp
+++ b/plugins/Quotes/QuoteChart.cpp
@@ -66,7 +66,7 @@ namespace
tstring sName;
std::getline(line,sName,_T('\t'));
line >> oDateTime >> dRate;
- if((false == line.fail()) && (true == line.eof()))
+ if ((false == line.fail()) && (true == line.eof()))
{
rChart.AddValue(oDateTime,dRate);
}
diff --git a/plugins/Quotes/QuoteInfoDlg.cpp b/plugins/Quotes/QuoteInfoDlg.cpp
index 0df1e682b6..88253ec45d 100644
--- a/plugins/Quotes/QuoteInfoDlg.cpp
+++ b/plugins/Quotes/QuoteInfoDlg.cpp
@@ -198,7 +198,7 @@ INT_PTR QuotesMenu_OpenLogFile(WPARAM wp,LPARAM lp)
}
tstring sLogFileName;
- if((true == get_log_file(hContact,sLogFileName)) && (false == sLogFileName.empty()))
+ if ((true == get_log_file(hContact,sLogFileName)) && (false == sLogFileName.empty()))
{
::ShellExecute(NULL,_T("open"),sLogFileName.c_str(),NULL,NULL,SW_SHOWNORMAL);
}
@@ -215,7 +215,7 @@ INT_PTR QuotesMenu_RefreshContact(WPARAM wp,LPARAM lp)
}
CQuotesProviders::TQuotesProviderPtr pProvider = CModuleInfo::GetQuoteProvidersPtr()->GetContactProviderPtr(hContact);
- if(!pProvider)
+ if (!pProvider)
{
return 0;
}
diff --git a/plugins/Quotes/QuotesProviderFinance.cpp b/plugins/Quotes/QuotesProviderFinance.cpp
index 442869deeb..99d6127b32 100644
--- a/plugins/Quotes/QuotesProviderFinance.cpp
+++ b/plugins/Quotes/QuotesProviderFinance.cpp
@@ -42,7 +42,7 @@ bool CQuotesProviderFinance::WatchForQuote(const CQuote& rQuote,bool bWatch)
TContracts::iterator i = std::find_if(m_aContacts.begin(),m_aContacts.end(),
boost::bind(is_quote_id_equal,_1,sQuoteID));
- if((false == bWatch) && (i != m_aContacts.end()))
+ if ((false == bWatch) && (i != m_aContacts.end()))
{
HANDLE hContact = *i;
{// for CCritSection
@@ -53,7 +53,7 @@ bool CQuotesProviderFinance::WatchForQuote(const CQuote& rQuote,bool bWatch)
CallService(MS_DB_CONTACT_DELETE,reinterpret_cast<WPARAM>(hContact),0);
return true;
}
- else if((true == bWatch) && (i == m_aContacts.end()))
+ else if ((true == bWatch) && (i == m_aContacts.end()))
{
HANDLE hContact = CreateNewContact(rQuote.GetSymbol());
if(hContact)
@@ -136,7 +136,7 @@ namespace
for(int i = 0;i < cItems;++i)
{
const CQuotesProviderBase::CQuote* pQuote = get_quote_ptr_from_lb_index(hwndList,i);
- if((nullptr != pQuote)
+ if ((nullptr != pQuote)
&& ((0 == quotes_stricmp(rsQuoteID.c_str(),pQuote->GetID().c_str()))
|| (0 == quotes_stricmp(rsQuoteID.c_str(),pQuote->GetName().c_str()))
|| (0 == quotes_stricmp(rsQuoteID.c_str(),pQuote->GetSymbol().c_str()))))
diff --git a/plugins/Quotes/QuotesProviderGoogle.cpp b/plugins/Quotes/QuotesProviderGoogle.cpp
index 7711c2d9ba..6458180324 100644
--- a/plugins/Quotes/QuotesProviderGoogle.cpp
+++ b/plugins/Quotes/QuotesProviderGoogle.cpp
@@ -45,7 +45,7 @@ bool CQuotesProviderGoogle::WatchForRate(const CRateInfo& ri,
{
TContracts::const_iterator i = std::find_if(m_aContacts.begin(),m_aContacts.end(),
boost::bind(is_rate_watched,_1,ri.m_from,ri.m_to));
- if((true == bWatch) && (i == m_aContacts.end()))
+ if ((true == bWatch) && (i == m_aContacts.end()))
{
tstring sName = make_contact_name(ri.m_from.GetSymbol(),ri.m_to.GetSymbol());
HANDLE hContact = CreateNewContact(sName);
@@ -65,7 +65,7 @@ bool CQuotesProviderGoogle::WatchForRate(const CRateInfo& ri,
return true;
}
}
- else if((false == bWatch) && (i != m_aContacts.end()))
+ else if ((false == bWatch) && (i != m_aContacts.end()))
{
HANDLE hContact = *i;
{// for CCritSection
@@ -125,7 +125,7 @@ namespace
bool parse_html_node(const THTMLNodePtr& pNode,double& rdRate)
{
tstring sID = pNode->GetAttribute(_T("id"));
- if((false == sID.empty()) && (0 == quotes_stricmp(sID.c_str(),_T("currency_converter_result"))))
+ if ((false == sID.empty()) && (0 == quotes_stricmp(sID.c_str(),_T("currency_converter_result"))))
{
size_t cChild = pNode->GetChildCount();
// assert(1 == cChild);
@@ -189,15 +189,15 @@ void CQuotesProviderGoogle::RefreshQuotes(TContracts& anContacts)
tstring sFullURL = build_url(hContact,sURL);
// LogIt(Info,sFullURL);
- if((true == http.OpenURL(sFullURL)) && (true == IsOnline()))
+ if ((true == http.OpenURL(sFullURL)) && (true == IsOnline()))
{
tstring sHTML;
- if((true == http.ReadResponce(sHTML)) && (true == IsOnline()))
+ if ((true == http.ReadResponce(sHTML)) && (true == IsOnline()))
{
// LogIt(Info,sHTML);
double dRate = 0.0;
- if((true == parse_responce(sHTML,dRate)) && (true == IsOnline()))
+ if ((true == parse_responce(sHTML,dRate)) && (true == IsOnline()))
{
WriteContactRate(hContact,dRate);
continue;
@@ -253,7 +253,7 @@ namespace
tstring make_rate_name(const CQuotesProviderGoogle::CQuote& rFrom,
const CQuotesProviderGoogle::CQuote& rTo)
{
- if((false == rFrom.GetName().empty()) && (false == rTo.GetName().empty()))
+ if ((false == rFrom.GetName().empty()) && (false == rTo.GetName().empty()))
{
return make_contact_name(rFrom.GetName(),rTo.GetName());
}
@@ -395,11 +395,11 @@ namespace
{
size_t nFrom = static_cast<size_t>(::SendMessage(::GetDlgItem(hdlg,IDC_COMBO_CONVERT_FROM),CB_GETCURSEL,0,0));
size_t nTo = static_cast<size_t>(::SendMessage(::GetDlgItem(hdlg,IDC_COMBO_CONVERT_INTO),CB_GETCURSEL,0,0));
- if((CB_ERR != nFrom) && (CB_ERR != nTo) && (nFrom != nTo))
+ if ((CB_ERR != nFrom) && (CB_ERR != nTo) && (nFrom != nTo))
{
const CQuotesProviderGoogle::CQuoteSection& rSection = get_quotes();
size_t cQuotes = rSection.GetQuoteCount();
- if((nFrom < cQuotes) && (nTo < cQuotes))
+ if ((nFrom < cQuotes) && (nTo < cQuotes))
{
CQuotesProviderGoogle::CRateInfo ri;
ri.m_from = rSection.GetQuote(nFrom);
@@ -421,7 +421,7 @@ namespace
int nSel = ::SendMessage(hWnd,LB_GETCURSEL,0,0);
if(LB_ERR != nSel)
{
- if((LB_ERR != ::SendMessage(hWnd, LB_DELETESTRING,nSel,0))
+ if ((LB_ERR != ::SendMessage(hWnd, LB_DELETESTRING,nSel,0))
&& (nSel < static_cast<int>(g_aWatchedRates.size())))
{
@@ -485,15 +485,15 @@ double CQuotesProviderGoogle::Convert(double dAmount,const CQuote& from,const CQ
// LogIt(Info,sFullURL);
CHTTPSession http;
- if((true == http.OpenURL(sFullURL)))
+ if ((true == http.OpenURL(sFullURL)))
{
tstring sHTML;
- if((true == http.ReadResponce(sHTML)))
+ if ((true == http.ReadResponce(sHTML)))
{
// LogIt(Info,sHTML);
double dResult = 0.0;
- if((true == parse_responce(sHTML,dResult)))
+ if ((true == parse_responce(sHTML,dResult)))
{
return dResult;
}
diff --git a/plugins/Quotes/QuotesProviderGoogleFinance.cpp b/plugins/Quotes/QuotesProviderGoogleFinance.cpp
index 25b49f4120..8a129b6b8b 100644
--- a/plugins/Quotes/QuotesProviderGoogleFinance.cpp
+++ b/plugins/Quotes/QuotesProviderGoogleFinance.cpp
@@ -152,7 +152,7 @@ namespace
input.imbue(std::locale("English_United States.1252"));
input >> rdValue;
- if((true == input.bad()) || (true == input.fail()))
+ if ((true == input.bad()) || (true == input.fail()))
{
tistringstream inputSys(rsText);
input.imbue(GetSystemLocale());
@@ -240,7 +240,7 @@ namespace
assert(pValue);
- if((pValue) && (true == get_double_value(sDiff,*pValue)))
+ if ((pValue) && (true == get_double_value(sDiff,*pValue)))
{
rInfo.m_nFlags |= nItem;
return true;
@@ -315,10 +315,10 @@ void CQuotesProviderGoogleFinance::RefreshQuotes(TContracts& anContacts)
tstring sFullURL = build_url(hContact,sURL);
// LogIt(Info,sFullURL);
- if((true == http.OpenURL(sFullURL)) && (true == IsOnline()))
+ if ((true == http.OpenURL(sFullURL)) && (true == IsOnline()))
{
tstring sHTML;
- if((true == http.ReadResponce(sHTML)) && (true == IsOnline()))
+ if ((true == http.ReadResponce(sHTML)) && (true == IsOnline()))
{
// LogIt(Info,sHTML);
diff --git a/plugins/Quotes/QuotesProviderVisitor.h b/plugins/Quotes/QuotesProviderVisitor.h
index 600b7ae64c..9ae601f2a1 100644
--- a/plugins/Quotes/QuotesProviderVisitor.h
+++ b/plugins/Quotes/QuotesProviderVisitor.h
@@ -11,8 +11,8 @@ class CQuotesProviderYahoo;
class CQuotesProviderVisitor
{
public:
- CQuotesProviderVisitor(){}
- virtual ~CQuotesProviderVisitor(){}
+ CQuotesProviderVisitor() {}
+ virtual ~CQuotesProviderVisitor() {}
virtual void Visit(const CQuotesProviderBase& rProvider){}
virtual void Visit(const CQuotesProviderFinance& rProvider){}
diff --git a/plugins/Quotes/QuotesProviderYahoo.cpp b/plugins/Quotes/QuotesProviderYahoo.cpp
index e6315953de..35edb3207c 100644
--- a/plugins/Quotes/QuotesProviderYahoo.cpp
+++ b/plugins/Quotes/QuotesProviderYahoo.cpp
@@ -10,11 +10,11 @@ namespace
{
void remove_quotes(tstring& s)
{
- if(*s.begin() == _T('"'))
+ if (*s.begin() == _T('"'))
{
s.erase(s.begin());
}
- if(*s.rbegin() == _T('"'))
+ if (*s.rbegin() == _T('"'))
{
tstring::iterator i(s.begin());
std::advance(i,s.size()-1);
@@ -24,13 +24,13 @@ namespace
void remove_end_of_line(tstring& s)
{
- if(*s.rbegin() == _T('\n'))
+ if (*s.rbegin() == _T('\n'))
{
tstring::iterator i(s.begin());
std::advance(i,s.size()-1);
s.erase(i);
}
- if(*s.rbegin() == _T('\r'))
+ if (*s.rbegin() == _T('\r'))
{
tstring::iterator i(s.begin());
std::advance(i,s.size()-1);
@@ -102,10 +102,10 @@ void CQuotesProviderYahoo::RefreshQuotes(TContracts& anContacts)
{
oURL << _T("&f=snl1ohgpc1");
CHTTPSession http;
- if((true == http.OpenURL(oURL.str())) && (true == IsOnline()))
+ if ((true == http.OpenURL(oURL.str())) && (true == IsOnline()))
{
tstring sFile;
- if((true == http.ReadResponce(sFile)) && (true == IsOnline()))
+ if ((true == http.ReadResponce(sFile)) && (true == IsOnline()))
{
tistringstream out_str(sFile.c_str());
while(false == out_str.eof())
diff --git a/plugins/Quotes/QuotesProviders.cpp b/plugins/Quotes/QuotesProviders.cpp
index d5a65c470c..5fac2af14f 100644
--- a/plugins/Quotes/QuotesProviders.cpp
+++ b/plugins/Quotes/QuotesProviders.cpp
@@ -55,7 +55,7 @@ namespace
void convert_contact_settings(HANDLE hContact)
{
WORD dwLogMode = DBGetContactSettingWord(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG,static_cast<WORD>(lmDisabled));
- if((dwLogMode&lmInternalHistory) || (dwLogMode&lmExternalFile))
+ if ((dwLogMode&lmInternalHistory) || (dwLogMode&lmExternalFile))
{
DBWriteContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,DB_STR_CONTACT_SPEC_SETTINGS,1);
}
diff --git a/plugins/Quotes/SettingsDlg.cpp b/plugins/Quotes/SettingsDlg.cpp
index 6b5d73f5f4..e5795b51d1 100644
--- a/plugins/Quotes/SettingsDlg.cpp
+++ b/plugins/Quotes/SettingsDlg.cpp
@@ -399,7 +399,7 @@ namespace
if(BN_CLICKED == HIWORD(wp))
{
CSettingWindowParam* pParam = get_param(hWnd);
- if(!pParam->m_pPopupSettings)
+ if (!pParam->m_pPopupSettings)
{
CQuotesProviders::TQuotesProviderPtr pProvider = CModuleInfo::GetQuoteProvidersPtr()->GetContactProviderPtr(pParam->m_hContact);
@@ -447,7 +447,7 @@ namespace
tstring sLogFile = get_window_text(hwndLogFile);
tstring sLogFileFormat = get_window_text(hwndLogFileFrmt);
tstring sHistoryFormat = get_window_text(hwndHistoryFrmt);
- if((nLogMode&lmExternalFile))
+ if ((nLogMode&lmExternalFile))
{
if(true == sLogFile.empty())
{
@@ -463,7 +463,7 @@ namespace
}
}
- if((true == bOk) && (nLogMode&lmInternalHistory) && (true == sHistoryFormat.empty()))
+ if ((true == bOk) && (nLogMode&lmInternalHistory) && (true == sHistoryFormat.empty()))
{
prepare_edit_ctrl_for_error(hwndHistoryFrmt);
Quotes_MessageBox(hWnd,TranslateT("Enter history format."),MB_OK|MB_ICONERROR);
@@ -472,7 +472,7 @@ namespace
HWND hwndPopupFrmt = ::GetDlgItem(hWnd,IDC_EDIT_POPUP_FORMAT);
tstring sPopupFormat = get_window_text(hwndPopupFrmt);
- if((true == bOk) && (nLogMode&lmPopup) && (true == sPopupFormat.empty()))
+ if ((true == bOk) && (nLogMode&lmPopup) && (true == sPopupFormat.empty()))
{
prepare_edit_ctrl_for_error(hwndPopupFrmt);
Quotes_MessageBox(hWnd,TranslateT("Enter popup window format."),MB_OK|MB_ICONERROR);
@@ -624,7 +624,7 @@ namespace
tstring sLogFile = get_window_text(hwndLogFile);
tstring sLogFileFormat = get_window_text(hwndLogFileFrmt);
- if((nLogMode&lmExternalFile))
+ if ((nLogMode&lmExternalFile))
{
if(true == sLogFile.empty())
{
@@ -642,7 +642,7 @@ namespace
HWND hwndHistoryFrmt = ::GetDlgItem(hWnd,IDC_EDIT_HISTORY_FORMAT);
tstring sHistoryFormat = get_window_text(hwndHistoryFrmt);
- if((true == bOk) && (nLogMode&lmInternalHistory) && (true == sHistoryFormat.empty()))
+ if ((true == bOk) && (nLogMode&lmInternalHistory) && (true == sHistoryFormat.empty()))
{
prepare_edit_ctrl_for_error(hwndHistoryFrmt);
Quotes_MessageBox(hWnd,TranslateT("Enter history format."),MB_OK|MB_ICONERROR);
@@ -651,7 +651,7 @@ namespace
HWND hwndPopupFrmt = ::GetDlgItem(hWnd,IDC_EDIT_POPUP_FORMAT);
tstring sPopupFormat = get_window_text(hwndPopupFrmt);
- if((true == bOk) && (nLogMode&lmPopup) && (true == sPopupFormat.empty()))
+ if ((true == bOk) && (nLogMode&lmPopup) && (true == sPopupFormat.empty()))
{
prepare_edit_ctrl_for_error(hwndPopupFrmt);
Quotes_MessageBox(hWnd,TranslateT("Enter popup window format."),MB_OK|MB_ICONERROR);
diff --git a/plugins/Quotes/XMLEngineMI.cpp b/plugins/Quotes/XMLEngineMI.cpp
index f17aa54aa3..7e2adfb7d9 100644
--- a/plugins/Quotes/XMLEngineMI.cpp
+++ b/plugins/Quotes/XMLEngineMI.cpp
@@ -154,7 +154,7 @@ IXMLNode::TXMLNodePtr CXMLEngineMI::LoadFile(const tstring& rsFileName)const
if(0 == ::_tfopen_s(&stream,rsFileName.c_str(),_T("r")))
{
struct _stat st;
- if(-1 != ::_fstat(::_fileno(stream),&st))
+ if (-1 != ::_fstat(::_fileno(stream),&st))
{
std::vector<char> aBuffer(st.st_size+1);
char* pBuffer = &*(aBuffer.begin());
diff --git a/plugins/RecentContacts/RecentContacts.cpp b/plugins/RecentContacts/RecentContacts.cpp
index 0eda98536f..9ec3eb0f04 100644
--- a/plugins/RecentContacts/RecentContacts.cpp
+++ b/plugins/RecentContacts/RecentContacts.cpp
@@ -398,7 +398,7 @@ int OnMenuCommandShowList(WPARAM wParam, LPARAM lParam)
dbe.pBlob = buf;
HANDLE curEvent;
HANDLE curContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- for(; curContact != NULL; curContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)curContact, 0))
+ for (; curContact != NULL; curContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)curContact, 0))
{
// if (IsMessageAPI)
{
@@ -417,7 +417,7 @@ int OnMenuCommandShowList(WPARAM wParam, LPARAM lParam)
curEvent = (HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)curContact, 0);
if (curEvent != NULL)
{
- for( ; curEvent != NULL; curEvent = (HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)curEvent, 0))
+ for ( ; curEvent != NULL; curEvent = (HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)curEvent, 0))
{
dbe.cbBlob = 1;
if (CallService(MS_DB_EVENT_GET, (WPARAM)curEvent, (LPARAM)&dbe) != 0)
diff --git a/plugins/SRMM/richutil.c b/plugins/SRMM/richutil.c
index 14296717f7..87d827db9b 100644
--- a/plugins/SRMM/richutil.c
+++ b/plugins/SRMM/richutil.c
@@ -241,7 +241,7 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (IsWindow(hwnd))
{
- if((WNDPROC)GetWindowLongPtr(hwnd, GWLP_WNDPROC) == &RichUtil_Proc)
+ if ((WNDPROC)GetWindowLongPtr(hwnd, GWLP_WNDPROC) == &RichUtil_Proc)
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)ru->origProc);
}
diff --git a/plugins/SRMM/statusicon.c b/plugins/SRMM/statusicon.c
index d8c5a5d87a..cd7ac3872e 100644
--- a/plugins/SRMM/statusicon.c
+++ b/plugins/SRMM/statusicon.c
@@ -103,7 +103,7 @@ INT_PTR ModifyStatusIcon(WPARAM wParam, LPARAM lParam) {
while(current) {
if(strcmp(current->sid.szModule, sid->szModule) == 0 && current->sid.dwId == sid->dwId) {
- if(!hContact) {
+ if (!hContact) {
current->sid.flags = sid->flags;
if(sid->hIcon) {
DestroyIcon(current->sid.hIcon);
@@ -146,8 +146,8 @@ void DrawStatusIcons(HANDLE hContact, HDC hDC, RECT r, int gap) {
while(current && x < r.right) {
sprintf(buff, "SRMMStatusIconFlags%d", current->sid.dwId);
flags = DBGetContactSettingByte(hContact, current->sid.szModule, buff, current->sid.flags);
- if(!(flags & MBF_HIDDEN)) {
- if((flags & MBF_DISABLED) && current->sid.hIconDisabled) hIcon = current->sid.hIconDisabled;
+ if (!(flags & MBF_HIDDEN)) {
+ if ((flags & MBF_DISABLED) && current->sid.hIconDisabled) hIcon = current->sid.hIconDisabled;
else hIcon = current->sid.hIcon;
SetBkMode(hDC, TRANSPARENT);
@@ -169,7 +169,7 @@ void CheckIconClick(HANDLE hContact, HWND hwndFrom, POINT pt, RECT r, int gap, i
while(current && iconNum >= 0) {
sprintf(buff, "SRMMStatusIconFlags%d", current->sid.dwId);
flags = DBGetContactSettingByte(hContact, current->sid.szModule, buff, current->sid.flags);
- if(!(flags & MBF_HIDDEN)) iconNum--;
+ if (!(flags & MBF_HIDDEN)) iconNum--;
if(iconNum >= 0)
current = current->next;
}
@@ -212,7 +212,7 @@ int GetStatusIconsCount(HANDLE hContact) {
while(current) {
sprintf(buff, "SRMMStatusIconFlags%d", (int)current->sid.dwId);
flags = DBGetContactSettingByte(hContact, current->sid.szModule, buff, current->sid.flags);
- if(!(flags & MBF_HIDDEN)) {
+ if (!(flags & MBF_HIDDEN)) {
count ++;
}
current = current->next;
diff --git a/plugins/Scriver/chat/clist.c b/plugins/Scriver/chat/clist.c
index 7d43578a4b..03a88ede7f 100644
--- a/plugins/Scriver/chat/clist.c
+++ b/plugins/Scriver/chat/clist.c
@@ -297,7 +297,7 @@ BOOL CList_AddEvent(HANDLE hContact, HICON Icon, HANDLE event, int type, TCHAR*
cle.pszService= "GChat/DblClickEvent" ;
cle.ptszTooltip = TranslateTS(szBuf);
if ( type ) {
- if(!CallService(MS_CLIST_GETEVENT, (WPARAM)hContact, (LPARAM)0))
+ if (!CallService(MS_CLIST_GETEVENT, (WPARAM)hContact, (LPARAM)0))
CallService(MS_CLIST_ADDEVENT,(WPARAM) hContact,(LPARAM) &cle);
} else {
if(CallService(MS_CLIST_GETEVENT, (WPARAM)hContact, (LPARAM)0))
diff --git a/plugins/Scriver/chat/colorchooser.c b/plugins/Scriver/chat/colorchooser.c
index eb330bfe89..3ccec763f9 100644
--- a/plugins/Scriver/chat/colorchooser.c
+++ b/plugins/Scriver/chat/colorchooser.c
@@ -108,7 +108,7 @@ INT_PTR CALLBACK DlgProcColorToolWindow(HWND hwndDlg, UINT msg, WPARAM wParam, L
case WM_CTLCOLOREDIT:
case WM_CTLCOLORSTATIC:
- if((HWND)lParam==GetDlgItem(hwndDlg,IDC_CHAT_COLORTEXT)) {
+ if ((HWND)lParam==GetDlgItem(hwndDlg,IDC_CHAT_COLORTEXT)) {
SetTextColor((HDC)wParam,RGB(60,60,150));
SetBkColor((HDC)wParam,GetSysColor(COLOR_WINDOW));
return (INT_PTR)GetSysColorBrush(COLOR_WINDOW);
diff --git a/plugins/Scriver/chat/options.c b/plugins/Scriver/chat/options.c
index bf768be19e..5f74dc6417 100644
--- a/plugins/Scriver/chat/options.c
+++ b/plugins/Scriver/chat/options.c
@@ -184,7 +184,7 @@ static void CheckHeading(HWND hwndTree, HTREEITEM hHeading)
if(tvi.hItem != branch1[0].hItem && tvi.hItem != branch1[1].hItem )
{
TreeView_GetItem(hwndTree,&tvi);
- if(((tvi.state&TVIS_STATEIMAGEMASK)>>12==1))
+ if (((tvi.state&TVIS_STATEIMAGEMASK)>>12==1))
bChecked = FALSE;
}
tvi.hItem=TreeView_GetNextSibling(hwndTree,tvi.hItem);
@@ -205,7 +205,7 @@ static void CheckBranches(HWND hwndTree, HTREEITEM hHeading)
tvi.mask=TVIF_HANDLE|TVIF_STATE;
tvi.hItem = hHeading;
TreeView_GetItem(hwndTree,&tvi);
- if(((tvi.state&TVIS_STATEIMAGEMASK)>>12==2))
+ if (((tvi.state&TVIS_STATEIMAGEMASK)>>12==2))
bChecked = FALSE;
tvi.hItem=TreeView_GetNextItem(hwndTree, hHeading, TVGN_CHILD);
tvi.stateMask = TVIS_STATEIMAGEMASK;
@@ -235,7 +235,7 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p
void LoadLogFonts(void)
{
int i;
- for( i = 0; i<OPTIONS_FONTCOUNT; i++)
+ for ( i = 0; i<OPTIONS_FONTCOUNT; i++)
LoadMsgDlgFont(i, &aFonts[i].lf, &aFonts[i].color, TRUE);
}
@@ -311,7 +311,7 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
switch(((LPNMHDR)lParam)->idFrom)
{
case IDC_CHAT_CHECKBOXES:
- if(((LPNMHDR)lParam)->code==NM_CLICK) {
+ if (((LPNMHDR)lParam)->code==NM_CLICK) {
TVHITTESTINFO hti;
hti.pt.x=(short)LOWORD(GetMessagePos());
hti.pt.y=(short)HIWORD(GetMessagePos());
@@ -458,7 +458,7 @@ BOOL CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam
CheckHeading(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading3);
break;
case WM_COMMAND:
- if( (LOWORD(wParam) == IDC_CHAT_INSTAMP
+ if ( (LOWORD(wParam) == IDC_CHAT_INSTAMP
|| LOWORD(wParam) == IDC_CHAT_OUTSTAMP
|| LOWORD(wParam) == IDC_CHAT_TIMESTAMP
|| LOWORD(wParam) == IDC_CHAT_LOGLIMIT
@@ -591,7 +591,7 @@ BOOL CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam
else DBDeleteContactSetting(NULL, "Chat", "LogTimestamp");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_TIMESTAMP));
- if( iLen > 0 ) {
+ if ( iLen > 0 ) {
pszText = mir_realloc(pszText, iLen+1);
GetDlgItemTextA(hwndDlg, IDC_CHAT_TIMESTAMP, pszText,iLen+1);
DBWriteContactSettingString(NULL, "Chat", "HeaderTime", pszText);
@@ -607,7 +607,7 @@ BOOL CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam
else DBDeleteContactSetting(NULL, "Chat", "HeaderIncoming");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_OUTSTAMP));
- if( iLen > 0 ) {
+ if ( iLen > 0 ) {
pszText = mir_realloc(pszText, iLen+1);
GetDlgItemTextA(hwndDlg, IDC_CHAT_OUTSTAMP, pszText,iLen+1);
DBWriteContactSettingString(NULL, "Chat", "HeaderOutgoing", pszText);
@@ -694,7 +694,7 @@ static INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg,UINT uMsg,WPARAM wParam
}break;
case WM_COMMAND:
- if( (LOWORD(wParam) == IDC_CHAT_TIMEOUT)
+ if ( (LOWORD(wParam) == IDC_CHAT_TIMEOUT)
&& (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
if(lParam != (LPARAM)NULL)
@@ -718,7 +718,7 @@ static INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg,UINT uMsg,WPARAM wParam
switch(((LPNMHDR)lParam)->idFrom)
{
case IDC_CHAT_CHECKBOXES:
- if(((LPNMHDR)lParam)->code==NM_CLICK) {
+ if (((LPNMHDR)lParam)->code==NM_CLICK) {
TVHITTESTINFO hti;
hti.pt.x=(short)LOWORD(GetMessagePos());
hti.pt.y=(short)HIWORD(GetMessagePos());
diff --git a/plugins/Scriver/chat/tools.c b/plugins/Scriver/chat/tools.c
index 2dd4bedf3f..edf1fb11e4 100644
--- a/plugins/Scriver/chat/tools.c
+++ b/plugins/Scriver/chat/tools.c
@@ -920,7 +920,7 @@ TCHAR* GetChatLogsFilename (HANDLE hContact, time_t tTime)
if (g_Settings.pszLogDir[_tcslen(g_Settings.pszLogDir)-1] == '\\')
_tcscat(g_Settings.pszLogDir, _T("%userid%.log"));
- if(!tTime)
+ if (!tTime)
time(&tTime);
// day 1-31
diff --git a/plugins/Scriver/msglog.c b/plugins/Scriver/msglog.c
index 044fc8716a..4316b82171 100644
--- a/plugins/Scriver/msglog.c
+++ b/plugins/Scriver/msglog.c
@@ -104,7 +104,7 @@ TCHAR *GetNickname(HANDLE hContact, const char* szProto) {
if (ci.pszVal) {
#if defined ( _UNICODE )
if(IsUnicodeMIM()) {
- if(!_tcscmp((TCHAR *)ci.pszVal, TranslateW(_T("'(Unknown Contact)'")))) {
+ if (!_tcscmp((TCHAR *)ci.pszVal, TranslateW(_T("'(Unknown Contact)'")))) {
ci.dwFlag &= ~CNF_UNICODE;
if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
szName = a2t((char *)ci.pszVal);
diff --git a/plugins/Scriver/msgwindow.c b/plugins/Scriver/msgwindow.c
index fbd82472f8..7af68a2c5e 100644
--- a/plugins/Scriver/msgwindow.c
+++ b/plugins/Scriver/msgwindow.c
@@ -994,7 +994,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
return TRUE;
case CM_ACTIVATECHILD:
-// if((HWND) lParam != dat->hwndActive) {
+// if ((HWND) lParam != dat->hwndActive) {
ActivateChild(dat, (HWND) lParam);
// }
return TRUE;
diff --git a/plugins/Scriver/richutil.c b/plugins/Scriver/richutil.c
index d7c653b8db..52dff7505f 100644
--- a/plugins/Scriver/richutil.c
+++ b/plugins/Scriver/richutil.c
@@ -237,7 +237,7 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (IsWindow(hwnd))
{
- if((WNDPROC)GetWindowLongPtr(hwnd, GWLP_WNDPROC) == &RichUtil_Proc)
+ if ((WNDPROC)GetWindowLongPtr(hwnd, GWLP_WNDPROC) == &RichUtil_Proc)
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)ru->origProc);
}
diff --git a/plugins/Scriver/statusicon.c b/plugins/Scriver/statusicon.c
index 0343c0c298..2b77d099c8 100644
--- a/plugins/Scriver/statusicon.c
+++ b/plugins/Scriver/statusicon.c
@@ -136,7 +136,7 @@ INT_PTR ModifyStatusIcon(WPARAM wParam, LPARAM lParam) {
while(current) {
if(strcmp(current->sid.szModule, sid->szModule) == 0 && current->sid.dwId == sid->dwId) {
- if(!hContact) {
+ if (!hContact) {
current->sid.flags = sid->flags;
if(sid->hIcon) {
ReleaseIconSmart(current->sid.hIcon);
@@ -183,8 +183,8 @@ void DrawStatusIcons(HANDLE hContact, HDC hDC, RECT r, int gap) {
while(current) {
sprintf(buff, "SRMMStatusIconFlags%d", (int)current->sid.dwId);
flags = DBGetContactSettingByte(hContact, current->sid.szModule, buff, current->sid.flags);
- if(!(flags & MBF_HIDDEN)) {
- if((flags & MBF_DISABLED) && current->sid.hIconDisabled) hIcon = current->sid.hIconDisabled;
+ if (!(flags & MBF_HIDDEN)) {
+ if ((flags & MBF_DISABLED) && current->sid.hIconDisabled) hIcon = current->sid.hIconDisabled;
else hIcon = current->sid.hIcon;
SetBkMode(hDC, TRANSPARENT);
@@ -206,7 +206,7 @@ void CheckStatusIconClick(HANDLE hContact, HWND hwndFrom, POINT pt, RECT r, int
while(current) {
sprintf(buff, "SRMMStatusIconFlags%d", (int)current->sid.dwId);
flags = DBGetContactSettingByte(hContact, current->sid.szModule, buff, current->sid.flags);
- if(!(flags & MBF_HIDDEN)) iconNum--;
+ if (!(flags & MBF_HIDDEN)) iconNum--;
if (iconNum == 0) break;
current = current->next;
}
@@ -248,7 +248,7 @@ INT_PTR GetStatusIconsCount(HANDLE hContact) {
while(current) {
sprintf(buff, "SRMMStatusIconFlags%d", (int)current->sid.dwId);
flags = DBGetContactSettingByte(hContact, current->sid.szModule, buff, current->sid.flags);
- if(!(flags & MBF_HIDDEN)) {
+ if (!(flags & MBF_HIDDEN)) {
count ++;
}
current = current->next;
diff --git a/plugins/SecureIM/commonheaders.cpp b/plugins/SecureIM/commonheaders.cpp
index 11ff4af8e3..1200861828 100644
--- a/plugins/SecureIM/commonheaders.cpp
+++ b/plugins/SecureIM/commonheaders.cpp
@@ -45,7 +45,7 @@ LPSTR myDBGetString(HANDLE hContact,const char *szModule,const char *szSetting)
DBVARIANT dbv;
dbv.type = DBVT_ASCIIZ;
DBGetContactSetting(hContact,szModule,szSetting,&dbv);
- if( dbv.pszVal && (dbv.type==DBVT_ASCIIZ || dbv.type==DBVT_UTF8 || dbv.type==DBVT_WCHAR) )
+ if ( dbv.pszVal && (dbv.type==DBVT_ASCIIZ || dbv.type==DBVT_UTF8 || dbv.type==DBVT_WCHAR) )
val = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
return val;
@@ -54,7 +54,7 @@ LPSTR myDBGetString(HANDLE hContact,const char *szModule,const char *szSetting)
LPSTR myDBGetStringDecode(HANDLE hContact,const char *szModule,const char *szSetting) {
char *val = myDBGetString(hContact,szModule,szSetting);
- if(!val) return NULL;
+ if (!val) return NULL;
size_t len = strlen(val)+64;
char *buf = (LPSTR)mir_alloc(len);
strncpy(buf,val,len); mir_free(val);
@@ -172,14 +172,14 @@ int ca2u=0;
LPSTR TranslateU( LPCSTR lpText ) {
int i;
for(i=0;i<ca2u;i++) {
- if( pa2u[i].a == lpText ) {
+ if ( pa2u[i].a == lpText ) {
return pa2u[i].u;
}
}
ca2u++;
pa2u = (pA2U) mir_realloc(pa2u,sizeof(A2U)*ca2u);
pa2u[i].a = (LPSTR) lpText;
- if( bCoreUnicode ) {
+ if ( bCoreUnicode ) {
LPWSTR lpwText = mir_a2u(lpText);
LPWSTR lpwTran = TranslateW(lpwText);
mir_free(lpwText);
@@ -196,7 +196,7 @@ LPSTR TranslateU( LPCSTR lpText ) {
}
int msgbox( HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType) {
- if( bCoreUnicode ) {
+ if ( bCoreUnicode ) {
LPWSTR lpwText = mir_a2u(lpText);
LPWSTR lpwCaption = mir_a2u(lpCaption);
int r = MessageBoxW(hWnd,TranslateW(lpwText),TranslateW(lpwCaption),uType);
diff --git a/plugins/SecureIM/crypt_check.cpp b/plugins/SecureIM/crypt_check.cpp
index a8e3ba573f..dfa486d1de 100644
--- a/plugins/SecureIM/crypt_check.cpp
+++ b/plugins/SecureIM/crypt_check.cpp
@@ -14,7 +14,7 @@ int getContactStatus(HANDLE hContact) {
BOOL isSecureProtocol(HANDLE hContact) {
pSupPro ptr = getSupPro(hContact);
- if(!ptr) return false;
+ if (!ptr) return false;
return ptr->inspecting;
}
@@ -25,12 +25,12 @@ BYTE isContactSecured(HANDLE hContact) {
if (!clist_cnt) return 0;
BYTE r=0;
- if( isProtoMetaContacts(hContact) )
+ if ( isProtoMetaContacts(hContact) )
hContact = getMostOnline(hContact); // âîçüìåì òîò, ÷åðåç êîòîðûé ïîéäåò ñîîáùåíèå
for(int j=0;j<clist_cnt;j++) {
- if( clist[j].hContact == hContact ) {
- if( !clist[j].proto->inspecting ) break;
+ if ( clist[j].hContact == hContact ) {
+ if ( !clist[j].proto->inspecting ) break;
DBVARIANT dbv;
r=clist[j].mode;
switch(r) {
@@ -39,12 +39,12 @@ BYTE isContactSecured(HANDLE hContact) {
break;
case MODE_PGP:
DBGetContactSetting(hContact,szModuleName,"pgp",&dbv);
- if( dbv.type!=0 ) r|=SECURED;
+ if ( dbv.type!=0 ) r|=SECURED;
DBFreeVariant(&dbv);
break;
case MODE_GPG:
DBGetContactSetting(hContact,szModuleName,"gpg",&dbv);
- if( dbv.type!=0 ) r|=SECURED;
+ if ( dbv.type!=0 ) r|=SECURED;
DBFreeVariant(&dbv);
break;
case MODE_RSAAES:
@@ -63,12 +63,12 @@ BYTE isContactSecured(HANDLE hContact) {
BOOL isClientMiranda(pUinKey ptr, BOOL emptyMirverAsMiranda) {
- if( !bMCD ) return true;
- if( !ptr->proto->inspecting ) return false;
+ if ( !bMCD ) return true;
+ if ( !ptr->proto->inspecting ) return false;
BOOL isMiranda = true;
LPSTR mirver = myDBGetString(ptr->hContact,ptr->proto->name,"MirVer");
- if( mirver ) {
+ if ( mirver ) {
isMiranda = (emptyMirverAsMiranda && !*mirver) || (strstr(mirver,"Miranda")!=NULL);
mir_free(mirver);
}
@@ -78,11 +78,11 @@ BOOL isClientMiranda(pUinKey ptr, BOOL emptyMirverAsMiranda) {
BOOL isClientMiranda(HANDLE hContact, BOOL emptyMirverAsMiranda) {
- if( !bMCD ) return true;
- if( !clist_cnt ) return false;
+ if ( !bMCD ) return true;
+ if ( !clist_cnt ) return false;
for(int j=0;j<clist_cnt;j++) {
- if( clist[j].hContact == hContact ) {
+ if ( clist[j].hContact == hContact ) {
return isClientMiranda(&clist[j],emptyMirverAsMiranda);
}
}
@@ -94,8 +94,8 @@ BOOL isProtoSmallPackets(HANDLE hContact) {
if (!clist_cnt) return false;
for(int j=0;j<clist_cnt;j++) {
- if( clist[j].hContact == hContact ) {
- if( !clist[j].proto->inspecting ) break;
+ if ( clist[j].hContact == hContact ) {
+ if ( !clist[j].proto->inspecting ) break;
return strstr(clist[j].proto->name,"IRC")!=NULL ||
strstr(clist[j].proto->name,"WinPopup")!=NULL ||
strstr(clist[j].proto->name,"VyChat")!=NULL;
@@ -107,12 +107,12 @@ BOOL isProtoSmallPackets(HANDLE hContact) {
BOOL isContactInvisible(HANDLE hContact) {
- if( !DBGetContactSettingByte(hContact,"CList","Hidden",0) ) {
- if( !clist_cnt ) return false;
+ if ( !DBGetContactSettingByte(hContact,"CList","Hidden",0) ) {
+ if ( !clist_cnt ) return false;
for(int j=0;j<clist_cnt;j++) {
- if( clist[j].hContact == hContact ) {
- if( !clist[j].proto->inspecting ) return false;
- if( clist[j].waitForExchange ) return false;
+ if ( clist[j].hContact == hContact ) {
+ if ( !clist[j].proto->inspecting ) return false;
+ if ( clist[j].waitForExchange ) return false;
switch( (int)DBGetContactSettingWord(hContact,clist[j].proto->name,"ApparentMode",0) ) {
case 0:
return (CallProtoService(clist[j].proto->name,PS_GETSTATUS,0,0)==ID_STATUS_INVISIBLE);
@@ -139,8 +139,8 @@ BOOL isContactNewPG(HANDLE hContact) {
if (!clist_cnt) return false;
for(int j=0;j<clist_cnt;j++) {
if (clist[j].hContact == hContact) {
- if( !clist[j].proto->inspecting ) break;
- if( !clist[j].cntx ) break;
+ if ( !clist[j].proto->inspecting ) break;
+ if ( !clist[j].cntx ) break;
return (clist[j].features & CPP_FEATURES_NEWPG) != 0;
}
}
@@ -150,12 +150,12 @@ BOOL isContactNewPG(HANDLE hContact) {
BOOL isContactPGP(HANDLE hContact) {
- if(!bPGPloaded || (!bPGPkeyrings && !bPGPprivkey)) return false;
+ if (!bPGPloaded || (!bPGPkeyrings && !bPGPprivkey)) return false;
if (!clist_cnt) return false;
for(int j=0;j<clist_cnt;j++) {
if (clist[j].hContact == hContact) {
- if( !clist[j].proto->inspecting ) break;
- if( clist[j].mode!=MODE_PGP ) break;
+ if ( !clist[j].proto->inspecting ) break;
+ if ( clist[j].mode!=MODE_PGP ) break;
DBVARIANT dbv;
DBGetContactSetting(hContact,szModuleName,"pgp",&dbv);
BOOL r=(dbv.type!=0);
@@ -169,12 +169,12 @@ BOOL isContactPGP(HANDLE hContact) {
BOOL isContactGPG(HANDLE hContact) {
- if(!bGPGloaded || !bGPGkeyrings) return false;
+ if (!bGPGloaded || !bGPGkeyrings) return false;
if (!clist_cnt) return false;
for(int j=0;j<clist_cnt;j++) {
if (clist[j].hContact == hContact) {
- if( !clist[j].proto->inspecting ) break;
- if( clist[j].mode!=MODE_GPG ) break;
+ if ( !clist[j].proto->inspecting ) break;
+ if ( clist[j].mode!=MODE_GPG ) break;
DBVARIANT dbv;
DBGetContactSetting(hContact,szModuleName,"gpg",&dbv);
BOOL r=(dbv.type!=0);
@@ -191,8 +191,8 @@ BOOL isContactRSAAES(HANDLE hContact) {
if (!clist_cnt) return false;
for(int j=0;j<clist_cnt;j++) {
if (clist[j].hContact == hContact) {
- if( !clist[j].proto->inspecting ) break;
- if( clist[j].mode!=MODE_RSAAES ) break;
+ if ( !clist[j].proto->inspecting ) break;
+ if ( clist[j].mode!=MODE_RSAAES ) break;
return true;
}
}
@@ -205,8 +205,8 @@ BOOL isContactRSA(HANDLE hContact) {
if (!clist_cnt) return false;
for(int j=0;j<clist_cnt;j++) {
if (clist[j].hContact == hContact) {
- if( !clist[j].proto->inspecting ) break;
- if( clist[j].mode!=MODE_RSA ) break;
+ if ( !clist[j].proto->inspecting ) break;
+ if ( clist[j].mode!=MODE_RSA ) break;
return true;
}
}
@@ -218,8 +218,8 @@ BOOL isChatRoom(HANDLE hContact) {
if (!clist_cnt) return false;
for(int j=0;j<clist_cnt;j++) {
- if( clist[j].hContact == hContact ) {
- if( !clist[j].proto->inspecting ) break;
+ if ( clist[j].hContact == hContact ) {
+ if ( !clist[j].proto->inspecting ) break;
return (DBGetContactSettingByte(hContact,clist[j].proto->name,"ChatRoom",0)!=0);
}
}
@@ -234,15 +234,15 @@ BOOL isFileExist(LPCSTR filename) {
BOOL isSecureIM(pUinKey ptr, BOOL emptyMirverAsSecureIM) {
- if( !bAIP ) return false;
- if( !ptr->proto->inspecting ) return false;
+ if ( !bAIP ) return false;
+ if ( !ptr->proto->inspecting ) return false;
BOOL isSecureIM = false;
- if( bNOL && DBGetContactSettingByte(ptr->hContact,"CList","NotOnList",0) ) {
+ if ( bNOL && DBGetContactSettingByte(ptr->hContact,"CList","NotOnList",0) ) {
return false;
}
LPSTR mirver = myDBGetString(ptr->hContact,ptr->proto->name,"MirVer");
- if( mirver ) {
+ if ( mirver ) {
isSecureIM = (emptyMirverAsSecureIM && !*mirver) || (strstr(mirver,"SecureIM")!=NULL) || (strstr(mirver,"secureim")!=NULL);
mir_free(mirver);
}
@@ -252,8 +252,8 @@ BOOL isSecureIM(pUinKey ptr, BOOL emptyMirverAsSecureIM) {
BOOL isSecureIM(HANDLE hContact, BOOL emptyMirverAsSecureIM) {
- if( !bAIP ) return false;
- if( !clist_cnt ) return false;
+ if ( !bAIP ) return false;
+ if ( !clist_cnt ) return false;
for(int j=0;j<clist_cnt;j++) {
if (clist[j].hContact == hContact) {
diff --git a/plugins/SecureIM/crypt_dll.cpp b/plugins/SecureIM/crypt_dll.cpp
index 7418f3c35f..6a97021886 100644
--- a/plugins/SecureIM/crypt_dll.cpp
+++ b/plugins/SecureIM/crypt_dll.cpp
@@ -6,7 +6,7 @@ LPSTR InitKeyA(pUinKey ptr,int features) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("InitKeyA: %04x", features);
#endif
- if( !ptr->cntx )
+ if ( !ptr->cntx )
ptr->cntx = cpp_create_context(isProtoSmallPackets(ptr->hContact)?CPP_MODE_BASE64:0);
char *tmp = myDBGetString(ptr->hContact,szModuleName,"PSK");
@@ -46,10 +46,10 @@ int InitKeyB(pUinKey ptr,LPCSTR key) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("InitKeyB: %s", key);
#endif
- if(!ptr->cntx)
+ if (!ptr->cntx)
ptr->cntx = cpp_create_context(isProtoSmallPackets(ptr->hContact)?CPP_MODE_BASE64:0);
- if(!cpp_keyp(ptr->cntx)) {
+ if (!cpp_keyp(ptr->cntx)) {
char *tmp = myDBGetString(ptr->hContact,szModuleName,"PSK");
if(tmp) {
cpp_init_keyp(ptr->cntx,tmp); // make pre-shared key from password
@@ -67,7 +67,7 @@ int InitKeyB(pUinKey ptr,LPCSTR key) {
// store KeyX into context
void InitKeyX(pUinKey ptr,BYTE *key) {
- if(!ptr->cntx)
+ if (!ptr->cntx)
ptr->cntx = cpp_create_context(isProtoSmallPackets(ptr->hContact)?CPP_MODE_BASE64:0);
cpp_set_keyx(ptr->cntx,key);
@@ -78,7 +78,7 @@ void InitKeyX(pUinKey ptr,BYTE *key) {
BOOL CalculateKeyX(pUinKey ptr,HANDLE hContact) {
int agr = cpp_calc_keyx(ptr->cntx);
- if( agr ) {
+ if ( agr ) {
// do this only if key exchanged is ok
// we use a 192bit key
int keysize = cpp_size_keyx();
@@ -137,10 +137,10 @@ LPSTR encodeMsg(pUinKey ptr, LPARAM lParam) {
LPSTR szNewMsg = NULL;
LPSTR szOldMsg = (LPSTR) pccsd->lParam;
- if( pccsd->wParam & PREF_UTF )
+ if ( pccsd->wParam & PREF_UTF )
szNewMsg = encrypt(ptr,cpp_encodeU(ptr->cntx,szOldMsg));
else
- if( pccsd->wParam & PREF_UNICODE )
+ if ( pccsd->wParam & PREF_UNICODE )
szNewMsg = encrypt(ptr,cpp_encodeW(ptr->cntx,(LPWSTR)(szOldMsg+strlen(szOldMsg)+1)));
else
szNewMsg = encrypt(ptr,cpp_encodeA(ptr->cntx,szOldMsg));
@@ -181,7 +181,7 @@ LPSTR decodeMsg(pUinKey ptr, LPARAM lParam, LPSTR szEncMsg) {
}
else {
ptr->decoded=true;
- if( ppre->flags & PREF_UTF ) { // ¥á«¨ ¯à®â®ª®« ¯®¤¤¥à¦¨¢ ¥â utf8 - ⮣¤  ®â¯à ¢«ï¥¬ ¢ utf8
+ if ( ppre->flags & PREF_UTF ) { // ¥á«¨ ¯à®â®ª®« ¯®¤¤¥à¦¨¢ ¥â utf8 - ⮣¤  ®â¯à ¢«ï¥¬ ¢ utf8
int olen = (int)strlen(szOldMsg)+1;
szNewMsg = (LPSTR) mir_alloc(olen);
memcpy(szNewMsg,szOldMsg,olen);
@@ -212,7 +212,7 @@ BOOL LoadKeyPGP(pUinKey ptr) {
else
if(mode==1) {
LPSTR key = myDBGetStringDecode(ptr->hContact,szModuleName,"pgp");
- if( key ) {
+ if ( key ) {
pgp_set_key(ptr->cntx,key);
mir_free(key);
return 1;
@@ -225,7 +225,7 @@ BOOL LoadKeyPGP(pUinKey ptr) {
BOOL LoadKeyGPG(pUinKey ptr) {
LPSTR key = myDBGetString(ptr->hContact,szModuleName,"gpg");
- if( key ) {
+ if ( key ) {
gpg_set_keyid(ptr->cntx,key);
mir_free(key);
return 2;
diff --git a/plugins/SecureIM/crypt_icons.cpp b/plugins/SecureIM/crypt_icons.cpp
index 97f86b43f8..5c3d21023d 100644
--- a/plugins/SecureIM/crypt_icons.cpp
+++ b/plugins/SecureIM/crypt_icons.cpp
@@ -17,9 +17,9 @@ HICON mode2icon(int mode,int type) {
int m=mode&0x0f,s=(mode&SECURED)>>4,i; // ðàçîáðàëè íà ÷àñòè - ðåæèì è ñîñòîÿíèå
HICON icon;
- if( icons_cache ) {
+ if ( icons_cache ) {
for(i=0;i<icons_cache;i++) {
- if( ICONS_CACHE[i].mode == ((type<<8) | mode) ) {
+ if ( ICONS_CACHE[i].mode == ((type<<8) | mode) ) {
return ICONS_CACHE[i].icon;
}
}
@@ -32,7 +32,7 @@ HICON mode2icon(int mode,int type) {
case 3: i+=ICO_MW_DIS; break;
}
- if( type==1 ) {
+ if ( type==1 ) {
icon = BindOverlayIcon(g_hIEC[i],g_hICO[ICO_OV_NAT+m]);
}
else {
@@ -59,12 +59,12 @@ IconExtraColumn mode2iec(int mode) {
int m=mode&0x0f,s=(mode&SECURED)>>4; // ðàçîáðàëè íà ÷àñòè - ðåæèì è ñîñòîÿíèå
- if( mode==-1 || (!s && !bASI && m!=MODE_PGP && m!=MODE_GPG) ) {
+ if ( mode==-1 || (!s && !bASI && m!=MODE_PGP && m!=MODE_GPG) ) {
return g_IEC[0]; // âåðíåì ïóñòîå ìåñòî
}
int i=1+m*IEC_CNT+IEC_CL_DIS+s;
- if( g_IEC[i].hImage==(HANDLE)-1 ) {
+ if ( g_IEC[i].hImage==(HANDLE)-1 ) {
/* g_hIEC[i] = mode2icon(mode,1);
g_IEC[i].hImage = (HANDLE) CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)g_hIEC[i], (LPARAM)0);*/
HICON icon = mode2icon(mode,1);
@@ -78,22 +78,22 @@ IconExtraColumn mode2iec(int mode) {
void ShowStatusIcon(HANDLE hContact,int mode) {
HANDLE hMC = getMetaContact(hContact);
- if( bADV || g_hCLIcon ) { // îáíîâèòü èêîíêè â clist
- if( mode!= -1 ) {
+ if ( bADV || g_hCLIcon ) { // îáíîâèòü èêîíêè â clist
+ if ( mode!= -1 ) {
IconExtraColumn iec=mode2iec(mode);
- if( g_hCLIcon ) {
+ if ( g_hCLIcon ) {
ExtraIcon_SetIcon(g_hCLIcon, hContact, iec.hImage);
- if( hMC )
+ if ( hMC )
ExtraIcon_SetIcon(g_hCLIcon, hMC, iec.hImage);
}
else {
CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&iec);
- if( hMC )
+ if ( hMC )
CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hMC, (LPARAM)&iec);
}
}
}
- if( ServiceExists(MS_MSG_MODIFYICON) ) { // îáíîâèòü èêîíêè â srmm
+ if ( ServiceExists(MS_MSG_MODIFYICON) ) { // îáíîâèòü èêîíêè â srmm
StatusIconData sid;
memset(&sid,0,sizeof(sid));
sid.cbSize = sizeof(sid);
@@ -101,10 +101,10 @@ void ShowStatusIcon(HANDLE hContact,int mode) {
for(int i=MODE_NATIVE; i<MODE_CNT;i++) {
sid.dwId = i;
sid.flags = (mode&SECURED)?0:MBF_DISABLED;
- if( mode==-1 || (mode&0x0f)!=i || isChatRoom(hContact) )
+ if ( mode==-1 || (mode&0x0f)!=i || isChatRoom(hContact) )
sid.flags |= MBF_HIDDEN; // îòêëþ÷àåì âñå íåíóæíûå èêîíêè
CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
- if( hMC )
+ if ( hMC )
CallService(MS_MSG_MODIFYICON, (WPARAM)hMC, (LPARAM)&sid);
}
}
@@ -127,20 +127,20 @@ void RefreshContactListIcons(void) {
HANDLE hContact;
// CallService(MS_CLUI_LISTBEGINREBUILD,0,0);
- if( !g_hCLIcon ) {
+ if ( !g_hCLIcon ) {
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact) { // ñíà÷àëà âñå âûêëþ÷àåì
ShowStatusIcon(hContact,-1);
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
}
// ìåíåì ìåñòîïîëîæåíèå èêîíêè
- for(int i=0;i<1+MODE_CNT*IEC_CNT;i++){
+ for(int i=0;i<1+MODE_CNT*IEC_CNT;i++) {
g_IEC[i].ColumnType = bADV;
}
}
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact) { // è ñíîâà çàæèãàåì èêîíêó
- if( isSecureProtocol(hContact) )
+ if ( isSecureProtocol(hContact) )
ShowStatusIcon(hContact);
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
}
diff --git a/plugins/SecureIM/crypt_lists.cpp b/plugins/SecureIM/crypt_lists.cpp
index 48fbad16a0..f71398e4b4 100644
--- a/plugins/SecureIM/crypt_lists.cpp
+++ b/plugins/SecureIM/crypt_lists.cpp
@@ -11,10 +11,10 @@ void loadSupportedProtocols() {
int numberOfProtocols;
PROTOCOLDESCRIPTOR **protos;
LPSTR szNames = myDBGetString(0,szModuleName,"protos");
- if( szNames && strchr(szNames,':') == NULL ) {
+ if ( szNames && strchr(szNames,':') == NULL ) {
LPSTR tmp = (LPSTR) mir_alloc(2048); int j=0;
for(int i=0; szNames[i]; i++) {
- if( szNames[i] == ';' ) {
+ if ( szNames[i] == ';' ) {
memcpy((PVOID)(tmp+j),(PVOID)":1:0:0",6); j+=6;
}
tmp[j++] = szNames[i];
@@ -33,19 +33,19 @@ void loadSupportedProtocols() {
proto = (pSupPro) mir_realloc(proto,sizeof(SupPro)*proto_cnt);
memset(&proto[j],0,sizeof(SupPro));
proto[j].name = mir_strdup(protos[i]->szName);
- if( szNames ) {
- if( proto[j].name ) {
+ if ( szNames ) {
+ if ( proto[j].name ) {
char tmp[128]; strcpy(tmp,proto[j].name); strcat(tmp,":");
LPSTR szName = strstr(szNames,tmp);
- if( szName ) {
+ if ( szName ) {
szName = strchr(szName,':');
- if( szName ) {
+ if ( szName ) {
proto[j].inspecting = (*++szName == '1');
szName = strchr(szName,':');
- if( szName ) {
+ if ( szName ) {
proto[j].split_on = atoi(++szName); proto[j].tsplit_on = proto[j].split_on;
szName = strchr(szName,':');
- if( szName ) {
+ if ( szName ) {
proto[j].split_off = atoi(++szName); proto[j].tsplit_off = proto[j].split_off;
}
}
@@ -86,9 +86,9 @@ void MoveToFirstInFilterList(HANDLE hContact) {
for(i=0;;i++) {
mir_itoa(i,str,10);
- if( DBGetContactSettingString(hContact,"_Filter",str,&dbv) ) break;
- if( !strcmp(szModuleName,dbv.pszVal) ) { // íàøëè ìîé ìîäóëü
- if( i==0 ) return;
+ if ( DBGetContactSettingString(hContact,"_Filter",str,&dbv) ) break;
+ if ( !strcmp(szModuleName,dbv.pszVal) ) { // íàøëè ìîé ìîäóëü
+ if ( i==0 ) return;
DBGetContactSettingString(hContact,"_Filter","0",&dbv);
DBWriteContactSettingString(hContact,"_Filter","0",szModuleName);
DBWriteContactSettingString(hContact,"_Filter",str,dbv.pszVal);
@@ -108,14 +108,14 @@ void MoveToLastInFilterList(HANDLE hContact) {
for(i=0;;i++) {
mir_itoa(i,str,10);
- if( DBGetContactSettingString(hContact,"_Filter",str,&dbv) ) break;
- if( !strcmp(szModuleName,dbv.pszVal) ) { // íàøëè ìîé ìîäóëü
+ if ( DBGetContactSettingString(hContact,"_Filter",str,&dbv) ) break;
+ if ( !strcmp(szModuleName,dbv.pszVal) ) { // íàøëè ìîé ìîäóëü
j=i;
}
mir_free(dbv.pszVal);
}
i--;
- if( j==i ) return;
+ if ( j==i ) return;
mir_itoa(i,end,10);
mir_itoa(j,str,10);
DBGetContactSettingString(hContact,"_Filter",end,&dbv);
@@ -137,7 +137,7 @@ pUinKey addContact(HANDLE hContact) {
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)szModuleName);
MoveToLastInFilterList(hContact);
for(j=0;j<clist_cnt;j++) {
- if( !clist[j].hContact ) break;
+ if ( !clist[j].hContact ) break;
}
if(j==clist_cnt) {
clist_cnt+=clist_inc;
@@ -151,10 +151,10 @@ pUinKey addContact(HANDLE hContact) {
clist[j].hContact = hContact;
clist[j].proto = proto;
clist[j].mode = DBGetContactSettingByte(hContact, szModuleName, "mode", 99);
- if( clist[j].mode == 99 ) {
- if( isContactPGP(hContact) ) clist[j].mode = MODE_PGP;
+ if ( clist[j].mode == 99 ) {
+ if ( isContactPGP(hContact) ) clist[j].mode = MODE_PGP;
else
- if( isContactGPG(hContact) ) clist[j].mode = MODE_GPG;
+ if ( isContactGPG(hContact) ) clist[j].mode = MODE_GPG;
else
clist[j].mode = MODE_RSAAES;
DBWriteContactSettingByte(hContact, szModuleName, "mode", clist[j].mode);
@@ -280,7 +280,7 @@ void getContactNameA(HANDLE hContact, LPSTR szName) {
void getContactName(HANDLE hContact, LPSTR szName) {
- if( bCoreUnicode ) wcscpy((LPWSTR)szName,(LPWSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GSMDF_UNICODE));
+ if ( bCoreUnicode ) wcscpy((LPWSTR)szName,(LPWSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GSMDF_UNICODE));
else getContactNameA(hContact, szName);
}
@@ -290,12 +290,12 @@ void getContactUinA(HANDLE hContact, LPSTR szUIN) {
*szUIN = 0;
pSupPro ptr = getSupPro(hContact);
- if(!ptr) return;
+ if (!ptr) return;
DBVARIANT dbv_uniqueid;
LPSTR uID = (LPSTR) CallProtoService(ptr->name, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if( uID==(LPSTR)CALLSERVICE_NOTFOUND ) uID = 0; // Billy_Bons
- if( uID && DBGetContactSetting(hContact, ptr->name, uID, &dbv_uniqueid)==0 ) {
+ if ( uID==(LPSTR)CALLSERVICE_NOTFOUND ) uID = 0; // Billy_Bons
+ if ( uID && DBGetContactSetting(hContact, ptr->name, uID, &dbv_uniqueid)==0 ) {
if (dbv_uniqueid.type == DBVT_WORD)
sprintf(szUIN, "%u [%s]", dbv_uniqueid.wVal, ptr->name);
else
@@ -316,7 +316,7 @@ void getContactUinA(HANDLE hContact, LPSTR szUIN) {
void getContactUin(HANDLE hContact, LPSTR szUIN) {
getContactUinA(hContact, szUIN);
- if( bCoreUnicode && *szUIN ) {
+ if ( bCoreUnicode && *szUIN ) {
LPWSTR tmp = mir_a2u(szUIN);
wcscpy((LPWSTR)szUIN, tmp);
mir_free(tmp);
diff --git a/plugins/SecureIM/crypt_metacontacts.cpp b/plugins/SecureIM/crypt_metacontacts.cpp
index 5a24c6c9cb..f36c7e4dd3 100644
--- a/plugins/SecureIM/crypt_metacontacts.cpp
+++ b/plugins/SecureIM/crypt_metacontacts.cpp
@@ -4,7 +4,7 @@
BOOL isProtoMetaContacts(HANDLE hContact) {
if(bMetaContacts) {
LPSTR proto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if( proto && strcmp(proto,"MetaContacts")==0 ) {
+ if ( proto && strcmp(proto,"MetaContacts")==0 ) {
return true;
}
}
@@ -47,10 +47,10 @@ void DeinitMetaContact(HANDLE hContact) {
HANDLE hMetaContact = isProtoMetaContacts(hContact) ? hContact : getMetaContact(hContact);
- if( hMetaContact ) {
+ if ( hMetaContact ) {
for(int i=0;i<CallService(MS_MC_GETNUMCONTACTS,(WPARAM)hMetaContact,0);i++) {
HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT,(WPARAM)hMetaContact,(LPARAM)i);
- if( hSubContact && isContactSecured(hSubContact)&SECURED ) {
+ if ( hSubContact && isContactSecured(hSubContact)&SECURED ) {
CallContactService(hSubContact,PSS_MESSAGE,(WPARAM)PREF_METANODB,(LPARAM)SIG_DEIN);
}
}
diff --git a/plugins/SecureIM/crypt_misc.cpp b/plugins/SecureIM/crypt_misc.cpp
index 9be742e78f..ee6d3a5910 100644
--- a/plugins/SecureIM/crypt_misc.cpp
+++ b/plugins/SecureIM/crypt_misc.cpp
@@ -41,19 +41,19 @@ unsigned __stdcall sttWaitForExchange( LPVOID param ) {
pUinKey ptr = getUinKey(tParam->hContact);
delete tParam;
- if( !ptr ) return 0;
+ if ( !ptr ) return 0;
for(int i=0;i<DBGetContactSettingWord(0,szModuleName,"ket",10)*10; i++) {
Sleep( 100 );
- if( ptr->waitForExchange != 1 ) break;
+ if ( ptr->waitForExchange != 1 ) break;
} // for
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("sttWaitForExchange: %d",ptr->waitForExchange);
#endif
// if keyexchange failed or timeout
- if( ptr->waitForExchange==1 || ptr->waitForExchange==3 ) { // ¯à®âãå«® - ®â¯à ¢«ï¥¬ ­¥§ è¨ä஢ ­­®, ¥á«¨ ­ ¤®
- if( ptr->msgQueue && msgbox1(0,sim104,szModuleName,MB_YESNO|MB_ICONQUESTION)==IDYES ) {
+ if ( ptr->waitForExchange==1 || ptr->waitForExchange==3 ) { // ¯à®âãå«® - ®â¯à ¢«ï¥¬ ­¥§ è¨ä஢ ­­®, ¥á«¨ ­ ¤®
+ if ( ptr->msgQueue && msgbox1(0,sim104,szModuleName,MB_YESNO|MB_ICONQUESTION)==IDYES ) {
EnterCriticalSection(&localQueueMutex);
ptr->sendQueue = true;
pWM ptrMessage = ptr->msgQueue;
@@ -76,7 +76,7 @@ unsigned __stdcall sttWaitForExchange( LPVOID param ) {
ShowStatusIconNotify(ptr->hContact);
}
else
- if( ptr->waitForExchange==2 ) { // ¤®á« âì ®ç¥à¥¤ì ç¥à¥§ ãáâ ­®¢«¥­­®¥ ᮥ¤¨­¥­¨¥
+ if ( ptr->waitForExchange==2 ) { // ¤®á« âì ®ç¥à¥¤ì ç¥à¥§ ãáâ ­®¢«¥­­®¥ ᮥ¤¨­¥­¨¥
EnterCriticalSection(&localQueueMutex);
// we need to resend last send back message with new crypto Key
pWM ptrMessage = ptr->msgQueue;
@@ -96,7 +96,7 @@ unsigned __stdcall sttWaitForExchange( LPVOID param ) {
LeaveCriticalSection(&localQueueMutex);
}
else
- if( ptr->waitForExchange==0 ) { // ®ç¨áâ¨âì ®ç¥à¥¤ì
+ if ( ptr->waitForExchange==0 ) { // ®ç¨áâ¨âì ®ç¥à¥¤ì
EnterCriticalSection(&localQueueMutex);
// we need to resend last send back message with new crypto Key
pWM ptrMessage = ptr->msgQueue;
@@ -119,11 +119,11 @@ void waitForExchange(pUinKey ptr, int flag) {
case 0: // á¡à®á¨âì
case 2: // ¤®á« âì è¨ä஢ ­®
case 3: // ¤®á« âì ­¥è¨ä஢ ­®
- if( ptr->waitForExchange )
+ if ( ptr->waitForExchange )
ptr->waitForExchange = flag;
break;
case 1: // § ¯ãáâ¨âì
- if( ptr->waitForExchange )
+ if ( ptr->waitForExchange )
break;
ptr->waitForExchange = 1;
// § ¯ã᪠¥¬ âàí¤
diff --git a/plugins/SecureIM/crypt_popups.cpp b/plugins/SecureIM/crypt_popups.cpp
index 768423e765..836a68efc1 100644
--- a/plugins/SecureIM/crypt_popups.cpp
+++ b/plugins/SecureIM/crypt_popups.cpp
@@ -24,7 +24,7 @@ void showPopUp(LPCSTR lpzText,HANDLE hContact,HICON hIcon, UINT type) {
//type=1 session colors
//type=2 SR colors
- if(!bPopupExists) return;
+ if (!bPopupExists) return;
//hContact = A_VALID_HANDLE_YOU_GOT_FROM_SOMEWHERE;
COLORREF colorBackKey = RGB(230,230,255);
@@ -71,7 +71,7 @@ void showPopUp(LPCSTR lpzText,HANDLE hContact,HICON hIcon, UINT type) {
DBFreeVariant(&dbv_timeout);
}
- if( bCoreUnicode && bPopupUnicode ) {
+ if ( bCoreUnicode && bPopupUnicode ) {
POPUPDATAW ppd = {0};
ppd.lchContact = hContact; //Be sure to use a GOOD handle, since this will not be checked.
diff --git a/plugins/SecureIM/loadicons.cpp b/plugins/SecureIM/loadicons.cpp
index 1b9d4735bd..ec6d0ae17e 100644
--- a/plugins/SecureIM/loadicons.cpp
+++ b/plugins/SecureIM/loadicons.cpp
@@ -46,7 +46,7 @@ void InitIcons(void)
{
HINSTANCE hNewIconInst = NULL;
- if( g_hFolders ) {
+ if ( g_hFolders ) {
LPSTR pathname = (LPSTR) alloca(MAX_PATH);
FoldersGetCustomPathEx(g_hFolders, pathname, MAX_PATH, "icons\\", "secureim_icons.dll");
if (hNewIconInst == NULL)
diff --git a/plugins/SecureIM/main.cpp b/plugins/SecureIM/main.cpp
index 7e29f0d352..926f68512a 100644
--- a/plugins/SecureIM/main.cpp
+++ b/plugins/SecureIM/main.cpp
@@ -131,7 +131,7 @@ int __cdecl Load(PLUGINLINK *link) {
iCoreVersion = CallService(MS_SYSTEM_GETVERSION,0,0);
// load crypo++ dll
- if( !loadlib() ) {
+ if ( !loadlib() ) {
msgbox1(0,sim107,szModuleName,MB_OK|MB_ICONSTOP);
return 1;
}
@@ -190,7 +190,7 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) {
bPopupUnicode = ServiceExists(MS_POPUP_ADDPOPUPW)!=0;
g_hFolders = FoldersRegisterCustomPath(szModuleName, "Icons", MIRANDA_PATH"\\icons");
- if( g_hFolders==(HANDLE)CALLSERVICE_NOTFOUND ) g_hFolders = 0;
+ if ( g_hFolders==(HANDLE)CALLSERVICE_NOTFOUND ) g_hFolders = 0;
InitIcons();
GetFlags();
@@ -204,13 +204,13 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) {
DBVARIANT dbv;
dbv.type = DBVT_BLOB;
- if( DBGetContactSetting(0,szModuleName,"rsa_priv",&dbv) == 0 ) {
+ if ( DBGetContactSetting(0,szModuleName,"rsa_priv",&dbv) == 0 ) {
exp->rsa_set_keypair(CPP_MODE_RSA_4096,dbv.pbVal,dbv.cpbVal);
DBFreeVariant(&dbv);
rsa_4096=1;
}
else
- if( DBGetContactSetting(0,szModuleName,"rsa_priv_4096",&dbv) == 0 ) {
+ if ( DBGetContactSetting(0,szModuleName,"rsa_priv_4096",&dbv) == 0 ) {
exp->rsa_set_keypair(CPP_MODE_RSA_4096|CPP_MODE_RSA_BER,dbv.pbVal,dbv.cpbVal);
DBFreeVariant(&dbv);
@@ -241,7 +241,7 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) {
rsa_4096=1;
}
- if( !rsa_4096 ) {
+ if ( !rsa_4096 ) {
unsigned int tID;
CloseHandle( (HANDLE) _beginthreadex(NULL, 0, sttGenerateRSA, NULL, 0, &tID) );
}
@@ -384,7 +384,7 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) {
AddHookFunction(ME_CLIST_PREBUILDCONTACTMENU, onRebuildContactMenu);
// g_hMC = HookEvent(ME_MC_SUBCONTACTSCHANGED, onMC);
- if( ServiceExists(MS_EXTRAICON_REGISTER) ) {
+ if ( ServiceExists(MS_EXTRAICON_REGISTER) ) {
g_hCLIcon = ExtraIcon_Register(szModuleName, Translate("SecureIM status"), "sim_cm_est",
onExtraImageListRebuilding,
onExtraImageApplying);
@@ -433,7 +433,7 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) {
Sent_NetLog("create PGP/GPG menu");
#endif
HICON icon;
- if( bPGPloaded ) {
+ if ( bPGPloaded ) {
icon=mode2icon(MODE_PGP|SECURED,2);
g_hMenu[6] = AddMenuItem(sim306,110006,icon,MODULENAME"/PGP_SET",0);
icon=mode2icon(MODE_PGP,2);
diff --git a/plugins/SecureIM/mmi.cpp b/plugins/SecureIM/mmi.cpp
index 17195563e1..2269d76a51 100644
--- a/plugins/SecureIM/mmi.cpp
+++ b/plugins/SecureIM/mmi.cpp
@@ -75,8 +75,8 @@ LPSTR to_hex(PBYTE bin, int len) {
SAFE_FREE(m_hex);
m_hex = (LPSTR) mir_alloc(len*3+1);
LPSTR m_ptr = m_hex;
- for( int i=0; i<len; i++ ) {
- if( i ) {
+ for ( int i=0; i<len; i++ ) {
+ if ( i ) {
*m_ptr = ' '; m_ptr++;
}
mir_snprintf(m_ptr,4,"%02X",bin[i]);
@@ -108,11 +108,11 @@ void __fastcall safe_delete(void** p)
// ¯à¥®¡à §ã¥¬ ⥪áâ ¨§ ç¨á⮣® UTF8 ¢ ä®à¬ â ¬¨à ­¤ë
LPSTR utf8_to_miranda(LPCSTR szUtfMsg, DWORD& flags) {
LPSTR szNewMsg;
- if( iCoreVersion < 0x00060000 ) {
+ if ( iCoreVersion < 0x00060000 ) {
flags &= ~(PREF_UTF|PREF_UNICODE);
LPWSTR wszMsg = exp->utf8decode(szUtfMsg);
LPSTR szMsg = mir_u2a(wszMsg);
- if( bCoreUnicode ) {
+ if ( bCoreUnicode ) {
flags |= PREF_UNICODE;
int olen = (int)wcslen((LPWSTR)wszMsg)+1;
int nlen = olen*(sizeof(WCHAR)+1);
diff --git a/plugins/SecureIM/options.cpp b/plugins/SecureIM/options.cpp
index 17123e1e69..fa61e021b4 100644
--- a/plugins/SecureIM/options.cpp
+++ b/plugins/SecureIM/options.cpp
@@ -9,15 +9,15 @@ const char *szAdvancedIcons[] = {"None", "Email", "Protocol", "SMS", "Advanced 1
BOOL hasKey(pUinKey ptr) {
BOOL ret = 0;
- if( ptr->mode==MODE_NATIVE ) {
+ if ( ptr->mode==MODE_NATIVE ) {
LPSTR str = myDBGetString(ptr->hContact,szModuleName,"PSK");
ret = (str!=NULL); SAFE_FREE(str);
}
else
- if( ptr->mode==MODE_RSAAES ) {
+ if ( ptr->mode==MODE_RSAAES ) {
DBVARIANT dbv;
dbv.type = DBVT_BLOB;
- if( DBGetContactSetting(ptr->hContact,szModuleName,"rsa_pub",&dbv) == 0 ) {
+ if ( DBGetContactSetting(ptr->hContact,szModuleName,"rsa_pub",&dbv) == 0 ) {
ret = 1;
DBFreeVariant(&dbv);
}
@@ -27,7 +27,7 @@ BOOL hasKey(pUinKey ptr) {
void TC_InsertItem(HWND hwnd, WPARAM wparam, TCITEM *tci) {
- if( bCoreUnicode ) {
+ if ( bCoreUnicode ) {
LPWSTR tmp = mir_a2u(tci->pszText);
tci->pszText = (LPSTR)TranslateW(tmp);
SNDMSG(hwnd, TCM_INSERTITEMW, wparam, (LPARAM)tci);
@@ -41,7 +41,7 @@ void TC_InsertItem(HWND hwnd, WPARAM wparam, TCITEM *tci) {
static void LV_InsertColumn(HWND hwnd, WPARAM wparam, LVCOLUMN *lvc) {
- if( bCoreUnicode ) {
+ if ( bCoreUnicode ) {
LPWSTR tmp = mir_a2u(lvc->pszText);
lvc->pszText = (LPSTR)TranslateW(tmp);
SNDMSG(hwnd, LVM_INSERTCOLUMNW, wparam, (LPARAM)lvc);
@@ -60,9 +60,9 @@ int LV_InsertItem(HWND hwnd, LVITEM *lvi) {
int LV_InsertItemA(HWND hwnd, LVITEM *lvi) {
- if( bCoreUnicode ) lvi->pszText = (LPSTR) mir_a2u(lvi->pszText);
+ if ( bCoreUnicode ) lvi->pszText = (LPSTR) mir_a2u(lvi->pszText);
int ret = LV_InsertItem(hwnd, lvi);
- if( bCoreUnicode ) mir_free(lvi->pszText);
+ if ( bCoreUnicode ) mir_free(lvi->pszText);
return ret;
}
@@ -76,9 +76,9 @@ void LV_SetItemText(HWND hwnd, WPARAM wparam, int subitem, LPSTR text) {
void LV_SetItemTextA(HWND hwnd, WPARAM wparam, int subitem, LPSTR text) {
- if( bCoreUnicode ) text = (LPSTR) mir_a2u(text);
+ if ( bCoreUnicode ) text = (LPSTR) mir_a2u(text);
LV_SetItemText(hwnd, wparam, subitem, text);
- if( bCoreUnicode ) mir_free(text);
+ if ( bCoreUnicode ) mir_free(text);
}
@@ -88,7 +88,7 @@ void LV_GetItemTextA(HWND hwnd, WPARAM wparam, int iSubItem, LPSTR text, int cch
lvi.cchTextMax = cchTextMax;
lvi.pszText = text;
SNDMSG(hwnd, bCoreUnicode ? LVM_GETITEMTEXTW : LVM_GETITEMTEXTA, wparam, (LPARAM)&lvi);
- if( bCoreUnicode ) {
+ if ( bCoreUnicode ) {
lvi.pszText = mir_u2a((LPWSTR)text);
strcpy(text, lvi.pszText);
mir_free(lvi.pszText);
@@ -147,7 +147,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
break;
case PSM_CHANGED: // used so tabs dont have to call SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
- if(!iInit)
+ if (!iInit)
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
@@ -166,14 +166,14 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
}
break;*/
case ID_UPDATE_PLIST: {
- if( !bPGP ) break;
+ if ( !bPGP ) break;
tci.mask = TCIF_PARAM;
TabCtrl_GetItem(GetDlgItem(hwnd,IDC_OPTIONSTAB),2,&tci);
SendMessage((HWND)tci.lParam,WM_COMMAND,ID_UPDATE_CLIST,0);
}
break;
case ID_UPDATE_GLIST: {
- if( !bGPG ) break;
+ if ( !bGPG ) break;
tci.mask = TCIF_PARAM;
TabCtrl_GetItem(GetDlgItem(hwnd,IDC_OPTIONSTAB),3,&tci);
SendMessage((HWND)tci.lParam,WM_COMMAND,ID_UPDATE_GLIST,0);
@@ -288,7 +288,7 @@ INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wParam, LPAR
break;
case WM_PAINT: {
- if(!iInit)
+ if (!iInit)
InvalidateRect(hDlg,NULL,FALSE);
} // WM_PAINT
break;
@@ -361,14 +361,14 @@ INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wParam, LPAR
idx = ListView_GetSelectionMark(hLV);
ptr = (pUinKey) getListViewParam(hLV,idx);
if(ptr) {
- if( !ptr->keyLoaded ) {
+ if ( !ptr->keyLoaded ) {
createRSAcntx(ptr);
loadRSAkey(ptr);
}
- if( ptr->keyLoaded ) {
+ if ( ptr->keyLoaded ) {
LPSTR buffer = (LPSTR) alloca(RSASIZE);
exp->rsa_export_pubkey(ptr->cntx,buffer);
- if( !SaveExportRSAKeyDlg(hDlg,buffer,0) )
+ if ( !SaveExportRSAKeyDlg(hDlg,buffer,0) )
msgbox(hDlg,sim114,szModuleName,MB_OK|MB_ICONEXCLAMATION);
}
}
@@ -382,8 +382,8 @@ INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wParam, LPAR
if(ptr) {
createRSAcntx(ptr);
LPSTR pub = (LPSTR) alloca(RSASIZE);
- if( !LoadImportRSAKeyDlg(hDlg,pub,0) ) return TRUE;
- if( exp->rsa_import_pubkey(ptr->cntx,pub) ) {
+ if ( !LoadImportRSAKeyDlg(hDlg,pub,0) ) return TRUE;
+ if ( exp->rsa_import_pubkey(ptr->cntx,pub) ) {
int len;
exp->rsa_get_pubkey(ptr->cntx,(PBYTE)pub,&len);
@@ -413,7 +413,7 @@ INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wParam, LPAR
break;
case IDC_RESET: {
- if(!iInit)
+ if (!iInit)
ResetGeneralDlg(hDlg);
}
break;
@@ -448,7 +448,7 @@ INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wParam, LPAR
default:
return FALSE;
}
- if(!iInit)
+ if (!iInit)
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
} // WM_COMMAND
break;
@@ -475,9 +475,9 @@ INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wParam, LPAR
ptr = (pUinKey) getListViewParam(hLV,idx);
if (ptr) {
ptr->tmode++;
- if( !bPGP && ptr->tmode==MODE_PGP ) ptr->tmode++;
- if( !bGPG && ptr->tmode==MODE_GPG ) ptr->tmode++;
- if( ptr->tmode>=MODE_CNT ) ptr->tmode=MODE_NATIVE;
+ if ( !bPGP && ptr->tmode==MODE_PGP ) ptr->tmode++;
+ if ( !bGPG && ptr->tmode==MODE_GPG ) ptr->tmode++;
+ if ( ptr->tmode>=MODE_CNT ) ptr->tmode=MODE_NATIVE;
setListViewMode(hLV,idx,ptr->tmode);
setListViewIcon(hLV,idx,ptr);
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
@@ -501,7 +501,7 @@ INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wParam, LPAR
if (ptr) {
POINT p; GetCursorPos(&p);
HMENU hMenu = NULL;
- if( ptr->tmode==MODE_NATIVE || ptr->tmode==MODE_RSAAES ) {
+ if ( ptr->tmode==MODE_NATIVE || ptr->tmode==MODE_RSAAES ) {
switch( lpLV->iSubItem ) {
case 2: // mode
hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDM_CLIST2));
@@ -518,23 +518,23 @@ INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wParam, LPAR
break;
}
CheckMenuItem(hMenu, ID_DISABLED+ptr->tstatus, MF_CHECKED );
- if( ptr->tmode==MODE_NATIVE ) {
- if( !hasKey(ptr) ) EnableMenuItem(hMenu, ID_DELPSK, MF_GRAYED );
+ if ( ptr->tmode==MODE_NATIVE ) {
+ if ( !hasKey(ptr) ) EnableMenuItem(hMenu, ID_DELPSK, MF_GRAYED );
}
else
- if( ptr->tmode==MODE_RSAAES ) {
- if( !hasKey(ptr) ) {
+ if ( ptr->tmode==MODE_RSAAES ) {
+ if ( !hasKey(ptr) ) {
EnableMenuItem(hMenu, ID_EXPPUBL, MF_GRAYED );
EnableMenuItem(hMenu, ID_DELPUBL, MF_GRAYED );
}
}
}
- if( !hMenu )
+ if ( !hMenu )
hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDM_CLIST2));
CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM)hMenu, 0);
CheckMenuItem(hMenu, ID_SIM_NATIVE+ptr->tmode, MF_CHECKED );
- if( !bPGP ) EnableMenuItem(hMenu, ID_SIM_PGP, MF_GRAYED );
- if( !bGPG ) EnableMenuItem(hMenu, ID_SIM_GPG, MF_GRAYED );
+ if ( !bPGP ) EnableMenuItem(hMenu, ID_SIM_PGP, MF_GRAYED );
+ if ( !bGPG ) EnableMenuItem(hMenu, ID_SIM_GPG, MF_GRAYED );
// CheckMenuItem(hMenu, ID_ENCRYPTION, MF_BYCOMMAND );
TrackPopupMenu(GetSubMenu(hMenu, 0), TPM_LEFTALIGN | TPM_TOPALIGN, p.x, p.y, 0, hDlg, 0);
DestroyMenu(hMenu);
@@ -591,7 +591,7 @@ INT_PTR CALLBACK DlgProcOptionsProto(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM
break;
case WM_PAINT: {
- if(!iInit)
+ if (!iInit)
InvalidateRect(hDlg,NULL,FALSE);
} // WM_PAINT
break;
@@ -607,29 +607,29 @@ INT_PTR CALLBACK DlgProcOptionsProto(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM
case IDC_RSA_EXP: {
LPSTR pub = (LPSTR) alloca(RSASIZE);
exp->rsa_export_keypair(CPP_MODE_RSA,NULL,pub,NULL);
- if( !SaveExportRSAKeyDlg(hDlg,pub,0) )
+ if ( !SaveExportRSAKeyDlg(hDlg,pub,0) )
msgbox(hDlg,sim114,szModuleName,MB_OK|MB_ICONEXCLAMATION);
return TRUE;
} break;
case IDC_RSA_EXPPRIV: {
LPSTR passphrase = (LPSTR) alloca(RSASIZE);
int res = DialogBoxParam(g_hInst,MAKEINTRESOURCE(IDD_PASSPHRASE),NULL,(DLGPROC)DlgProcSetPassphrase,(LPARAM)passphrase);
- if( res==IDOK ) {
+ if ( res==IDOK ) {
LPSTR priv = (LPSTR) alloca(RSASIZE);
exp->rsa_export_keypair(CPP_MODE_RSA,priv,NULL,passphrase);
- if( !SaveExportRSAKeyDlg(hDlg,priv,1) )
+ if ( !SaveExportRSAKeyDlg(hDlg,priv,1) )
msgbox(hDlg,sim112,szModuleName,MB_OK|MB_ICONEXCLAMATION);
}
return TRUE;
} break;
case IDC_RSA_IMPPRIV: {
LPSTR priv = (LPSTR) alloca(RSASIZE);
- if( !LoadImportRSAKeyDlg(hDlg,priv,1) ) return TRUE;
+ if ( !LoadImportRSAKeyDlg(hDlg,priv,1) ) return TRUE;
//
LPSTR passphrase = (LPSTR) alloca(RSASIZE);
int res = DialogBoxParam(g_hInst,MAKEINTRESOURCE(IDD_PASSPHRASE),NULL,(DLGPROC)DlgProcSetPassphrase,(LPARAM)passphrase);
- if( res==IDOK ) {
- if( !exp->rsa_import_keypair(CPP_MODE_RSA,priv,passphrase) ) {
+ if ( res==IDOK ) {
+ if ( !exp->rsa_import_keypair(CPP_MODE_RSA,priv,passphrase) ) {
msgbox(hDlg,sim113,szModuleName,MB_OK|MB_ICONEXCLAMATION);
}
else {
@@ -641,9 +641,9 @@ INT_PTR CALLBACK DlgProcOptionsProto(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM
} break;
case IDC_SPLITON:
case IDC_SPLITOFF: {
- if( HIWORD(wParam) == EN_CHANGE ) {
+ if ( HIWORD(wParam) == EN_CHANGE ) {
idx = ListView_GetSelectionMark(hLV);
- if( idx == -1 ) break;
+ if ( idx == -1 ) break;
idx = (int) getListViewParam(hLV,idx);
switch(LOWORD(wParam)) {
case IDC_SPLITON:
@@ -656,7 +656,7 @@ INT_PTR CALLBACK DlgProcOptionsProto(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM
break;
}
}
- if(!iInit)
+ if (!iInit)
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
} break;
}
@@ -682,7 +682,7 @@ INT_PTR CALLBACK DlgProcOptionsProto(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM
case IDC_PROTO: {
if (((LPNMHDR)lParam)->code == (UINT)NM_CLICK) {
idx = (int) getListViewParam(hLV,LPNMLISTVIEW(lParam)->iItem);
- if( idx == -1 ) break;
+ if ( idx == -1 ) break;
EnableWindow(GetDlgItem(hDlg,IDC_SPLITON), true);
EnableWindow(GetDlgItem(hDlg,IDC_SPLITOFF), true);
mir_itoa(proto[idx].tsplit_on,buf,10); SetDlgItemText(hDlg,IDC_SPLITON,buf);
@@ -757,7 +757,7 @@ INT_PTR CALLBACK DlgProcOptionsPGP(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l
break;
case WM_PAINT: {
- if(!iInit)
+ if (!iInit)
InvalidateRect(hDlg,NULL,FALSE);
} // WM_PAINT
break;
@@ -787,7 +787,7 @@ INT_PTR CALLBACK DlgProcOptionsPGP(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l
break;
case IDC_LOAD_PRIVKEY: {
char KeyPath[MAX_PATH]; KeyPath[0]='\0';
- if(ShowSelectKeyDlg(hDlg,KeyPath)){
+ if(ShowSelectKeyDlg(hDlg,KeyPath)) {
char *priv = LoadKeys(KeyPath,true);
if(priv) {
DBWriteContactSettingString(0,szModuleName,"tpgpPrivKey",priv);
@@ -809,7 +809,7 @@ INT_PTR CALLBACK DlgProcOptionsPGP(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l
default:
break;
}
- if(!iInit)
+ if (!iInit)
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
}
break;
@@ -909,7 +909,7 @@ INT_PTR CALLBACK DlgProcOptionsGPG(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l
break;
case WM_PAINT: {
- if(!iInit)
+ if (!iInit)
InvalidateRect(hDlg,NULL,FALSE);
} // WM_PAINT
break;
@@ -918,7 +918,7 @@ INT_PTR CALLBACK DlgProcOptionsGPG(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l
switch(LOWORD(wParam)) {
/* case IDC_LOAD_PRIVKEY: {
char KeyPath[MAX_PATH] = {0};
- if(ShowSelectKeyDlg(hDlg,KeyPath)){
+ if(ShowSelectKeyDlg(hDlg,KeyPath)) {
char *priv = LoadKeys(KeyPath,true);
if(priv) {
DBWriteContactSettingString(0,szModuleName,"tpgpPrivKey",priv);
@@ -972,7 +972,7 @@ INT_PTR CALLBACK DlgProcOptionsGPG(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l
default:
break;
}
- if(!iInit)
+ if (!iInit)
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
}
break;
@@ -995,7 +995,7 @@ INT_PTR CALLBACK DlgProcOptionsGPG(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l
if(LPNMLISTVIEW(lParam)->iSubItem == 3) {
idx = LPNMLISTVIEW(lParam)->iItem;
ptr = (pUinKey) getListViewParam(hLV,idx);
- if( !ptr ) break;
+ if ( !ptr ) break;
ptr->tgpgMode++; ptr->tgpgMode&=1;
LV_SetItemTextA(hLV, LPNMLISTVIEW(lParam)->iItem, LPNMLISTVIEW(lParam)->iSubItem, (ptr->tgpgMode)?Translate(sim228):Translate(sim229));
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
@@ -1032,7 +1032,7 @@ BOOL CALLBACK DlgProcSetPSK(HWND hDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) {
case WM_INITDIALOG: {
TranslateDialogDefault(hDlg);
SendDlgItemMessage(hDlg,IDC_EDIT1,EM_LIMITTEXT,PSKSIZE-1,0);
- if( bCoreUnicode ) SetDlgItemTextW(hDlg,IDC_EDIT2,(LPWSTR)lParam);
+ if ( bCoreUnicode ) SetDlgItemTextW(hDlg,IDC_EDIT2,(LPWSTR)lParam);
else SetDlgItemTextA(hDlg,IDC_EDIT2,(LPCSTR)lParam);
buffer = (LPSTR)lParam;
return (TRUE);
@@ -1132,7 +1132,7 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit) {
SendMessage(GetDlgItem(hDlg,IDC_MCM),BM_SETCHECK,(bMCM)?BST_CHECKED:BST_UNCHECKED,0L);
/* // CList_classic
- if(!ServiceExists(MS_CLIST_ADDSUBGROUPMENUITEM)) {
+ if (!ServiceExists(MS_CLIST_ADDSUBGROUPMENUITEM)) {
EnableWindow(GetDlgItem(hDlg,IDC_ASI),FALSE);
for(i=2;i<ADV_CNT;i++)
EnableWindow(GetDlgItem(hDlg,IDC_ADV1+i),FALSE);
@@ -1140,7 +1140,7 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit) {
*/
// Advanced
SendMessage(GetDlgItem(hDlg, IDC_ADVICON), CB_SETCURSEL, bADV, 0);
- if( g_hCLIcon ) {
+ if ( g_hCLIcon ) {
EnableWindow(GetDlgItem(hDlg, IDC_ADVICON), false);
}
@@ -1163,7 +1163,7 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit) {
pUinKey ptr = getUinKey(hContact);
if ( ptr && isSecureProtocol(hContact) /*&& !getMetaContact(hContact)*/ && !isChatRoom(hContact)) {
- if( iInit ) {
+ if ( iInit ) {
ptr->tmode = ptr->mode;
ptr->tstatus = ptr->status;
}
@@ -1181,7 +1181,7 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit) {
setListViewMode(hLV, itemNum, ptr->tmode);
setListViewStatus(hLV, itemNum, ptr->tstatus);
- if( ptr->mode==MODE_NATIVE ) setListViewPSK(hLV, itemNum, hasKey(ptr));
+ if ( ptr->mode==MODE_NATIVE ) setListViewPSK(hLV, itemNum, hasKey(ptr));
else setListViewPUB(hLV, itemNum, hasKey(ptr));
setListViewIcon(hLV, itemNum, ptr);
}
@@ -1337,7 +1337,7 @@ void RefreshGPGDlg(HWND hDlg, BOOL iInit) {
pUinKey ptr = getUinKey(hContact);
if (ptr && ptr->mode==MODE_GPG && isSecureProtocol(hContact) /*&& !getMetaContact(hContact)*/ && !isChatRoom(hContact)) {
- if( iInit ) {
+ if ( iInit ) {
ptr->tgpgMode = ptr->gpgMode;
}
@@ -1402,7 +1402,7 @@ void ResetGeneralDlg(HWND hDlg) {
if (isSecureProtocol(hContact) /*&& !getMetaContact(hContact)*/ && !isChatRoom(hContact)) {
pUinKey ptr = getUinKey(hContact);
- if(!ptr) continue;
+ if (!ptr) continue;
ptr->tmode=MODE_NATIVE;
ptr->tstatus=STATUS_ENABLED;
@@ -1420,7 +1420,7 @@ void ResetGeneralDlg(HWND hDlg) {
setListViewMode(hLV, itemNum, ptr->tmode);
setListViewStatus(hLV, itemNum, ptr->tstatus);
- if( ptr->mode==MODE_NATIVE ) setListViewPSK(hLV, itemNum, 0);
+ if ( ptr->mode==MODE_NATIVE ) setListViewPSK(hLV, itemNum, 0);
else setListViewPUB(hLV, itemNum, 0);
setListViewIcon(hLV, itemNum, ptr);
}
@@ -1492,18 +1492,18 @@ void ApplyGeneralSettings(HWND hDlg) {
i = ListView_GetNextItem(hLV,(UINT)-1,LVNI_ALL);
while(i!=-1) {
pUinKey ptr = (pUinKey)getListViewParam(hLV,i);
- if( !ptr ) continue;
- if( ptr->mode!=ptr->tmode ) {
+ if ( !ptr ) continue;
+ if ( ptr->mode!=ptr->tmode ) {
ptr->mode = ptr->tmode;
DBWriteContactSettingByte(ptr->hContact, szModuleName, "mode", ptr->mode);
}
- if( ptr->status!=ptr->tstatus ) {
+ if ( ptr->status!=ptr->tstatus ) {
ptr->status = ptr->tstatus;
if(ptr->status==STATUS_ENABLED) DBDeleteContactSetting(ptr->hContact, szModuleName, "StatusID");
else DBWriteContactSettingByte(ptr->hContact, szModuleName, "StatusID", ptr->status);
}
- if( ptr->mode==MODE_NATIVE ) {
- if( getListViewPSK(hLV,i) ) {
+ if ( ptr->mode==MODE_NATIVE ) {
+ if ( getListViewPSK(hLV,i) ) {
LPSTR tmp = myDBGetString(ptr->hContact,szModuleName,"tPSK");
DBWriteContactSettingString(ptr->hContact, szModuleName, "PSK", tmp);
mir_free(tmp);
@@ -1514,8 +1514,8 @@ void ApplyGeneralSettings(HWND hDlg) {
DBDeleteContactSetting(ptr->hContact, szModuleName, "tPSK");
}
else
- if( ptr->mode==MODE_RSAAES ) {
- if( !getListViewPUB(hLV,i) ) {
+ if ( ptr->mode==MODE_RSAAES ) {
+ if ( !getListViewPUB(hLV,i) ) {
DBDeleteContactSetting(ptr->hContact, szModuleName, "rsa_pub");
}
}
@@ -1591,10 +1591,10 @@ void ApplyGPGSettings(HWND hDlg) {
int i = ListView_GetNextItem(hLV,(UINT)-1,LVNI_ALL);
while(i!=-1) {
pUinKey ptr = (pUinKey)getListViewParam(hLV,i);
- if( !ptr ) continue;
- if( ptr->gpgMode != ptr->tgpgMode ) {
+ if ( !ptr ) continue;
+ if ( ptr->gpgMode != ptr->tgpgMode ) {
ptr->gpgMode = ptr->tgpgMode;
- if( ptr->gpgMode ) DBWriteContactSettingByte(ptr->hContact,szModuleName,"gpgANSI",1);
+ if ( ptr->gpgMode ) DBWriteContactSettingByte(ptr->hContact,szModuleName,"gpgANSI",1);
else DBDeleteContactSetting(ptr->hContact,szModuleName,"gpgANSI");
}
@@ -1686,18 +1686,18 @@ void setListViewPUB(HWND hLV, UINT iItem, UINT iStatus) {
LV_SetItemTextA(hLV, iItem, 4, str);
LPSTR sha = NULL;
- if( iStatus ) {
+ if ( iStatus ) {
DBVARIANT dbv;
dbv.type = DBVT_BLOB;
pUinKey ptr = (pUinKey) getListViewParam(hLV, iItem);
- if( DBGetContactSetting(ptr->hContact,szModuleName,"rsa_pub",&dbv) == 0 ) {
+ if ( DBGetContactSetting(ptr->hContact,szModuleName,"rsa_pub",&dbv) == 0 ) {
int len;
exp->rsa_get_hash((PBYTE)dbv.pbVal,dbv.cpbVal,(PBYTE)str,&len);
sha = mir_strdup(to_hex((PBYTE)str,len));
DBFreeVariant(&dbv);
}
}
- if( sha ) {
+ if ( sha ) {
LV_SetItemTextA(hLV, iItem, 5, sha);
mir_free(sha);
}
@@ -1785,7 +1785,7 @@ void ListView_Sort(HWND hLV, LPARAM lParamSort) {
// restore sort column
sprintf(t,"os%02x",(UINT)lParamSort&0xF0);
- if((lParamSort&0x0F)==0) {
+ if ((lParamSort&0x0F)==0) {
lParamSort=(int)DBGetContactSettingByte(0, szModuleName, t, lParamSort+1);
}
DBWriteContactSettingByte(0, szModuleName, t, (BYTE)lParamSort);
@@ -1823,7 +1823,7 @@ LPCSTR publ_end = "-----END PGP PUBLIC KEY BLOCK-----";
LPSTR LoadKeys(LPCSTR file,BOOL priv) {
FILE *f=fopen(file,"r");
- if(!f) return NULL;
+ if (!f) return NULL;
fseek(f,0,SEEK_END);
int flen = ftell(f);
@@ -1842,7 +1842,7 @@ LPSTR LoadKeys(LPCSTR file,BOOL priv) {
LPSTR keys = (LPSTR)mir_alloc(flen+1);
int i=0; BOOL b=false;
while(fgets(keys+i,128,f)) {
- if(!b && strncmp(keys+i,beg,strlen(beg))==0) {
+ if (!b && strncmp(keys+i,beg,strlen(beg))==0) {
b=true;
}
else
@@ -1869,7 +1869,7 @@ LPSTR LoadKeys(LPCSTR file,BOOL priv) {
BOOL SaveExportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv)
{
char szFile[MAX_PATH] = "rsa_pub.asc";
- if( priv ) strcpy(szFile,"rsa_priv.asc");
+ if ( priv ) strcpy(szFile,"rsa_priv.asc");
OPENFILENAME ofn; memset(&ofn, 0, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
@@ -1882,7 +1882,7 @@ BOOL SaveExportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv)
if (!GetSaveFileName(&ofn)) return FALSE;
FILE *f=fopen(szFile,"wb");
- if( !f ) return FALSE;
+ if ( !f ) return FALSE;
fwrite(key,strlen(key),1,f);
fclose(f);
@@ -1893,7 +1893,7 @@ BOOL SaveExportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv)
BOOL LoadImportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv)
{
char szFile[MAX_PATH] = "rsa_pub.asc";
- if( priv ) strcpy(szFile,"rsa_priv.asc");
+ if ( priv ) strcpy(szFile,"rsa_priv.asc");
OPENFILENAME ofn; memset(&ofn, 0, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
@@ -1906,7 +1906,7 @@ BOOL LoadImportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv)
if (!GetOpenFileName(&ofn)) return FALSE;
FILE *f=fopen(szFile,"rb");
- if( !f ) return FALSE;
+ if ( !f ) return FALSE;
fseek(f,0,SEEK_END);
int flen = ftell(f); if(flen>RSASIZE) { fclose(f); return FALSE; }
diff --git a/plugins/SecureIM/splitmsg.cpp b/plugins/SecureIM/splitmsg.cpp
index 45c2da17e2..ca4f0635cf 100644
--- a/plugins/SecureIM/splitmsg.cpp
+++ b/plugins/SecureIM/splitmsg.cpp
@@ -42,7 +42,7 @@ LPSTR combineMessage(pUinKey ptr, LPSTR szMsg) {
sscanf(szMsg,"%4X%2X%2X",&msg_id,&part_num,&part_all);
//
pPM ppm = NULL, pm = ptr->msgPart;
- if( !ptr->msgPart ) {
+ if ( !ptr->msgPart ) {
pm = ptr->msgPart = new partitionMessage;
memset(pm,0,sizeof(partitionMessage));
pm->id = msg_id;
@@ -51,10 +51,10 @@ LPSTR combineMessage(pUinKey ptr, LPSTR szMsg) {
}
else
while(pm) {
- if( pm->id == msg_id ) break;
+ if ( pm->id == msg_id ) break;
ppm = pm; pm = pm->nextMessage;
}
- if(!pm) { // nothing to found
+ if (!pm) { // nothing to found
pm = ppm->nextMessage = new partitionMessage;
memset(pm,0,sizeof(partitionMessage));
pm->id = msg_id;
@@ -67,14 +67,14 @@ LPSTR combineMessage(pUinKey ptr, LPSTR szMsg) {
Sent_NetLog("combine: save part: %s",pm->message[part_num]);
#endif
int len=0,i;
- for( i=0; i<part_all; i++ ){
+ for ( i=0; i<part_all; i++ ) {
if(pm->message[i]==NULL) break;
len+=(int)strlen(pm->message[i]);
}
- if( i==part_all ) { // combine message
+ if ( i==part_all ) { // combine message
SAFE_FREE(ptr->tmp);
ptr->tmp = (LPSTR) mir_alloc(len+1); *(ptr->tmp)='\0';
- for( i=0; i<part_all; i++ ){
+ for ( i=0; i<part_all; i++ ) {
strcat(ptr->tmp,pm->message[i]);
delete pm->message[i];
}
@@ -102,7 +102,7 @@ int splitMessageSend(pUinKey ptr, LPSTR szMsg) {
int ret;
int len = (int)strlen(szMsg);
int par = (getContactStatus(ptr->hContact)==ID_STATUS_OFFLINE)?ptr->proto->split_off:ptr->proto->split_on;
- if( par && len>par ) {
+ if ( par && len>par ) {
LPSTR msg = splitMsg(szMsg,par);
LPSTR buf = msg;
while( *buf ) {
diff --git a/plugins/SecureIM/svcs_clist.cpp b/plugins/SecureIM/svcs_clist.cpp
index 4d70edb2bc..359e273562 100644
--- a/plugins/SecureIM/svcs_clist.cpp
+++ b/plugins/SecureIM/svcs_clist.cpp
@@ -5,16 +5,16 @@ int __cdecl onContactSettingChanged(WPARAM wParam,LPARAM lParam) {
HANDLE hContact = (HANDLE)wParam;
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
- if(!hContact || strcmp(cws->szSetting,"Status")) return 0;
+ if (!hContact || strcmp(cws->szSetting,"Status")) return 0;
pUinKey ptr = getUinKey(hContact);
int stat = getContactStatus(hContact);
- if(!ptr || stat==-1) return 0;
+ if (!ptr || stat==-1) return 0;
// HANDLE hMetaContact = getMetaContact(hContact);
// if(hMetaContact) {
// ptr = getUinKey(hMetaContact);
-// if(!ptr) return 0;
+// if (!ptr) return 0;
// }
if (stat==ID_STATUS_OFFLINE) { // go offline
@@ -49,7 +49,7 @@ int __cdecl onContactSettingChanged(WPARAM wParam,LPARAM lParam) {
}
}
else { // go not offline
-// if(!hMetaContact) { // is contact or metacontact (not subcontact)
+// if (!hMetaContact) { // is contact or metacontact (not subcontact)
if (ptr->offlineKey) {
cpp_reset_context(ptr->cntx);
ptr->offlineKey = false;
@@ -82,7 +82,7 @@ int __cdecl onExtraImageListRebuilding(WPARAM, LPARAM) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onExtraImageListRebuilding");
#endif
- if( (bADV || g_hCLIcon) && ServiceExists(MS_CLIST_EXTRA_ADD_ICON) ) {
+ if ( (bADV || g_hCLIcon) && ServiceExists(MS_CLIST_EXTRA_ADD_ICON) ) {
RefreshContactListIcons();
}
return 0;
@@ -91,9 +91,9 @@ int __cdecl onExtraImageListRebuilding(WPARAM, LPARAM) {
int __cdecl onExtraImageApplying(WPARAM wParam, LPARAM) {
- if( (bADV || g_hCLIcon) && ServiceExists(MS_CLIST_EXTRA_SET_ICON) && isSecureProtocol((HANDLE)wParam) ) {
+ if ( (bADV || g_hCLIcon) && ServiceExists(MS_CLIST_EXTRA_SET_ICON) && isSecureProtocol((HANDLE)wParam) ) {
IconExtraColumn iec = mode2iec(isContactSecured((HANDLE)wParam));
- if( g_hCLIcon ) {
+ if ( g_hCLIcon ) {
ExtraIcon_SetIcon(g_hCLIcon, (HANDLE)wParam, iec.hImage);
}
else {
@@ -111,7 +111,7 @@ int __cdecl onRebuildContactMenu(WPARAM wParam,LPARAM lParam) {
#endif
HANDLE hContact = (HANDLE)wParam;
BOOL bMC = isProtoMetaContacts(hContact);
- if( bMC ) hContact = getMostOnline(hContact); // âîçüìåì òîò, ÷åðåç êîòîðûé ïîéäåò ñîîáùåíèå
+ if ( bMC ) hContact = getMostOnline(hContact); // âîçüìåì òîò, ÷åðåç êîòîðûé ïîéäåò ñîîáùåíèå
pUinKey ptr = getUinKey(hContact);
int i;
@@ -122,11 +122,11 @@ int __cdecl onRebuildContactMenu(WPARAM wParam,LPARAM lParam) {
ShowStatusIconNotify(hContact);
// check offline/online
- if(!ptr) {
+ if (!ptr) {
// hide menu bars
mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_HIDDEN;
for(i=0;i<SIZEOF(g_hMenu);i++) {
- if( g_hMenu[i] )
+ if ( g_hMenu[i] )
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[i],(LPARAM)&mi);
}
return 0;
@@ -147,7 +147,7 @@ int __cdecl onRebuildContactMenu(WPARAM wParam,LPARAM lParam) {
// hide all menu bars
mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_HIDDEN;
for(i=0;i<SIZEOF(g_hMenu);i++) {
- if( g_hMenu[i] )
+ if ( g_hMenu[i] )
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[i],(LPARAM)&mi);
}
@@ -155,7 +155,7 @@ int __cdecl onRebuildContactMenu(WPARAM wParam,LPARAM lParam) {
(ptr->mode==MODE_NATIVE || ptr->mode==MODE_RSAAES) ) {
// Native/RSAAES
mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIM_ICON;
- if( !isSecured ) {
+ if ( !isSecured ) {
// create secureim connection
mi.hIcon = mode2icon(ptr->mode|SECURED,2);
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[0],(LPARAM)&mi);
@@ -166,7 +166,7 @@ int __cdecl onRebuildContactMenu(WPARAM wParam,LPARAM lParam) {
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[1],(LPARAM)&mi);
}
// set status menu
- if( bSCM && !bMC &&
+ if ( bSCM && !bMC &&
( !isSecured || ptr->mode==MODE_PGP || ptr->mode==MODE_GPG ) ) {
mi.flags = CMIM_FLAGS | CMIM_NAME | CMIM_ICON;
@@ -182,24 +182,24 @@ int __cdecl onRebuildContactMenu(WPARAM wParam,LPARAM lParam) {
}
}
else
- if( isSecureProto && !isChat && (ptr->mode==MODE_PGP || ptr->mode==MODE_GPG) ) {
+ if ( isSecureProto && !isChat && (ptr->mode==MODE_PGP || ptr->mode==MODE_GPG) ) {
// PGP, GPG
- if( ptr->mode==MODE_PGP && bPGPloaded ) {
- if((bPGPkeyrings || bPGPprivkey) && !isGPG) {
+ if ( ptr->mode==MODE_PGP && bPGPloaded ) {
+ if ((bPGPkeyrings || bPGPprivkey) && !isGPG) {
mi.flags = CMIM_FLAGS;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[isPGP+6],(LPARAM)&mi);
}
}
- if( ptr->mode==MODE_GPG && bGPGloaded ) {
+ if ( ptr->mode==MODE_GPG && bGPGloaded ) {
if(bGPGkeyrings && !isPGP) {
mi.flags = CMIM_FLAGS;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[isGPG+8],(LPARAM)&mi);
}
}
}
- if( isSecureProto && !isChat && isMiranda ) {
+ if ( isSecureProto && !isChat && isMiranda ) {
// set mode menu
- if( bMCM && !bMC &&
+ if ( bMCM && !bMC &&
( !isSecured || ptr->mode==MODE_PGP || ptr->mode==MODE_GPG ) ) {
mi.flags = CMIM_FLAGS | CMIM_NAME | CMIM_ICON;
@@ -209,8 +209,8 @@ int __cdecl onRebuildContactMenu(WPARAM wParam,LPARAM lParam) {
mi.flags = CMIM_FLAGS | CMIM_ICON;
for(i=0;i<MODE_CNT;i++) {
- if( i==MODE_PGP && ptr->mode!=MODE_PGP && !bPGP ) continue;
- if( i==MODE_GPG && ptr->mode!=MODE_GPG && !bGPG ) continue;
+ if ( i==MODE_PGP && ptr->mode!=MODE_PGP && !bPGP ) continue;
+ if ( i==MODE_GPG && ptr->mode!=MODE_GPG && !bGPG ) continue;
mi.hIcon = (i == ptr->mode) ? g_hICO[ICO_ST_ENA] : NULL;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[11+i],(LPARAM)&mi);
}
diff --git a/plugins/SecureIM/svcs_menu.cpp b/plugins/SecureIM/svcs_menu.cpp
index 95b08dd5a0..310d367e1b 100644
--- a/plugins/SecureIM/svcs_menu.cpp
+++ b/plugins/SecureIM/svcs_menu.cpp
@@ -12,7 +12,7 @@ INT_PTR __cdecl Service_CreateIM(WPARAM wParam,LPARAM lParam){
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)wParam, (LPARAM)szModuleName);
// WPARAM flags = 0;
// HANDLE hMetaContact = getMetaContact((HANDLE)wParam);
-// if( hMetaContact ) {
+// if ( hMetaContact ) {
// wParam = (WPARAM)hMetaContact;
// flags = PREF_METANODB;
// }
@@ -24,7 +24,7 @@ INT_PTR __cdecl Service_CreateIM(WPARAM wParam,LPARAM lParam){
INT_PTR __cdecl Service_DisableIM(WPARAM wParam,LPARAM lParam) {
// WPARAM flags = 0;
// HANDLE hMetaContact = getMetaContact((HANDLE)wParam);
-// if( hMetaContact ) {
+// if ( hMetaContact ) {
// wParam = (WPARAM)hMetaContact;
// flags = PREF_METANODB;
// }
@@ -111,7 +111,7 @@ INT_PTR __cdecl Service_PGPsetKey(WPARAM wParam, LPARAM lParam) {
else
if(bPGPprivkey) {
char KeyPath[MAX_PATH]; KeyPath[0]='\0';
- if(ShowSelectKeyDlg(0,KeyPath)){
+ if(ShowSelectKeyDlg(0,KeyPath)) {
char *publ = LoadKeys(KeyPath,false);
if(publ) {
DBDeleteContactSetting((HANDLE)wParam,szModuleName,"pgp");
@@ -178,18 +178,18 @@ INT_PTR __cdecl Service_Mode(WPARAM wParam, LPARAM lParam) {
switch(--lParam) {
case MODE_NATIVE:
case MODE_RSAAES:
- if( isContactSecured((HANDLE)wParam)&SECURED ) {
+ if ( isContactSecured((HANDLE)wParam)&SECURED ) {
msgbox(NULL, sim111, szModuleName, MB_OK);
return 0;
}
- if( lParam!=MODE_NATIVE && ptr->status>STATUS_ENABLED ) {
+ if ( lParam!=MODE_NATIVE && ptr->status>STATUS_ENABLED ) {
Service_Status(wParam,STATUS_ENABLED+1);
}
case MODE_PGP:
case MODE_GPG:
// íóæíî ìíîãî ïðîâåðîê è îòêëþ÷åíèå àêòèâíîãî êîíòåêñòà åñëè íåîáõîäèìî
if(ptr) {
- if( ptr->cntx ) {
+ if ( ptr->cntx ) {
cpp_delete_context(ptr->cntx);
ptr->cntx = 0;
ptr->keyLoaded = 0;
diff --git a/plugins/SecureIM/svcs_popup.cpp b/plugins/SecureIM/svcs_popup.cpp
index 6c0f97a1a3..bb1eb88355 100644
--- a/plugins/SecureIM/svcs_popup.cpp
+++ b/plugins/SecureIM/svcs_popup.cpp
@@ -31,7 +31,7 @@ void showPopupMsg(HANDLE hContact, LPCSTR lpzText, HICON hIcon, int type) {
// 6 - msg sent
//
- if(!bPopupExists) return;
+ if (!bPopupExists) return;
char nback[32]; mir_snprintf(nback,sizeof(nback),"popup%dback", $type);
char ntext[32]; mir_snprintf(ntext,sizeof(ntext),"popup%dtext", $type);
@@ -41,7 +41,7 @@ void showPopupMsg(HANDLE hContact, LPCSTR lpzText, HICON hIcon, int type) {
COLORREF colorText = (COLORREF)DBGetContactSettingDword(0,szModuleName,ntext,(DWORD)RGB(0,0,0));
int timeout = (int)DBGetContactSettingWord(0,szModuleName,ntime,0);
- if( bCoreUnicode && bPopupUnicode ) {
+ if ( bCoreUnicode && bPopupUnicode ) {
POPUPDATAW ppd;
memset(&ppd,0,sizeof(POPUPDATAW));
ppd.lchContact = hContact;
diff --git a/plugins/SecureIM/svcs_proto.cpp b/plugins/SecureIM/svcs_proto.cpp
index e6e538c60a..a69d7d720d 100644
--- a/plugins/SecureIM/svcs_proto.cpp
+++ b/plugins/SecureIM/svcs_proto.cpp
@@ -7,7 +7,7 @@ int getSecureSig(LPCSTR szMsg, LPSTR *szPlainMsg=NULL) {
for(int i=0;signs[i].len;i++) {
if (memcmp(szMsg,signs[i].sig,signs[i].len)==0) {
/* for(int i=strlen(szMsg)-1;i;i--) {
- if( szMsg[i] == '\x0D' || szMsg[i] == '\x0A' )
+ if ( szMsg[i] == '\x0D' || szMsg[i] == '\x0A' )
((LPSTR)szMsg)[i] = '\0';
else
break;
@@ -56,7 +56,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
#endif
// cut rtf tags
- if( pRtfconvString && memcmp(szEncMsg,"{\\rtf1",6)==0 ) {
+ if ( pRtfconvString && memcmp(szEncMsg,"{\\rtf1",6)==0 ) {
SAFE_FREE(szUnrtfMsg);
int len = (int)strlen(szEncMsg)+1;
LPWSTR szTemp = (LPWSTR)mir_alloc(len*sizeof(WCHAR));
@@ -66,7 +66,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
rtfconvA(szEncMsg,szTemp);
len = (int)wcslen(szTemp)-1;
while(len) {
- if( szTemp[len] == 0x0D || szTemp[len] == 0x0A )
+ if ( szTemp[len] == 0x0D || szTemp[len] == 0x0A )
szTemp[len] = 0;
else
break;
@@ -87,12 +87,12 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
BOOL bGPG = isContactGPG(pccsd->hContact);
// HANDLE hMetaContact = getMetaContact(pccsd->hContact);
-// if( hMetaContact ) {
+// if ( hMetaContact ) {
// ptr = getUinKey(hMetaContact);
// }
// pass any unchanged message
- if( !ptr ||
+ if ( !ptr ||
ssig==SiG_GAME ||
!isSecureProtocol(pccsd->hContact) ||
(isProtoMetaContacts(pccsd->hContact) && (pccsd->wParam & PREF_SIMNOMETA)) ||
@@ -106,7 +106,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
}
// drop message: fake, unsigned or from invisible contacts
- if( isContactInvisible(pccsd->hContact) || ssig==SiG_FAKE ) {
+ if ( isContactInvisible(pccsd->hContact) || ssig==SiG_FAKE ) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onRecvMsg: drop unhandled (contact invisible or hidden)");
#endif
@@ -114,7 +114,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
}
// receive non-secure message in secure mode
- if( ssig==SiG_NONE && !ptr->msgSplitted ) {
+ if ( ssig==SiG_NONE && !ptr->msgSplitted ) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onRecvMsg: non-secure message");
#endif
@@ -132,11 +132,11 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
}
// received non-pgp secure message from disabled contact
- if( ssig!=SiG_PGPM && !bPGP && !bGPG && ptr->status==STATUS_DISABLED ) {
+ if ( ssig!=SiG_PGPM && !bPGP && !bGPG && ptr->status==STATUS_DISABLED ) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onRecvMsg: message from disabled");
#endif
- if( ptr->mode==MODE_NATIVE ) {
+ if ( ptr->mode==MODE_NATIVE ) {
// tell to the other side that we have the plugin disabled with him
pccsd->wParam |= PREF_METANODB;
pccsd->lParam = (LPARAM) SIG_DISA;
@@ -155,7 +155,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
}
// combine message splitted by protocol (no tags)
- if( ssig==SiG_NONE && ptr->msgSplitted ) {
+ if ( ssig==SiG_NONE && ptr->msgSplitted ) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onRecvMsg: combine untagged splitted message");
#endif
@@ -171,15 +171,15 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
}
// combine message splitted by secureim (with tags)
- if( ssig==SiG_SECP || ssig==SiG_PART ) {
+ if ( ssig==SiG_SECP || ssig==SiG_PART ) {
LPSTR msg = combineMessage(ptr,szEncMsg);
- if( !msg ) return 1;
+ if ( !msg ) return 1;
szEncMsg = ppre->szMessage = msg;
ssig = getSecureSig(msg,&szEncMsg);
}
// decrypt PGP/GPG message
- if( ssig==SiG_PGPM &&
+ if ( ssig==SiG_PGPM &&
((bPGPloaded && (bPGPkeyrings || bPGPprivkey))||
(bGPGloaded && bGPGkeyrings))
) {
@@ -187,25 +187,25 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
Sent_NetLog("onRecvMsg: PGP/GPG message");
#endif
szEncMsg = ppre->szMessage;
- if( !ptr->cntx ) {
+ if ( !ptr->cntx ) {
ptr->cntx = cpp_create_context(((bGPGloaded && bGPGkeyrings)?CPP_MODE_GPG:CPP_MODE_PGP) | ((DBGetContactSettingByte(pccsd->hContact,szModuleName,"gpgANSI",0))?CPP_MODE_GPG_ANSI:0));
ptr->keyLoaded = 0;
}
- if(!strstr(szEncMsg,"-----END PGP MESSAGE-----"))
+ if (!strstr(szEncMsg,"-----END PGP MESSAGE-----"))
return 1; // no end tag, don't display it ...
LPSTR szNewMsg = NULL;
LPSTR szOldMsg = NULL;
- if(!ptr->keyLoaded && bPGPloaded) ptr->keyLoaded = LoadKeyPGP(ptr);
- if(!ptr->keyLoaded && bGPGloaded) ptr->keyLoaded = LoadKeyGPG(ptr);
+ if (!ptr->keyLoaded && bPGPloaded) ptr->keyLoaded = LoadKeyPGP(ptr);
+ if (!ptr->keyLoaded && bGPGloaded) ptr->keyLoaded = LoadKeyGPG(ptr);
if(ptr->keyLoaded==1) szOldMsg = pgp_decode(ptr->cntx, szEncMsg);
else
if(ptr->keyLoaded==2) szOldMsg = gpg_decode(ptr->cntx, szEncMsg);
- if(!szOldMsg) { // error while decrypting message, send error
+ if (!szOldMsg) { // error while decrypting message, send error
SAFE_FREE(ptr->msgSplitted);
ppre->flags &= ~(PREF_UNICODE|PREF_UTF);
pccsd->wParam &= ~(PREF_UNICODE|PREF_UTF);
@@ -214,7 +214,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
}
// receive encrypted message in non-encrypted mode
- if(!isContactPGP(pccsd->hContact) && !isContactGPG(pccsd->hContact)) {
+ if (!isContactPGP(pccsd->hContact) && !isContactGPG(pccsd->hContact)) {
szNewMsg = m_ustrcat(TranslateU(sim403),szOldMsg);
szOldMsg = szNewMsg;
}
@@ -242,18 +242,18 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onRecvMsg: RSA/AES message");
#endif
- if( ptr->mode==MODE_NATIVE ) {
+ if ( ptr->mode==MODE_NATIVE ) {
ptr->mode = MODE_RSAAES;
deleteRSAcntx(ptr);
DBWriteContactSettingByte(ptr->hContact, szModuleName, "mode", ptr->mode);
}
createRSAcntx(ptr);
loadRSAkey(ptr);
- if( exp->rsa_get_state(ptr->cntx)==0 )
+ if ( exp->rsa_get_state(ptr->cntx)==0 )
showPopUpKR(ptr->hContact);
LPSTR szOldMsg = exp->rsa_recv(ptr->cntx,szEncMsg);
- if( !szOldMsg ) return 1; // don't display it ...
+ if ( !szOldMsg ) return 1; // don't display it ...
LPSTR szNewMsg = utf8_to_miranda(szOldMsg,ppre->flags); pccsd->wParam = ppre->flags;
ppre->szMessage = szNewMsg;
@@ -271,10 +271,10 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onRecvMsg: Native SiG_ENON message");
#endif
- if( cpp_keyx(ptr->cntx) ) {
+ if ( cpp_keyx(ptr->cntx) ) {
// decrypting message
szPlainMsg = decodeMsg(ptr,lParam,szEncMsg);
- if(!ptr->decoded) {
+ if (!ptr->decoded) {
mir_free(szPlainMsg);
SAFE_FREE(ptr->msgSplitted);
ptr->msgSplitted=mir_strdup(szEncMsg);
@@ -322,7 +322,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv;
dbv.type = DBVT_BLOB;
- if( DBGetContactSetting(ptr->hContact,szModuleName,"offlineKey",&dbv) == 0 ) {
+ if ( DBGetContactSetting(ptr->hContact,szModuleName,"offlineKey",&dbv) == 0 ) {
// if valid key is succefully retrieved
ptr->offlineKey = true;
InitKeyX(ptr,dbv.pbVal);
@@ -377,7 +377,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
case SiG_KEYR: // key3 message
case SiG_KEYA: // keyA message
case SiG_KEYB: { // keyB message
- if( ptr->mode==MODE_RSAAES ) {
+ if ( ptr->mode==MODE_RSAAES ) {
ptr->mode = MODE_NATIVE;
cpp_delete_context(ptr->cntx);
ptr->cntx = 0;
@@ -392,12 +392,12 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
// receive KeyB from user;
showPopUpKR(ptr->hContact);
- if( ptr->cntx && cpp_keyb(ptr->cntx) ) {
+ if ( ptr->cntx && cpp_keyb(ptr->cntx) ) {
// reinit key exchange if an old key from user is found
cpp_reset_context(ptr->cntx);
}
- if( InitKeyB(ptr,szEncMsg)!=CPP_ERROR_NONE ) {
+ if ( InitKeyB(ptr,szEncMsg)!=CPP_ERROR_NONE ) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onRecvMsg: SiG_KEYR InitKeyB error");
#endif
@@ -416,7 +416,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
}
// other side support RSA mode ?
- if( ptr->features & CPP_FEATURES_RSA ) {
+ if ( ptr->features & CPP_FEATURES_RSA ) {
// switch to RSAAES mode
ptr->mode = MODE_RSAAES;
DBWriteContactSettingByte(ptr->hContact, szModuleName, "mode", ptr->mode);
@@ -431,7 +431,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
}
// other side support new key format ?
- if( ptr->features & CPP_FEATURES_NEWPG ) {
+ if ( ptr->features & CPP_FEATURES_NEWPG ) {
cpp_reset_context(ptr->cntx);
LPSTR keyToSend = InitKeyA(ptr,CPP_FEATURES_NEWPG|KEY_A_SIG); // calculate NEW public and private key
@@ -450,7 +450,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
}
// auto send my public key to keyB user if not done before
- if( !cpp_keya(ptr->cntx) ) {
+ if ( !cpp_keya(ptr->cntx) ) {
LPSTR keyToSend = InitKeyA(ptr,0); // calculate public and private key
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onRecvMsg: Sending KEYA %s", keyToSend);
@@ -510,7 +510,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
showPopUpKR(ptr->hContact);
// clear all and send DISA if received KeyB, and not exist KeyA or error on InitKeyB
- if(!cpp_keya(ptr->cntx) || InitKeyB(ptr,szEncMsg)!=CPP_ERROR_NONE) {
+ if (!cpp_keya(ptr->cntx) || InitKeyB(ptr,szEncMsg)!=CPP_ERROR_NONE) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onRecvMsg: SiG_KEYB InitKeyB error");
#endif
@@ -534,7 +534,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
/* common part (CalcKeyX & SendQueue) */
// calculate KeyX
- if( cpp_keya(ptr->cntx) && cpp_keyb(ptr->cntx) && !cpp_keyx(ptr->cntx) )
+ if ( cpp_keya(ptr->cntx) && cpp_keyb(ptr->cntx) && !cpp_keyx(ptr->cntx) )
CalculateKeyX(ptr,ptr->hContact);
ShowStatusIconNotify(ptr->hContact);
@@ -550,7 +550,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
} //switch
// receive message
- if( cpp_keyx(ptr->cntx) && (ssig==SiG_ENON||ssig==SiG_ENOF) ) {
+ if ( cpp_keyx(ptr->cntx) && (ssig==SiG_ENON||ssig==SiG_ENOF) ) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onRecvMsg: message received");
#endif
@@ -568,10 +568,10 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) {
// SendMsgW handler
INT_PTR __cdecl onSendMsgW(WPARAM wParam, LPARAM lParam) {
- if(!lParam) return 0;
+ if (!lParam) return 0;
CCSDATA *ccs = (CCSDATA *) lParam;
- if( !(ccs->wParam & PREF_UTF) )
+ if ( !(ccs->wParam & PREF_UTF) )
ccs->wParam |= PREF_UNICODE;
return onSendMsg(wParam, lParam);
@@ -587,7 +587,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
int stat = getContactStatus(pccsd->hContact);
// HANDLE hMetaContact = getMetaContact(pccsd->hContact);
-// if( hMetaContact ) {
+// if ( hMetaContact ) {
// ptr = getUinKey(hMetaContact);
// }
#if defined(_DEBUG) || defined(NETLIB_LOG)
@@ -611,12 +611,12 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
//
// PGP/GPG mode
//
- if( ptr->mode==MODE_PGP || ptr->mode==MODE_GPG ) {
+ if ( ptr->mode==MODE_PGP || ptr->mode==MODE_GPG ) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onSendMsg: PGP|GPG mode");
#endif
// åñëè ìîæíî çàøèôðîâàòü - øèôðóåì
- if( isContactPGP(ptr->hContact) || isContactGPG(ptr->hContact) ) {
+ if ( isContactPGP(ptr->hContact) || isContactGPG(ptr->hContact) ) {
/*
if(stat==ID_STATUS_OFFLINE) {
if (msgbox1(0,sim110,szModuleName,MB_YESNO|MB_ICONQUESTION)==IDNO) {
@@ -626,25 +626,25 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
}
*/
- if( !ptr->cntx ) {
+ if ( !ptr->cntx ) {
ptr->cntx = cpp_create_context((isContactGPG(ptr->hContact)?CPP_MODE_GPG:CPP_MODE_PGP) | ((DBGetContactSettingByte(ptr->hContact,szModuleName,"gpgANSI",0))?CPP_MODE_GPG_ANSI:0));
ptr->keyLoaded = 0;
}
- if( !ptr->keyLoaded && bPGPloaded ) ptr->keyLoaded = LoadKeyPGP(ptr);
- if( !ptr->keyLoaded && bGPGloaded ) ptr->keyLoaded = LoadKeyGPG(ptr);
- if( !ptr->keyLoaded ) return returnError(pccsd->hContact,Translate(sim108));
+ if ( !ptr->keyLoaded && bPGPloaded ) ptr->keyLoaded = LoadKeyPGP(ptr);
+ if ( !ptr->keyLoaded && bGPGloaded ) ptr->keyLoaded = LoadKeyGPG(ptr);
+ if ( !ptr->keyLoaded ) return returnError(pccsd->hContact,Translate(sim108));
LPSTR szNewMsg = NULL;
LPSTR szUtfMsg = miranda_to_utf8((LPCSTR)pccsd->lParam,pccsd->wParam);
- if( ptr->keyLoaded == 1 ) { // PGP
+ if ( ptr->keyLoaded == 1 ) { // PGP
szNewMsg = pgp_encode(ptr->cntx,szUtfMsg);
}
else
- if( ptr->keyLoaded == 2 ) { // GPG
+ if ( ptr->keyLoaded == 2 ) { // GPG
szNewMsg = gpg_encode(ptr->cntx,szUtfMsg);
}
mir_free(szUtfMsg);
- if( !szNewMsg ) {
+ if ( !szNewMsg ) {
return returnError(pccsd->hContact,Translate(sim109));
}
@@ -667,22 +667,22 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
//
// RSA/AES mode
//
- if( ptr->mode==MODE_RSAAES ) {
+ if ( ptr->mode==MODE_RSAAES ) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onSendMsg: RSA/AES mode");
#endif
// contact is offline
if ( stat==ID_STATUS_OFFLINE ) {
- if( ptr->cntx ) {
- if( exp->rsa_get_state(ptr->cntx)!=0 ) {
+ if ( ptr->cntx ) {
+ if ( exp->rsa_get_state(ptr->cntx)!=0 ) {
resetRSAcntx(ptr);
}
}
else {
createRSAcntx(ptr);
}
- if( !bSOM || (!isClientMiranda(ptr,1) && !isSecureIM(ptr,1)) || !loadRSAkey(ptr) ) {
- if( ssig==SiG_NONE ) {
+ if ( !bSOM || (!isClientMiranda(ptr,1) && !isSecureIM(ptr,1)) || !loadRSAkey(ptr) ) {
+ if ( ssig==SiG_NONE ) {
// ïðîñòî øëåì íåçàøèôðîâàííîå â îôôëàéí
return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
}
@@ -699,12 +699,12 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
return returnNoError(pccsd->hContact);
}
// SecureIM connection with this contact is disabled
- if( stid==STATUS_DISABLED ) {
- if( ptr->cntx ) {
+ if ( stid==STATUS_DISABLED ) {
+ if ( ptr->cntx ) {
exp->rsa_disabled(ptr->cntx);
deleteRSAcntx(ptr);
}
- if( ssig==SiG_NONE ) {
+ if ( ssig==SiG_NONE ) {
// ïðîñòî øëåì íåçàøèôðîâàííîå
return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
}
@@ -712,8 +712,8 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
return returnNoError(pccsd->hContact);
}
// ðàçîðâàòü ñîåäèíåíèå
- if( ssig==SiG_DEIN ) {
- if( ptr->cntx ) {
+ if ( ssig==SiG_DEIN ) {
+ if ( ptr->cntx ) {
exp->rsa_disconnect(ptr->cntx);
deleteRSAcntx(ptr);
}
@@ -721,7 +721,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
return returnNoError(pccsd->hContact);
}
// ñîåäèíåíèå óñòàíîâëåíî
- if( ptr->cntx && exp->rsa_get_state(ptr->cntx)==7 ) {
+ if ( ptr->cntx && exp->rsa_get_state(ptr->cntx)==7 ) {
LPSTR szUtfMsg = miranda_to_utf8((LPCSTR)pccsd->lParam,pccsd->wParam);
exp->rsa_send(ptr->cntx,szUtfMsg);
mir_free(szUtfMsg);
@@ -729,7 +729,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
return returnNoError(pccsd->hContact);
}
// ïðîñòî ñîîáùåíèå (áåç òýãîâ, íåò êîíòåêñòà è ðàáîòàþò AIP & NOL)
- if( ssig==SiG_NONE && isSecureIM(ptr->hContact) ) {
+ if ( ssig==SiG_NONE && isSecureIM(ptr->hContact) ) {
// äîáàâèì åãî â î÷åðåäü
addMsg2Queue(ptr, pccsd->wParam, (LPSTR)pccsd->lParam);
// çàïóñêàåì ïðîöåññ óñòàíîâêè ñîåäèíåíèÿ
@@ -738,7 +738,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
waitForExchange(ptr);
}
// óñòàíîâèòü ñîåäèíåíèå
- if( ssig==SiG_INIT ) {
+ if ( ssig==SiG_INIT ) {
createRSAcntx(ptr);
loadRSAkey(ptr);
exp->rsa_connect(ptr->cntx);
@@ -758,12 +758,12 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
#endif
// SecureIM connection with this contact is disabled
- if( stid==STATUS_DISABLED ) {
+ if ( stid==STATUS_DISABLED ) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onSendMsg: message for Disabled");
#endif
// if user try initialize connection
- if( ssig==SiG_INIT ) {
+ if ( ssig==SiG_INIT ) {
// secure IM is disabled ...
return returnError(pccsd->hContact,Translate(sim105));
}
@@ -785,17 +785,17 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
}
// contact is offline
- if( stat==ID_STATUS_OFFLINE ) {
+ if ( stat==ID_STATUS_OFFLINE ) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onSendMsg: message for offline");
#endif
- if( ssig==SiG_INIT && cpp_keyx(ptr->cntx) ) {
+ if ( ssig==SiG_INIT && cpp_keyx(ptr->cntx) ) {
// reinit key exchange
cpp_reset_context(ptr->cntx);
}
- if( !bSOM ) {
- if( ssig!=SiG_NONE ) {
+ if ( !bSOM ) {
+ if ( ssig!=SiG_NONE ) {
return returnNoError(pccsd->hContact);
}
// exit and send unencrypted message
@@ -803,10 +803,10 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
}
BOOL isMiranda = isClientMiranda(ptr->hContact);
- if( stid==STATUS_ALWAYSTRY && isMiranda ) { // always try && Miranda
+ if ( stid==STATUS_ALWAYSTRY && isMiranda ) { // always try && Miranda
// set key for offline user
DBVARIANT dbv; dbv.type = DBVT_BLOB;
- if( DBGetContactSettingDword(ptr->hContact, szModuleName, "offlineKeyTimeout", 0) > gettime() &&
+ if ( DBGetContactSettingDword(ptr->hContact, szModuleName, "offlineKeyTimeout", 0) > gettime() &&
DBGetContactSetting(ptr->hContact, szModuleName, "offlineKey", &dbv) == 0
) {
// if valid key is succefully retrieved
@@ -829,7 +829,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
int res=msgbox1(0,"User is offline now, Do you want to send your message ?\nIt will be unencrypted !","Can't Send Encrypted Message !",MB_YESNO);
if (res==IDNO) return 1;
}*/
- if( ssig!=SiG_NONE ) {
+ if ( ssig!=SiG_NONE ) {
return returnNoError(pccsd->hContact);
}
// exit and send unencrypted message
@@ -842,7 +842,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
Sent_NetLog("onSendMsg: message for online");
#endif
// contact is online and we use an offline key -> reset offline key
- if( ptr->offlineKey ) {
+ if ( ptr->offlineKey ) {
cpp_reset_context(ptr->cntx);
ptr->offlineKey = false;
ShowStatusIconNotify(ptr->hContact);
@@ -850,7 +850,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
}
// if init is called from contact menu list reinit secure im connection
- if( ssig==SiG_INIT ) {
+ if ( ssig==SiG_INIT ) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onSendMsg: SiG_INIT");
#endif
@@ -858,7 +858,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
}
// if deinit is called from contact menu list deinit secure im connection
- if( ssig==SiG_DEIN ) {
+ if ( ssig==SiG_DEIN ) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onSendMsg: SiG_DEIN");
#endif
@@ -875,17 +875,17 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
return returnNoError(pccsd->hContact);
}
- if( cpp_keya(ptr->cntx) && cpp_keyb(ptr->cntx) && !cpp_keyx(ptr->cntx) )
+ if ( cpp_keya(ptr->cntx) && cpp_keyb(ptr->cntx) && !cpp_keyx(ptr->cntx) )
CalculateKeyX(ptr,ptr->hContact);
ShowStatusIconNotify(pccsd->hContact);
// if cryptokey exist
- if( cpp_keyx(ptr->cntx) ) {
+ if ( cpp_keyx(ptr->cntx) ) {
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("onSendMsg: cryptokey exist");
#endif
-/* if( !hMetaContact && isProtoMetaContacts(pccsd->hContact) && (DBGetContactSettingByte(NULL, "MetaContacts", "SubcontactHistory", 1) == 1)) {
+/* if ( !hMetaContact && isProtoMetaContacts(pccsd->hContact) && (DBGetContactSettingByte(NULL, "MetaContacts", "SubcontactHistory", 1) == 1)) {
// add sent event to subcontact
DBEVENTINFO dbei; HANDLE hC = getMostOnline(pccsd->hContact);
ZeroMemory(&dbei, sizeof(dbei));
@@ -926,11 +926,11 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) {
Sent_NetLog("onSendMsg: cryptokey not exist, try establishe connection");
#endif
// send KeyA if init || always_try || waitkey || always_if_possible
- if( ssig==SiG_INIT || (stid==STATUS_ALWAYSTRY && isClientMiranda(ptr->hContact)) || isSecureIM(ptr->hContact) || ptr->waitForExchange ) {
+ if ( ssig==SiG_INIT || (stid==STATUS_ALWAYSTRY && isClientMiranda(ptr->hContact)) || isSecureIM(ptr->hContact) || ptr->waitForExchange ) {
if (ssig==SiG_NONE) {
addMsg2Queue(ptr, pccsd->wParam, (LPSTR)pccsd->lParam);
}
- if( !ptr->waitForExchange ) {
+ if ( !ptr->waitForExchange ) {
// init || always_try || always_if_possible
LPSTR keyToSend = InitKeyA(ptr,0); // calculate public and private key & fill KeyA
#if defined(_DEBUG) || defined(NETLIB_LOG)
@@ -967,7 +967,7 @@ INT_PTR __cdecl onSendFile(WPARAM wParam, LPARAM lParam) {
pUinKey ptr = getUinKey(pccsd->hContact);
if (!ptr || !bSFT) return CallService(PSS_FILE, wParam, lParam);
- if( isContactSecured(pccsd->hContact)&SECURED ) {
+ if ( isContactSecured(pccsd->hContact)&SECURED ) {
char **file=(char **)pccsd->lParam;
if(file_idx==100) file_idx=0;
@@ -977,7 +977,7 @@ INT_PTR __cdecl onSendFile(WPARAM wParam, LPARAM lParam) {
if (strstr(file[i],".AESHELL")) continue;
char *name = strrchr(file[i],'\\');
- if( !name ) name = file[i];
+ if ( !name ) name = file[i];
else name++;
char *file_out = (char*) mir_alloc(TEMP_SIZE+strlen(name)+20);
@@ -987,7 +987,7 @@ INT_PTR __cdecl onSendFile(WPARAM wParam, LPARAM lParam) {
sprintf(buf,"%s\n%s",Translate(sim011),file[i]);
showPopUp(buf,NULL,g_hPOP[POP_PU_MSS],2);
- if( ptr->mode==MODE_RSAAES ) {
+ if ( ptr->mode==MODE_RSAAES ) {
exp->rsa_encrypt_file(ptr->cntx,file[i],file_out);
}
else {
@@ -997,13 +997,13 @@ INT_PTR __cdecl onSendFile(WPARAM wParam, LPARAM lParam) {
mir_free(file[i]);
file[i]=file_out;
}
- if( ptr->fileSend ) { // î÷èñòèì ñîõðàíåííûé ñïèñîê
+ if ( ptr->fileSend ) { // î÷èñòèì ñîõðàíåííûé ñïèñîê
for(int j=0;ptr->fileSend[j];j++) {
mir_free(ptr->fileSend[j]);
}
SAFE_FREE(ptr->fileSend);
}
- if( i ) { // ñêîïèðóåì íîâûé ñïèñîê
+ if ( i ) { // ñêîïèðóåì íîâûé ñïèñîê
ptr->fileSend = (char **) mir_alloc(sizeof(char*)*(i+1));
for(i=0;file[i];i++) {
ptr->fileSend[i] = mir_strdup(file[i]);
@@ -1042,35 +1042,35 @@ int __cdecl onProtoAck(WPARAM wParam,LPARAM lParam) {
pUinKey ptr = getUinKey(ack->hContact);
if (!ptr || (f && (f->flags & PFTS_SENDING) && !bSFT)) return 0;
- if( isContactSecured(ack->hContact)&SECURED ) {
+ if ( isContactSecured(ack->hContact)&SECURED ) {
switch(ack->result) {
// case ACKRESULT_FILERESUME:
case ACKRESULT_DATA: {
- if( !( f->flags & PFTS_SENDING )) {
+ if ( !( f->flags & PFTS_SENDING )) {
ptr->finFileRecv = (f->currentFileSize == f->currentFileProgress);
- if( !ptr->lastFileRecv ) ptr->lastFileRecv = mir_strdup(f->szCurrentFile);
+ if ( !ptr->lastFileRecv ) ptr->lastFileRecv = mir_strdup(f->szCurrentFile);
}
else
- if( f->flags & PFTS_SENDING ) {
+ if ( f->flags & PFTS_SENDING ) {
ptr->finFileSend = (f->currentFileSize == f->currentFileProgress);
- if( !ptr->lastFileSend ) ptr->lastFileSend = mir_strdup(f->szCurrentFile);
+ if ( !ptr->lastFileSend ) ptr->lastFileSend = mir_strdup(f->szCurrentFile);
}
} break;
// case ACKRESULT_INITIALISING:
case ACKRESULT_DENIED:
case ACKRESULT_FAILED: {
- if( ptr->lastFileRecv ) {
+ if ( ptr->lastFileRecv ) {
if (strstr(ptr->lastFileRecv,".AESHELL")) mir_unlink(ptr->lastFileRecv);
SAFE_FREE(ptr->lastFileRecv);
}
- if( ptr->lastFileSend ) {
+ if ( ptr->lastFileSend ) {
if (strstr(ptr->lastFileSend,".AESHELL")) mir_unlink(ptr->lastFileSend);
SAFE_FREE(ptr->lastFileSend);
}
- if( ptr->fileSend ) {
+ if ( ptr->fileSend ) {
char **file=ptr->fileSend;
for(int j=0;file[j];j++) {
- if( strstr(file[j],".AESHELL") ) mir_unlink(file[j]);
+ if ( strstr(file[j],".AESHELL") ) mir_unlink(file[j]);
mir_free(file[j]);
}
SAFE_FREE(ptr->fileSend);
@@ -1079,14 +1079,14 @@ int __cdecl onProtoAck(WPARAM wParam,LPARAM lParam) {
} break;
case ACKRESULT_NEXTFILE:
case ACKRESULT_SUCCESS: {
- if( ptr->finFileRecv && ptr->lastFileRecv ) {
- if( strstr(ptr->lastFileRecv,".AESHELL") ) {
+ if ( ptr->finFileRecv && ptr->lastFileRecv ) {
+ if ( strstr(ptr->lastFileRecv,".AESHELL") ) {
char buf[MAX_PATH];
LPSTR file_out=mir_strdup(ptr->lastFileRecv);
LPSTR pos=strrchr(file_out,'.'); //find last .
if (pos) *pos='\0'; //remove AESHELL from name
- if( isFileExist(file_out) ) {
+ if ( isFileExist(file_out) ) {
buf[0]='\0';
LPSTR p=strrchr(file_out,'.');
LPSTR x=strrchr(file_out,'\\');
@@ -1096,14 +1096,14 @@ int __cdecl onProtoAck(WPARAM wParam,LPARAM lParam) {
}
for(int i=1;i<10000;i++) {
sprintf(pos," (%d)%s",i,buf);
- if( !isFileExist(file_out) ) break;
+ if ( !isFileExist(file_out) ) break;
}
}
sprintf(buf,"%s\n%s",Translate(sim012),file_out);
showPopUp(buf,NULL,g_hPOP[POP_PU_MSR],2);
- if( ptr->mode==MODE_RSAAES ) {
+ if ( ptr->mode==MODE_RSAAES ) {
exp->rsa_decrypt_file(ptr->cntx,ptr->lastFileRecv,file_out);
}
else {
@@ -1115,8 +1115,8 @@ int __cdecl onProtoAck(WPARAM wParam,LPARAM lParam) {
SAFE_FREE(ptr->lastFileRecv);
ptr->finFileRecv = false;
}
- if( ptr->finFileSend && ptr->lastFileSend ) {
- if( strstr(ptr->lastFileSend,".AESHELL") ) mir_unlink(ptr->lastFileSend);
+ if ( ptr->finFileSend && ptr->lastFileSend ) {
+ if ( strstr(ptr->lastFileSend,".AESHELL") ) mir_unlink(ptr->lastFileSend);
SAFE_FREE(ptr->lastFileSend);
ptr->finFileSend = false;
}
diff --git a/plugins/SecureIM/svcs_rsa.cpp b/plugins/SecureIM/svcs_rsa.cpp
index d38de67455..e72221dc91 100644
--- a/plugins/SecureIM/svcs_rsa.cpp
+++ b/plugins/SecureIM/svcs_rsa.cpp
@@ -12,7 +12,7 @@ BOOL rsa_4096=0;
int __cdecl rsa_inject(HANDLE context, LPCSTR msg) {
- pUinKey ptr = getUinCtx(context); if(!ptr) return 0;
+ pUinKey ptr = getUinCtx(context); if (!ptr) return 0;
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_inject: '%s'", msg);
#endif
@@ -31,7 +31,7 @@ int __cdecl rsa_inject(HANDLE context, LPCSTR msg) {
int __cdecl rsa_check_pub(HANDLE context, PBYTE pub, int pubLen, PBYTE sig, int sigLen) {
int v=0, k=0;
- pUinKey ptr = getUinCtx(context); if(!ptr) return 0;
+ pUinKey ptr = getUinCtx(context); if (!ptr) return 0;
LPSTR cnm = (LPSTR) mir_alloc(NAMSIZE); getContactNameA(ptr->hContact,cnm);
LPSTR uin = (LPSTR) mir_alloc(KEYSIZE); getContactUinA(ptr->hContact,uin);
LPSTR msg = (LPSTR) mir_alloc(MSGSIZE);
@@ -42,15 +42,15 @@ int __cdecl rsa_check_pub(HANDLE context, PBYTE pub, int pubLen, PBYTE sig, int
#endif
DBVARIANT dbv;
dbv.type = DBVT_BLOB;
- if( DBGetContactSetting(ptr->hContact,szModuleName,"rsa_pub",&dbv) == 0 ) {
+ if ( DBGetContactSetting(ptr->hContact,szModuleName,"rsa_pub",&dbv) == 0 ) {
k = 1;
PBYTE buf = (PBYTE) alloca(sigLen); int len;
exp->rsa_get_hash((PBYTE)dbv.pbVal,dbv.cpbVal,(PBYTE)buf,&len);
sha_old = mir_strdup(to_hex(buf,len));
DBFreeVariant(&dbv);
}
- if( bAAK ) {
- if( k ) mir_snprintf(msg,MSGSIZE,Translate(sim523),cnm,uin,sha,sha_old);
+ if ( bAAK ) {
+ if ( k ) mir_snprintf(msg,MSGSIZE,Translate(sim523),cnm,uin,sha,sha_old);
else mir_snprintf(msg,MSGSIZE,Translate(sim521),cnm,uin,sha);
showPopUpKRmsg(ptr->hContact,msg);
HistoryLog(ptr->hContact,msg);
@@ -60,7 +60,7 @@ int __cdecl rsa_check_pub(HANDLE context, PBYTE pub, int pubLen, PBYTE sig, int
#endif
}
else {
- if( k ) mir_snprintf(msg,MSGSIZE,Translate(sim522),cnm,sha,sha_old);
+ if ( k ) mir_snprintf(msg,MSGSIZE,Translate(sim522),cnm,sha,sha_old);
else mir_snprintf(msg,MSGSIZE,Translate(sim520),cnm,sha);
v = (msgbox(0,msg,szModuleName,MB_YESNO|MB_ICONQUESTION)==IDYES);
#if defined(_DEBUG) || defined(NETLIB_LOG)
@@ -87,7 +87,7 @@ int __cdecl rsa_check_pub(HANDLE context, PBYTE pub, int pubLen, PBYTE sig, int
void __cdecl rsa_notify(HANDLE context, int state) {
- pUinKey ptr = getUinCtx(context); if(!ptr) return;
+ pUinKey ptr = getUinCtx(context); if (!ptr) return;
LPCSTR msg=NULL;
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("rsa_notify: 0x%x", state);
@@ -182,10 +182,10 @@ unsigned __stdcall sttGenerateRSA( LPVOID param ) {
// çàãðóæàåò ïàáëèê-êëþ÷ â RSA êîíòåêñò
BYTE loadRSAkey(pUinKey ptr) {
- if( !ptr->keyLoaded ) {
+ if ( !ptr->keyLoaded ) {
DBVARIANT dbv;
dbv.type = DBVT_BLOB;
- if( DBGetContactSetting(ptr->hContact,szModuleName,"rsa_pub",&dbv) == 0 ) {
+ if ( DBGetContactSetting(ptr->hContact,szModuleName,"rsa_pub",&dbv) == 0 ) {
ptr->keyLoaded = exp->rsa_set_pubkey(ptr->cntx,dbv.pbVal,dbv.cpbVal);
#if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("loadRSAkey %d", ptr->keyLoaded);
@@ -198,7 +198,7 @@ BYTE loadRSAkey(pUinKey ptr) {
// ñîçäàåò RSA êîíòåêñò
void createRSAcntx(pUinKey ptr) {
- if( !ptr->cntx ) {
+ if ( !ptr->cntx ) {
ptr->cntx = cpp_create_context(CPP_MODE_RSA);
ptr->keyLoaded = 0;
}
@@ -207,7 +207,7 @@ void createRSAcntx(pUinKey ptr) {
// ïåðåñîçäàåò RSA êîíòåêñò
void resetRSAcntx(pUinKey ptr) {
- if( ptr->cntx ) {
+ if ( ptr->cntx ) {
cpp_delete_context(ptr->cntx);
ptr->cntx = cpp_create_context(CPP_MODE_RSA);
ptr->keyLoaded = 0;
diff --git a/plugins/SecureIM/svcs_srmm.cpp b/plugins/SecureIM/svcs_srmm.cpp
index c187ff7b56..ea7b8be780 100644
--- a/plugins/SecureIM/svcs_srmm.cpp
+++ b/plugins/SecureIM/svcs_srmm.cpp
@@ -13,11 +13,11 @@ int __cdecl onWindowEvent(WPARAM wParam, LPARAM lParam) {
int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam) {
HANDLE hContact = (HANDLE)wParam;
- if( isProtoMetaContacts(hContact) )
+ if ( isProtoMetaContacts(hContact) )
hContact = getMostOnline(hContact); // âîçüìåì òîò, ÷åðåç êîòîðûé ïîéäåò ñîîáùåíèå
StatusIconClickData *sicd = (StatusIconClickData *)lParam;
- if( strcmp(sicd->szModule, szModuleName) != 0 ||
+ if ( strcmp(sicd->szModule, szModuleName) != 0 ||
!isSecureProtocol(hContact) ) return 0; // not our event
BOOL isPGP = isContactPGP(hContact);
@@ -25,7 +25,7 @@ int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam) {
BOOL isSecured = isContactSecured(hContact)&SECURED;
BOOL isChat = isChatRoom(hContact);
- if( !isPGP && !isGPG && !isChat ) {
+ if ( !isPGP && !isGPG && !isChat ) {
if(isSecured) Service_DisableIM(wParam,0);
else Service_CreateIM(wParam,0);
}
diff --git a/plugins/SeenPlugin/file.c b/plugins/SeenPlugin/file.c
index 97cd2d9c3f..cac37f8c30 100644
--- a/plugins/SeenPlugin/file.c
+++ b/plugins/SeenPlugin/file.c
@@ -56,9 +56,9 @@ int InitFileOutput(void)
*++str=0;
/*
//we dont need this anylonger. the directory is created in filewrite
- if(!CreateDirectory(szmpath,NULL))
+ if (!CreateDirectory(szmpath,NULL))
{
- if(!(GetFileAttributes(szmpath) & FILE_ATTRIBUTE_DIRECTORY))
+ if (!(GetFileAttributes(szmpath) & FILE_ATTRIBUTE_DIRECTORY))
{
MessageBox(NULL,"Directory could not be created\nPlease choose another!","Last seen plugin",MB_OK|MB_ICONERROR);
DBWriteContactSettingByte(NULL,S_MOD,"FileOutput",0);
@@ -78,7 +78,7 @@ static void CreateDirectoryTree(char *szDir)
char *pszLastBackslash,szTestDir[MAX_PATH];
lstrcpynA(szTestDir,szDir,sizeof(szTestDir));
- if((dwAttributes=GetFileAttributesA(szTestDir))!=0xffffffff && dwAttributes&FILE_ATTRIBUTE_DIRECTORY) return;
+ if ((dwAttributes=GetFileAttributesA(szTestDir))!=0xffffffff && dwAttributes&FILE_ATTRIBUTE_DIRECTORY) return;
pszLastBackslash=strrchr(szTestDir,'\\');
if(pszLastBackslash==NULL) return;
*pszLastBackslash='\0';
diff --git a/plugins/SeenPlugin/main.c b/plugins/SeenPlugin/main.c
index 6e60405058..798077b009 100644
--- a/plugins/SeenPlugin/main.c
+++ b/plugins/SeenPlugin/main.c
@@ -117,9 +117,9 @@ int MainInit(WPARAM wparam,LPARAM lparam)
#ifndef PERMITNSN
SkinAddNewSoundEx("UserOnline",Translate("Alerts"),Translate("Online"));
#endif
- if (ServiceExists(MS_TIPPER_ADDTRANSLATION)){
+ if (ServiceExists(MS_TIPPER_ADDTRANSLATION)) {
int i=0;
- for (i=0;i<TRANSNUMBER;i++){
+ for (i=0;i<TRANSNUMBER;i++) {
CallService(MS_TIPPER_ADDTRANSLATION,0,(LPARAM)&idleTr[i]);
}
}
diff --git a/plugins/SeenPlugin/menu.c b/plugins/SeenPlugin/menu.c
index e6b972fec4..c6a5ca8884 100644
--- a/plugins/SeenPlugin/menu.c
+++ b/plugins/SeenPlugin/menu.c
@@ -51,7 +51,7 @@ int BuildContactMenu(WPARAM wparam,LPARAM lparam)
ZeroMemory(&cmi,sizeof(cmi));
cmi.cbSize=sizeof(cmi);
- if(!IsWatchedProtocol(szProto) || !DBGetContactSettingByte(NULL,S_MOD,"MenuItem",1))
+ if (!IsWatchedProtocol(szProto) || !DBGetContactSettingByte(NULL,S_MOD,"MenuItem",1))
{
cmi.flags=CMIM_FLAGS|CMIF_HIDDEN;
}
@@ -61,7 +61,7 @@ int BuildContactMenu(WPARAM wparam,LPARAM lparam)
cmi.hIcon=NULL;
cmi.pszName=ParseString(!DBGetContactSetting(NULL,S_MOD,"MenuStamp",&dbv)?dbv.pszVal:DEFAULT_MENUSTAMP,(HANDLE)wparam,0);
- if(!strcmp(cmi.pszName,Translate("<unknown>")))
+ if (!strcmp(cmi.pszName,Translate("<unknown>")))
{
if (IsWatchedProtocol(szProto))
cmi.flags|=CMIF_GRAYED;
diff --git a/plugins/SeenPlugin/missed.c b/plugins/SeenPlugin/missed.c
index f6ed40035c..179dd8ee4d 100644
--- a/plugins/SeenPlugin/missed.c
+++ b/plugins/SeenPlugin/missed.c
@@ -38,7 +38,7 @@ WPARAM IsUserMissed(WPARAM contact)
{
int loop=0;
- for(;loop<mcs.count;loop++)
+ for (;loop<mcs.count;loop++)
{
if(mcs.wpcontact[loop]==contact)
return MAKEWPARAM(1,loop);
@@ -155,9 +155,9 @@ int ShowMissed(void)
int loop=0;
char sztemp[1024]="",szcount[7];
- if(!mcs.count) return 0;
+ if (!mcs.count) return 0;
- for(;loop<mcs.count;loop++)
+ for (;loop<mcs.count;loop++)
{
strcat(sztemp,(const char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,mcs.wpcontact[loop],0));
if(DBGetContactSettingByte(NULL,S_MOD,"MissedOnes_Count",0))
@@ -233,7 +233,7 @@ int Test(WPARAM wparam,LPARAM lparam)
{
WORD missed=IsUserMissed(wparam);
- if(!LOWORD(missed))
+ if (!LOWORD(missed))
{
mcs.times[mcs.count]=1;
mcs.wpcontact[mcs.count++]=wparam;
diff --git a/plugins/SeenPlugin/options.c b/plugins/SeenPlugin/options.c
index cf5ab019ba..af1b2fcac1 100644
--- a/plugins/SeenPlugin/options.c
+++ b/plugins/SeenPlugin/options.c
@@ -62,7 +62,7 @@ INT_PTR CALLBACK OptsPopUpsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara
hasPopups = IsDlgButtonChecked(hdlg,IDC_POPUPS);
EnableWindow(GetDlgItem(hdlg,IDC_POPUPSTAMP),hasPopups);
EnableWindow(GetDlgItem(hdlg,IDC_POPUPSTAMPTEXT),hasPopups);
- for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++){
+ for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++) {
DWORD sett;
COLORREF back, text;
sprintf(szstamp, "Col_%d",i-ID_STATUS_OFFLINE);
@@ -86,7 +86,7 @@ INT_PTR CALLBACK OptsPopUpsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara
}
break; //case WM_INITDIALOG
case WM_COMMAND:
- if((HIWORD(wparam)==BN_CLICKED || HIWORD(wparam)==EN_CHANGE) && GetFocus()==(HWND)lparam)
+ if ((HIWORD(wparam)==BN_CLICKED || HIWORD(wparam)==EN_CHANGE) && GetFocus()==(HWND)lparam)
SendMessage(GetParent(hdlg),PSM_CHANGED,0,0);
else if (HIWORD(wparam)==CPN_COLOURCHANGED){
WORD idText, idBack;
@@ -113,18 +113,18 @@ INT_PTR CALLBACK OptsPopUpsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara
}
if(HIWORD(wparam)==BN_CLICKED)
{
- switch(LOWORD(wparam)){
+ switch(LOWORD(wparam)) {
case IDC_POPUPS:
hasPopups = IsDlgButtonChecked(hdlg,IDC_POPUPS);
EnableWindow(GetDlgItem(hdlg,IDC_POPUPSTAMP),hasPopups);
EnableWindow(GetDlgItem(hdlg,IDC_POPUPSTAMPTEXT),hasPopups);
- for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++){
+ for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++) {
EnableWindow(GetDlgItem(hdlg,i),hasPopups);
EnableWindow(GetDlgItem(hdlg,i+20),hasPopups);
}
break;
case IDC_DEFAULTCOL:
- for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++){
+ for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++) {
DWORD sett;
COLORREF back, text;
sprintf(szstamp, "Col_%d",i-ID_STATUS_OFFLINE);
@@ -156,7 +156,7 @@ INT_PTR CALLBACK OptsPopUpsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara
if (DBGetContactSettingByte(NULL,S_MOD,"UsePopups",0) != checkValue) {
DBWriteContactSettingByte(NULL,S_MOD,"UsePopups",checkValue);
}
- for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++){
+ for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++) {
DWORD sett;
COLORREF back=0, text=0;
sprintf(szstamp, "Col_%d",i-ID_STATUS_OFFLINE);
@@ -262,12 +262,12 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpa
break; //case WM_INITDIALOG
case WM_COMMAND:
- if((HIWORD(wparam)==BN_CLICKED || HIWORD(wparam)==EN_CHANGE) && GetFocus()==(HWND)lparam)
+ if ((HIWORD(wparam)==BN_CLICKED || HIWORD(wparam)==EN_CHANGE) && GetFocus()==(HWND)lparam)
if (LOWORD(wparam)!=IDC_VARIABLES)SendMessage(GetParent(hdlg),PSM_CHANGED,0,0);
if(HIWORD(wparam)==BN_CLICKED)
{
- switch(LOWORD(wparam)){
+ switch(LOWORD(wparam)) {
case IDC_MENUITEM:
EnableWindow(GetDlgItem(hdlg,IDC_MENUSTAMP),IsDlgButtonChecked(hdlg,IDC_MENUITEM));
EnableWindow(GetDlgItem(hdlg,IDC_SHOWICON),IsDlgButtonChecked(hdlg,IDC_MENUITEM));
diff --git a/plugins/SeenPlugin/userinfo.c b/plugins/SeenPlugin/userinfo.c
index 02f050ea0f..bf23679ba9 100644
--- a/plugins/SeenPlugin/userinfo.c
+++ b/plugins/SeenPlugin/userinfo.c
@@ -61,7 +61,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
MainProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hdlg,IDC_INFOTEXT),GWLP_WNDPROC,(LONG)EditProc);
szout=strdup(ParseString((!DBGetContactSetting(NULL,S_MOD,"UserStamp",&dbv)?dbv.pszVal:DEFAULT_USERSTAMP),(HANDLE)lparam,0));
SetDlgItemText(hdlg,IDC_INFOTEXT,szout);
- if(!strcmp(szout,Translate("<unknown>")))
+ if (!strcmp(szout,Translate("<unknown>")))
EnableWindow(GetDlgItem(hdlg,IDC_INFOTEXT),FALSE);
free(szout);
DBFreeVariant(&dbv);
@@ -81,7 +81,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
int UserinfoInit(WPARAM wparam,LPARAM lparam)
{
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,lparam,0);
- if (IsWatchedProtocol(proto)){
+ if (IsWatchedProtocol(proto)) {
OPTIONSDIALOGPAGE uip;
ZeroMemory(&uip,sizeof(uip));
uip.cbSize=sizeof(uip);
diff --git a/plugins/SeenPlugin/utils.c b/plugins/SeenPlugin/utils.c
index 5fc880ec75..a7300f873b 100644
--- a/plugins/SeenPlugin/utils.c
+++ b/plugins/SeenPlugin/utils.c
@@ -142,7 +142,7 @@ DWORD isSeen(HANDLE hcontact, SYSTEMTIME *st){
lst.wHour = DBGetContactSettingWord(hcontact,S_MOD,"Hours",0);
lst.wMinute = DBGetContactSettingWord(hcontact,S_MOD,"Minutes",0);
lst.wSecond = DBGetContactSettingWord(hcontact,S_MOD,"Seconds",0);
- if (SystemTimeToFileTime(&lst,&ft)){
+ if (SystemTimeToFileTime(&lst,&ft)) {
ll = ((LONGLONG)ft.dwHighDateTime<<32)|((LONGLONG)ft.dwLowDateTime);
ll -= NUM100NANOSEC;
ll /= 10000000;
@@ -177,7 +177,7 @@ char *ParseString(char *szstring,HANDLE hcontact,BYTE isfile)
SYSTEMTIME st;
sztemp[0] = '\0';
- if (!isSeen(hcontact,&st)){
+ if (!isSeen(hcontact,&st)) {
strcat(sztemp,Translate("<never seen>"));
return sztemp;
}
@@ -185,10 +185,10 @@ char *ParseString(char *szstring,HANDLE hcontact,BYTE isfile)
ci.cbSize=sizeof(CONTACTINFO);
ci.hContact=hcontact;
ci.szProto=hcontact?(char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hcontact,0):courProtoName;
- for(;loop<strlen(szstring);loop++)
+ for (;loop<strlen(szstring);loop++)
{
if (sztemplen == MAXSIZE) break;
- if((szstring[loop]!='%')&(szstring[loop]!='#'))
+ if ((szstring[loop]!='%')&(szstring[loop]!='#'))
{
strncat(sztemp,szstring+loop,1);
sztemplen++;
@@ -198,7 +198,7 @@ char *ParseString(char *szstring,HANDLE hcontact,BYTE isfile)
else
{
wantempty = (szstring[loop]=='#');
- switch(szstring[++loop]){
+ switch(szstring[++loop]) {
case 'Y':
if (!st.wYear) goto LBL_noData;
sztemplen += mir_snprintf(sztemp+sztemplen,MAXSIZE-sztemplen,"%04i",st.wYear);
@@ -239,36 +239,36 @@ LBL_charPtr:
goto LBL_charPtr;
case 'E':
- if(!(isetting=st.wMonth))goto LBL_noData;
+ if (!(isetting=st.wMonth))goto LBL_noData;
charPtr = Translate(monthnames[isetting-1]);
goto LBL_charPtr;
case 'e':
- if(!(isetting=st.wMonth))goto LBL_noData;
+ if (!(isetting=st.wMonth))goto LBL_noData;
charPtr = Translate(mnames_short[isetting-1]);
goto LBL_charPtr;
case 'H':
- if((isetting=st.wHour)==-1)goto LBL_noData;
+ if ((isetting=st.wHour)==-1)goto LBL_noData;
goto LBL_2DigNum;
case 'h':
- if((isetting=st.wHour)==-1)goto LBL_noData;
- if(!isetting) isetting=12;
+ if ((isetting=st.wHour)==-1)goto LBL_noData;
+ if (!isetting) isetting=12;
isetting = isetting-((isetting>12)?12:0);
goto LBL_2DigNum;
case 'p':
- if((isetting=st.wHour)==-1)goto LBL_noData;
+ if ((isetting=st.wHour)==-1)goto LBL_noData;
charPtr = (isetting>=12)?"PM":"AM";
goto LBL_charPtr;
case 'M':
- if((isetting=st.wMinute)==-1)goto LBL_noData;
+ if ((isetting=st.wMinute)==-1)goto LBL_noData;
goto LBL_2DigNum;
case 'S':
- if((isetting=st.wHour)==-1)goto LBL_noData;
+ if ((isetting=st.wHour)==-1)goto LBL_noData;
goto LBL_2DigNum;
case 'n':
@@ -276,14 +276,14 @@ LBL_charPtr:
goto LBL_charPtr;
case 'N':
ci.dwFlag=CNF_NICK;
- if(!CallService(MS_CONTACT_GETCONTACTINFO,(WPARAM)0,(LPARAM)&ci)){
+ if (!CallService(MS_CONTACT_GETCONTACTINFO,(WPARAM)0,(LPARAM)&ci)) {
charPtr = ci.pszVal;
} else goto LBL_noData;
goto LBL_charPtr;
case 'G':
{
DBVARIANT dbv;
- if (!DBGetContactSetting(hcontact,"CList","Group",&dbv)){
+ if (!DBGetContactSetting(hcontact,"CList","Group",&dbv)) {
strcpy(szdbsetting,dbv.pszVal);
DBFreeVariant(&dbv);
charPtr = szdbsetting;
@@ -294,7 +294,7 @@ LBL_charPtr:
case 'u':
ci.dwFlag=CNF_UNIQUEID;
- if(!CallService(MS_CONTACT_GETCONTACTINFO,(WPARAM)0,(LPARAM)&ci))
+ if (!CallService(MS_CONTACT_GETCONTACTINFO,(WPARAM)0,(LPARAM)&ci))
{
switch(ci.type)
{
@@ -339,9 +339,9 @@ LBL_charPtr:
goto LBL_charPtr;
case 's':
- if (isetting=DBGetContactSettingWord(hcontact,S_MOD,hcontact?"StatusTriger":courProtoName,0)){
+ if (isetting=DBGetContactSettingWord(hcontact,S_MOD,hcontact?"StatusTriger":courProtoName,0)) {
strcpy(szdbsetting,Translate((const char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)(isetting|0x8000),0)));
- if (!(isetting&0x8000)){
+ if (!(isetting&0x8000)) {
strcat(szdbsetting,"/");
strcat(szdbsetting,Translate("Idle"));
}
@@ -351,16 +351,16 @@ LBL_charPtr:
case 'T':
{
DBVARIANT dbv;
- if (!DBGetContactSetting(hcontact,"CList","StatusMsg",&dbv)){
+ if (!DBGetContactSetting(hcontact,"CList","StatusMsg",&dbv)) {
sztemplen += mir_snprintf(sztemp+sztemplen,MAXSIZE-sztemplen,"%s",dbv.pszVal);
DBFreeVariant(&dbv);
} else goto LBL_noData;
}
break;
case 'o':
- if (isetting=DBGetContactSettingWord(hcontact,S_MOD,hcontact?"OldStatus":courProtoName,0)){
+ if (isetting=DBGetContactSettingWord(hcontact,S_MOD,hcontact?"OldStatus":courProtoName,0)) {
strcpy(szdbsetting,Translate((const char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)isetting,0)));
- if (includeIdle) if (hcontact) if (DBGetContactSettingByte(hcontact,S_MOD,"OldIdle",0)){
+ if (includeIdle) if (hcontact) if (DBGetContactSettingByte(hcontact,S_MOD,"OldIdle",0)) {
strcat(szdbsetting,"/");
strcat(szdbsetting,Translate("Idle"));
}
@@ -369,9 +369,9 @@ LBL_charPtr:
goto LBL_charPtr;
case 'i':
- case 'r': if (isJabber(ci.szProto)){
+ case 'r': if (isJabber(ci.szProto)) {
DBVARIANT dbv;
- if (!DBGetContactSetting(hcontact,ci.szProto,szstring[loop]=='i'?"Resource":"System",&dbv)){
+ if (!DBGetContactSetting(hcontact,ci.szProto,szstring[loop]=='i'?"Resource":"System",&dbv)) {
strcpy(szdbsetting,dbv.pszVal);
DBFreeVariant(&dbv);
charPtr = szdbsetting;
@@ -410,7 +410,7 @@ LBL_charPtr:
} else strcpy(szdbsetting,"Miranda");
} else {
DBVARIANT dbv;
- if (!DBGetContactSetting(hcontact,ci.szProto,"MirVer",&dbv)){
+ if (!DBGetContactSetting(hcontact,ci.szProto,"MirVer",&dbv)) {
strcpy(szdbsetting,dbv.pszVal);
DBFreeVariant(&dbv);
} else goto LBL_noData;
@@ -514,9 +514,9 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
void ShowPopup(HANDLE hcontact, const char * lpzProto, int newStatus){
if(CallService(MS_IGNORE_ISIGNORED,(WPARAM)hcontact,IGNOREEVENT_USERONLINE)) return;
- if (ServiceExists(MS_POPUP_QUERY)){
- if (DBGetContactSettingByte(NULL,S_MOD,"UsePopups",0)){
- if (!DBGetContactSettingByte(hcontact,"CList","Hidden",0)){
+ if (ServiceExists(MS_POPUP_QUERY)) {
+ if (DBGetContactSettingByte(NULL,S_MOD,"UsePopups",0)) {
+ if (!DBGetContactSettingByte(hcontact,"CList","Hidden",0)) {
POPUPDATAEX ppd = {0};
DBVARIANT dbv = {0};
char szstamp[10];
@@ -540,15 +540,15 @@ void ShowPopup(HANDLE hcontact, const char * lpzProto, int newStatus){
void myPlaySound(HANDLE hcontact, WORD newStatus, WORD oldStatus){
if(CallService(MS_IGNORE_ISIGNORED,(WPARAM)hcontact,IGNOREEVENT_USERONLINE)) return;
//oldStatus and hcontact are not used yet
- if (DBGetContactSettingByte(NULL,"Skin","UseSound",1)){
+ if (DBGetContactSettingByte(NULL,"Skin","UseSound",1)) {
char * soundname=0;
if ((newStatus==ID_STATUS_ONLINE) || (newStatus==ID_STATUS_FREECHAT)) soundname = "LastSeenTrackedStatusOnline";
else if (newStatus==ID_STATUS_OFFLINE) soundname = "LastSeenTrackedStatusOffline";
else if (oldStatus==ID_STATUS_OFFLINE) soundname = "LastSeenTrackedStatusFromOffline";
else soundname = "LastSeenTrackedStatusChange";
- if (!DBGetContactSettingByte(NULL,"SkinSoundsOff",soundname,0)){
+ if (!DBGetContactSettingByte(NULL,"SkinSoundsOff",soundname,0)) {
DBVARIANT dbv;
- if (!DBGetContactSetting(NULL,"SkinSounds",soundname,&dbv)){
+ if (!DBGetContactSetting(NULL,"SkinSounds",soundname,&dbv)) {
PlaySoundA(dbv.pszVal, NULL, SND_ASYNC | SND_FILENAME | SND_NOWAIT);
DBFreeVariant(&dbv);
} } } }
@@ -560,7 +560,7 @@ int isContactQueueActive(HANDLE hContact){
// MessageBox(0,"Is myself in the queue: never","LastSeen-Mod",0);
return 0;
}
- for (i=1;i<contactQueueSize;i++){
+ for (i=1;i<contactQueueSize;i++) {
if (contactQueue[i])
if (contactQueue[i]->hContact==hContact) return i;
}
@@ -574,7 +574,7 @@ int addContactToQueue(HANDLE hContact){
// MessageBox(0,"Adding myself to queue","LastSeen-Mod",0);
return 0;
}
- for (i=1;i<contactQueueSize;i++){
+ for (i=1;i<contactQueueSize;i++) {
if (!contactQueue[i]) {
contactQueue[i] = malloc(sizeof(logthread_info));
contactQueue[i]->queueIndex = i;
@@ -645,14 +645,14 @@ int UpdateValues(HANDLE hContact,LPARAM lparam)
//if(CallService(MS_IGNORE_ISIGNORED,(WPARAM)hContact,IGNOREEVENT_USERONLINE)) return 0;
isIdleEvent = includeIdle?(strcmp(cws->szSetting,"IdleTS")==0):0;
if (strcmp(cws->szSetting,"Status") && strcmp(cws->szSetting,"StatusTriger") && (isIdleEvent==0)) return 0;
- if (!strcmp(cws->szModule,S_MOD)){
+ if (!strcmp(cws->szModule,S_MOD)) {
//here we will come when Settings/SeenModule/StatusTriger is changed
WORD prevStatus=DBGetContactSettingWord(hContact,S_MOD,"OldStatus",ID_STATUS_OFFLINE);
if (includeIdle){
if (DBGetContactSettingByte(hContact,S_MOD,"OldIdle",0)) prevStatus &= 0x7FFF;
else prevStatus |= 0x8000;
}
- if((cws->value.wVal|0x8000)<=ID_STATUS_OFFLINE)
+ if ((cws->value.wVal|0x8000)<=ID_STATUS_OFFLINE)
{
char * proto;
// avoid repeating the offline status
@@ -670,7 +670,7 @@ int UpdateValues(HANDLE hContact,LPARAM lparam)
DBWriteTimeTS(t,hContact);
}
- if(!DBGetContactSettingByte(NULL,S_MOD,"IgnoreOffline",1))
+ if (!DBGetContactSettingByte(NULL,S_MOD,"IgnoreOffline",1))
{
char * sProto;
if(DBGetContactSettingByte(NULL,S_MOD,"FileOutput",0))
@@ -681,7 +681,7 @@ int UpdateValues(HANDLE hContact,LPARAM lparam)
PS_GETSTATUS,0,0
)>ID_STATUS_OFFLINE) {
myPlaySound(hContact,ID_STATUS_OFFLINE,prevStatus);
- if(DBGetContactSettingByte(NULL,S_MOD,"UsePopups",0)){
+ if(DBGetContactSettingByte(NULL,S_MOD,"UsePopups",0)) {
ShowPopup(hContact,sProto,ID_STATUS_OFFLINE);
} }
@@ -710,11 +710,11 @@ int UpdateValues(HANDLE hContact,LPARAM lparam)
if(DBGetContactSettingByte(hContact,S_MOD,"OnlineAlert",0)) ShowHistory(hContact, 1);
DBWriteContactSettingByte(hContact,S_MOD,"Offline",0);
}
- } else if (IsWatchedProtocol(cws->szModule)){
+ } else if (IsWatchedProtocol(cws->szModule)) {
//here we will come when <User>/<module>/Status is changed or it is idle event and if <module> is watched
if (CallProtoService(cws->szModule,PS_GETSTATUS,0,0)>ID_STATUS_OFFLINE){
int index;
- if (!(index = isContactQueueActive(hContact))){
+ if (!(index = isContactQueueActive(hContact))) {
index = addContactToQueue(hContact);
strncpy(contactQueue[index]->sProtoName,cws->szModule,MAXMODULELABELLENGTH);
//forkthreadex(NULL, 0, waitThread, contactQueue[index], 0, 0);
@@ -738,7 +738,7 @@ int UpdateValues(HANDLE hContact,LPARAM lparam)
oldStatus=DBGetContactSettingWord(hContact,"UserOnline","OldStatus",ID_STATUS_OFFLINE);
DBWriteContactSettingWord(hContact,"UserOnline","OldStatus",(WORD)newStatus);
if(DBGetContactSettingByte(hContact,"CList","Hidden",0)) return 0;
- if((newStatus==ID_STATUS_ONLINE || newStatus==ID_STATUS_FREECHAT) &&
+ if ((newStatus==ID_STATUS_ONLINE || newStatus==ID_STATUS_FREECHAT) &&
oldStatus!=ID_STATUS_ONLINE && oldStatus!=ID_STATUS_FREECHAT) {
BYTE supp = db_byte_get(NULL, S_MOD, "SuppCListOnline", 3); //By default no online allert :P
BOOL willAlert = FALSE;
@@ -793,7 +793,7 @@ static DWORD __stdcall cleanThread(logthread_info* infoParam)
{
char * contactProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hcontact,0);
if (contactProto) {
- if (!strncmp(infoParam->sProtoName,contactProto,MAXMODULELABELLENGTH)){
+ if (!strncmp(infoParam->sProtoName,contactProto,MAXMODULELABELLENGTH)) {
WORD oldStatus;
if ( (oldStatus = (DBGetContactSettingWord(hcontact,S_MOD,"StatusTriger",ID_STATUS_OFFLINE))|0x8000)>ID_STATUS_OFFLINE){
if (DBGetContactSettingWord(hcontact,contactProto,"Status",ID_STATUS_OFFLINE)==ID_STATUS_OFFLINE){
@@ -846,10 +846,10 @@ int ModeChange(WPARAM wparam,LPARAM lparam)
// isetting=CallProtoService(ack->szModule,PS_GETSTATUS,0,0);
isetting=(WORD)ack->lParam;
if (isetting<ID_STATUS_OFFLINE) isetting = ID_STATUS_OFFLINE;
- if ((isetting>ID_STATUS_OFFLINE)&&((WORD)ack->hProcess<=ID_STATUS_OFFLINE)){
+ if ((isetting>ID_STATUS_OFFLINE)&&((WORD)ack->hProcess<=ID_STATUS_OFFLINE)) {
//we have just loged-in
db_dword_set(NULL, "UserOnline", ack->szModule, GetTickCount());
- if (IsWatchedProtocol(ack->szModule)){
+ if (IsWatchedProtocol(ack->szModule)) {
logthread_info *info;
info = (logthread_info *)malloc(sizeof(logthread_info));
strncpy(info->sProtoName,courProtoName,MAXMODULELABELLENGTH);
@@ -863,9 +863,9 @@ int ModeChange(WPARAM wparam,LPARAM lparam)
CallService(MS_SYSTEM_FORK_THREAD_EX, 0, (LPARAM)&params);
}
- } else if ((isetting==ID_STATUS_OFFLINE)&&((WORD)ack->hProcess>ID_STATUS_OFFLINE)){
+ } else if ((isetting==ID_STATUS_OFFLINE)&&((WORD)ack->hProcess>ID_STATUS_OFFLINE)) {
//we have just loged-off
- if (IsWatchedProtocol(ack->szModule)){
+ if (IsWatchedProtocol(ack->szModule)) {
char *str = malloc(MAXMODULELABELLENGTH+9);
time_t t;
time(&t);
@@ -890,7 +890,7 @@ int ModeChange(WPARAM wparam,LPARAM lparam)
short int isDbZero(HANDLE hContact, const char *module_name, const char *setting_name){
DBVARIANT dbv;
- if(!DBGetContactSetting(hContact, module_name, setting_name, &dbv)) {
+ if (!DBGetContactSetting(hContact, module_name, setting_name, &dbv)) {
short int res = 0;
switch (dbv.type) {
case DBVT_BYTE: res=dbv.bVal==0; break;
@@ -932,7 +932,7 @@ WCHAR *any_to_Idle(HANDLE hContact, const char *module_name, const char *setting
ack=(ACKDATA *)lparam;
if(ack->type!=ACKTYPE_GETINFO || ack->hContact==NULL) return 0;
- if(((int)ack->hProcess-1)!=(int)ack->lParam) return 0;
+ if (((int)ack->hProcess-1)!=(int)ack->lParam) return 0;
dwsetting=DBGetContactSettingDword(ack->hContact,ack->szModule,"IP",0);
if(dwsetting)
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index 47ec1b98bb..4f0e230704 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -252,7 +252,7 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar
DestroyWindow(hdlg);
g_hSDlg=0;
}
- else if(!SaveUserSessionName(szUserSessionName))
+ else if (!SaveUserSessionName(szUserSessionName))
{
SaveSessionHandles(0,1);
@@ -297,7 +297,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar
{
ses_count=0;
TranslateDialogDefault(hdlg);
- if((ses_count=LoadSessionToCombobox(hdlg,0,ses_limit,"SessionDate",0))==ses_limit)
+ if ((ses_count=LoadSessionToCombobox(hdlg,0,ses_limit,"SessionDate",0))==ses_limit)
EnableWindow(GetDlgItem(hdlg,IDC_SESSDEL),TRUE);
if(LoadSessionToCombobox(hdlg,0,255,"UserSessionDsc",ses_limit)==0 && ses_count!=0)
@@ -371,7 +371,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar
EnableWindow(GetDlgItem(hdlg,IDC_SESSDEL),FALSE);
SendDlgItemMessage(hdlg, IDC_LIST, CB_RESETCONTENT, 0, 0);
- if((ses_count=LoadSessionToCombobox(hdlg,1,ses_limit,"SessionDate",0))==ses_limit)
+ if ((ses_count=LoadSessionToCombobox(hdlg,1,ses_limit,"SessionDate",0))==ses_limit)
EnableWindow(GetDlgItem(hdlg,IDC_SESSDEL),TRUE);
if(LoadSessionToCombobox(hdlg,1,255,"UserSessionDsc",ses_limit)==0 && ses_count!=0)
@@ -387,7 +387,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar
EnableWindow(GetDlgItem(hdlg,IDC_SESSDEL),FALSE);
SendDlgItemMessage(hdlg, IDC_LIST, CB_RESETCONTENT, 0, 0);
- if((ses_count=LoadSessionToCombobox(hdlg,0,ses_limit,"SessionDate",0))==ses_limit)
+ if ((ses_count=LoadSessionToCombobox(hdlg,0,ses_limit,"SessionDate",0))==ses_limit)
EnableWindow(GetDlgItem(hdlg,IDC_SESSDEL),TRUE);
if(LoadSessionToCombobox(hdlg,0,255,"UserSessionDsc",ses_limit)==0 && ses_count!=0)
@@ -402,7 +402,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar
DeleteAutoSession(ses_count);
EnableWindow(GetDlgItem(hdlg,IDC_SESSDEL),FALSE);
SendDlgItemMessage(hdlg, IDC_LIST, CB_RESETCONTENT, 0, 0);
- if((ses_count=LoadSessionToCombobox(hdlg,0,ses_limit,"SessionDate",0))==ses_limit)
+ if ((ses_count=LoadSessionToCombobox(hdlg,0,ses_limit,"SessionDate",0))==ses_limit)
EnableWindow(GetDlgItem(hdlg,IDC_SESSDEL),TRUE);
if(LoadSessionToCombobox(hdlg,0,255,"UserSessionDsc",ses_limit)==0 && ses_count!=0)
@@ -420,7 +420,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar
case IDOK:
{
- if(!LoadSession(0,ses_count))
+ if (!LoadSession(0,ses_count))
{
SavePosition(hdlg, "LoadDlg");
DestroyWindow(hdlg);
@@ -586,7 +586,7 @@ int SaveUserSessionName(TCHAR *szUSessionName)
{
szUserSessionName = mir_tstrdup(szUSessionName);
mir_snprintf(szUserSessionNameBuf, SIZEOF(szUserSessionNameBuf), "%s_%u", "UserSessionDsc", 0);
- if(!DBGetContactSettingTString(NULL, __INTERNAL_NAME, szUserSessionNameBuf, &dbv))
+ if (!DBGetContactSettingTString(NULL, __INTERNAL_NAME, szUserSessionNameBuf, &dbv))
{
szUserSessionNameBuf_1 = mir_tstrdup(dbv.ptszVal);
DBFreeVariant(&dbv);
@@ -646,7 +646,7 @@ int LoadSession(WPARAM wparam,LPARAM lparam)
CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)session_list_t[i], 0);
else if(g_bWarnOnHidden)
{
- if(!CheckContactVisibility((HANDLE)session_list_t[i]))
+ if (!CheckContactVisibility((HANDLE)session_list_t[i]))
{
hidden[j]=i+1;
j++;
@@ -664,13 +664,13 @@ int LoadSession(WPARAM wparam,LPARAM lparam)
}
else if(dup==i)
{
- if(!hidden)
+ if (!hidden)
{
if(g_bOtherWarnings)
MessageBox(NULL, TranslateT("This Session already opened"), TranslateT("Sessions Manager"), MB_OK|MB_ICONWARNING);
return 1;
}
- else if(!g_bWarnOnHidden&&g_bOtherWarnings)
+ else if (!g_bWarnOnHidden&&g_bOtherWarnings)
{
MessageBox(NULL, TranslateT("This Session already opened"), TranslateT("Sessions Manager"), MB_OK|MB_ICONWARNING);
return 1;
@@ -847,7 +847,7 @@ static int GetContactHandle(WPARAM wparam,LPARAM lParam)
}
else if(MWeventdata->uType == MSG_WINDOW_EVT_CLOSE)
{
- if(!DONT) DelFromCurSession((DWORD)MWeventdata->hContact,0);
+ if (!DONT) DelFromCurSession((DWORD)MWeventdata->hContact,0);
if(g_bCrashRecovery) DBWriteContactSettingByte(MWeventdata->hContact, __INTERNAL_NAME, "wasInLastSession", 0);
}
@@ -906,7 +906,7 @@ static int PluginInit(WPARAM wparam,LPARAM lparam)
session_list_recovered[i++]=(DWORD)hContact;
}
}
- if(!session_list_recovered[0]) g_bIncompletedSave=FALSE;
+ if (!session_list_recovered[0]) g_bIncompletedSave=FALSE;
DBWriteContactSettingByte(NULL, __INTERNAL_NAME, "lastSaveCompleted", 0);
if (!DBGetContactSettingByte(NULL, __INTERNAL_NAME, "lastempty", 1)||g_bIncompletedSave) isLastTRUE=TRUE;
diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp
index 3998f2de2c..b52e2d92d7 100644
--- a/plugins/Sessions/Src/Options.cpp
+++ b/plugins/Sessions/Src/Options.cpp
@@ -80,18 +80,18 @@ static LRESULT CALLBACK ComboBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
return TRUE;
case EM_SETSEL:
- if(!hOpClistControl)
+ if (!hOpClistControl)
return HideCaret(hwnd);
break;
case WM_GETDLGCODE:
- if(!hOpClistControl)
+ if (!hOpClistControl)
return DLGC_WANTARROWS;
break;
case WM_SETCURSOR:
{
- if(!hOpClistControl)
+ if (!hOpClistControl)
{
SetCursor(LoadCursor(NULL, IDC_ARROW));
return TRUE;
@@ -111,7 +111,7 @@ static LRESULT CALLBACK ComboBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
case WM_NCLBUTTONDBLCLK:
case WM_NCLBUTTONDOWN:
- if(!bChecked)
+ if (!bChecked)
{
MarkUserDefSession(opses_count,1);
hIcon=hMarked;
@@ -238,7 +238,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
{
EnableWindow(GetDlgItem(hdlg,IDC_EDIT),TRUE);
SendDlgItemMessage(hdlg, IDC_LIST, CB_SETCURSEL, (WPARAM)0, 0);
- if(!OpLoadSessionContacts(0,opses_count))
+ if (!OpLoadSessionContacts(0,opses_count))
EnableWindow(GetDlgItem(hdlg,IDC_DEL),FALSE);
}
@@ -280,7 +280,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
if(IsDlgButtonChecked(hdlg, IDC_STARTDIALOG))
{
- if(!IsDlgButtonChecked(hdlg, IDC_CHECKLAST))
+ if (!IsDlgButtonChecked(hdlg, IDC_CHECKLAST))
DBWriteContactSettingByte(NULL, __INTERNAL_NAME, "StartupMode", 1);
else DBWriteContactSettingByte(NULL, __INTERNAL_NAME, "StartupMode", 3);
}
@@ -345,7 +345,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
RedrawWindow(hComboBoxEdit, NULL, NULL, RDW_INVALIDATE|RDW_NOCHILDREN|RDW_UPDATENOW|RDW_FRAME);
}
OpLoadSessionContacts(0,opses_count);
- if(!hOpClistControl)
+ if (!hOpClistControl)
EnableWindow(GetDlgItem(hdlg,IDC_DEL),TRUE);
else
{
@@ -368,7 +368,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
case IDC_EDIT:
{
- if(!hOpClistControl)
+ if (!hOpClistControl)
{
int i;
HANDLE hItem;
@@ -455,7 +455,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
{
EnableWindow(GetDlgItem(hdlg,IDC_EDIT),TRUE);
SendDlgItemMessage(hdlg, IDC_LIST, CB_SETCURSEL, (WPARAM)0, 0);
- if(!OpLoadSessionContacts(0,opses_count))
+ if (!OpLoadSessionContacts(0,opses_count))
EnableWindow(GetDlgItem(hdlg,IDC_DEL),FALSE);
}
else
@@ -528,7 +528,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
HideCaret(hComboBoxEdit);
}
- if((HIWORD(wparam)!=CBN_DROPDOWN)&&(LOWORD(wparam)==IDC_LIST)&&!hOpClistControl)
+ if ((HIWORD(wparam)!=CBN_DROPDOWN)&&(LOWORD(wparam)==IDC_LIST)&&!hOpClistControl)
{
SendMessage(hComboBoxEdit,EM_SCROLLCARET ,0,0);
HideCaret(hComboBoxEdit);
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp
index 4b5ba065a0..a4859e7874 100644
--- a/plugins/Sessions/Src/Utils.cpp
+++ b/plugins/Sessions/Src/Utils.cpp
@@ -29,7 +29,7 @@ void AddSessionMark(HANDLE hContact,int mode,char bit)
if(mode==0)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
+ if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
{
temp_1[0]=dbv.pszVal[0];
for (i=0;i<ses_limit;i++)
@@ -50,7 +50,7 @@ void AddSessionMark(HANDLE hContact,int mode,char bit)
if (mode==1)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
+ if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
{
if(strlen(dbv.pszVal)<g_ses_count)
{
@@ -88,7 +88,7 @@ void RemoveSessionMark(HANDLE hContact,int mode,int marknum)
if(mode==0)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
+ if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
{
for (i=marknum;i<ses_limit;i++)
dbv.pszVal[i]=dbv.pszVal[i+1];
@@ -103,7 +103,7 @@ void RemoveSessionMark(HANDLE hContact,int mode,int marknum)
if (mode==1)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
+ if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
{
for (i=marknum;i<ses_limit;i++)
dbv.pszVal[i]=dbv.pszVal[i+1];
@@ -121,7 +121,7 @@ void SetSessionMark(HANDLE hContact,int mode,char bit,unsigned int marknum)
if(mode==0)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
+ if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
{
dbv.pszVal[marknum]=bit;
DBWriteContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", dbv.pszVal);
@@ -133,7 +133,7 @@ void SetSessionMark(HANDLE hContact,int mode,char bit,unsigned int marknum)
if (mode==1)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
+ if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
{
pszBuffer = mir_strdup(dbv.pszVal);
pszBuffer[marknum]=bit;
@@ -149,7 +149,7 @@ BOOL LoadContactsFromMask(HANDLE hContact,int mode,int count)
if(mode==0)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
+ if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
{
if (dbv.pszVal[count]=='1')
{
@@ -164,7 +164,7 @@ BOOL LoadContactsFromMask(HANDLE hContact,int mode,int count)
if (mode==1)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
+ if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
{
if (dbv.pszVal[count]=='1')
{
@@ -194,12 +194,12 @@ void AddInSessionOrder(HANDLE hContact,int mode,int ordernum,int writemode)
if(mode==0)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsOrder", &dbv) && dbv.pszVal)
+ if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsOrder", &dbv) && dbv.pszVal)
{
char* temp=NULL;
char* temp2=NULL;
int len= (int)strlen(dbv.pszVal);
- if(!len)
+ if (!len)
len=20;
temp2 = (char*)mir_alloc(len-1);
@@ -239,7 +239,7 @@ void AddInSessionOrder(HANDLE hContact,int mode,int ordernum,int writemode)
{
DBVARIANT dbv;
int advlen=0;
- if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsOrder", &dbv) && dbv.pszVal)
+ if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsOrder", &dbv) && dbv.pszVal)
{
char* temp=NULL;
char* temp2=NULL;
@@ -254,7 +254,7 @@ void AddInSessionOrder(HANDLE hContact,int mode,int ordernum,int writemode)
{
pszBuffer = mir_strdup(dbv.pszVal);
}
- if(!(advlen=len= (int)strlen(pszBuffer)))
+ if (!(advlen=len= (int)strlen(pszBuffer)))
advlen=len=20;
else
advlen=len+2;
@@ -287,7 +287,7 @@ int GetInSessionOrder(HANDLE hContact,int mode,int count)
if(mode==0)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsOrder", &dbv) && dbv.pszVal)
+ if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsOrder", &dbv) && dbv.pszVal)
{
szTemp[0]=dbv.pszVal[count*2];
szTemp[1]=dbv.pszVal[count*2+1];
@@ -298,7 +298,7 @@ int GetInSessionOrder(HANDLE hContact,int mode,int count)
if (mode==1)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsOrder", &dbv) && dbv.pszVal)
+ if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsOrder", &dbv) && dbv.pszVal)
{
szTemp[0]=dbv.pszVal[count*2];
szTemp[1]=dbv.pszVal[count*2+1];
@@ -322,7 +322,7 @@ void SetInSessionOrder(HANDLE hContact,int mode,int count,unsigned int ordernum)
if(mode==0)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsOrder", &dbv) && dbv.pszVal)
+ if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsOrder", &dbv) && dbv.pszVal)
{
dbv.pszVal[count*2]=szTemp[0];
dbv.pszVal[count*2+1]=szTemp[1];
@@ -334,7 +334,7 @@ void SetInSessionOrder(HANDLE hContact,int mode,int count,unsigned int ordernum)
if (mode==1)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsOrder", &dbv) && dbv.pszVal)
+ if (!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsOrder", &dbv) && dbv.pszVal)
{
dbv.pszVal[count*2]=szTemp[0];
dbv.pszVal[count*2+1]=szTemp[1];
@@ -442,7 +442,7 @@ int LoadSessionToCombobox (HWND hdlg,BOOL mode,int iLimit,char* pszSetting,int i
pszBuffer = DBGetStringT(NULL, __INTERNAL_NAME, szBuffer);
if (pszBuffer)
{
- if(!IsMarkedUserDefSession(i+iFirstNum)||mode==1)
+ if (!IsMarkedUserDefSession(i+iFirstNum)||mode==1)
{
index = SendDlgItemMessage(hdlg, IDC_LIST, CB_ADDSTRING, 0, (LPARAM)pszBuffer);
SendDlgItemMessage(hdlg, IDC_LIST, CB_SETITEMDATA, (WPARAM)index, (LPARAM) (DWORD)i+iFirstNum);
diff --git a/plugins/SmileyAdd/smileyroutines.cpp b/plugins/SmileyAdd/smileyroutines.cpp
index 059f0d6e15..10a2e5468e 100644
--- a/plugins/SmileyAdd/smileyroutines.cpp
+++ b/plugins/SmileyAdd/smileyroutines.cpp
@@ -87,7 +87,7 @@ void LookupAllSmileys(SmileyPackType* smileyPack, SmileyPackCType* smileyCPack,
long numCharsSoFar = 0;
bkstring::size_type smloff = 0;
- for(;;)
+ for (;;)
{
int firstSml = -1;
int firstSmlRef = -1;
diff --git a/plugins/SpellChecker/autoreplace.cpp b/plugins/SpellChecker/autoreplace.cpp
index bf72f46fd7..2d257ccfec 100644
--- a/plugins/SpellChecker/autoreplace.cpp
+++ b/plugins/SpellChecker/autoreplace.cpp
@@ -112,7 +112,7 @@ void AutoReplaceMap::writeAutoReplaceMap()
if (file != NULL)
{
map<tstring,AutoReplacement>::iterator it = replacements.begin();
- for(; it != replacements.end(); it++)
+ for (; it != replacements.end(); it++)
{
AutoReplacement &ar = it->second;
@@ -216,7 +216,7 @@ void AutoReplaceMap::setMap(const map<tstring, AutoReplacement> &replacements)
this->replacements.clear();
map<tstring, AutoReplacement>::const_iterator it = replacements.begin();
- for(; it != replacements.end(); it++)
+ for (; it != replacements.end(); it++)
{
scoped_free<TCHAR> from = filterText(it->first.c_str());
this->replacements[from.get()] = it->second;
diff --git a/plugins/SpellChecker/spellchecker.cpp b/plugins/SpellChecker/spellchecker.cpp
index 3daab01da7..218a50f1be 100644
--- a/plugins/SpellChecker/spellchecker.cpp
+++ b/plugins/SpellChecker/spellchecker.cpp
@@ -570,7 +570,7 @@ int FindURLEnd(Dialog *dlg, TCHAR *text, int start_pos, int *checked_until = NUL
int i = start_pos;
- for(; IsURL(text[i]) || dlg->lang->isWordChar(text[i]); i++)
+ for (; IsURL(text[i]) || dlg->lang->isWordChar(text[i]); i++)
{
TCHAR c = text[i];
@@ -892,7 +892,7 @@ int CheckText(Dialog *dlg, BOOL check_all,
cur_sel = dlg->re->GetSel();
}
- for(; line < lines; line++)
+ for (; line < lines; line++)
{
int first_char = dlg->re->GetFirstCharOfLine(line);
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
index 3806f9f99e..9213b915bb 100644
--- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
+++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
@@ -275,7 +275,7 @@ static int changeState(TAAAProtoSetting& setting, STATES newState)
if (DBGetContactSettingByte(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_MSGCUSTOM), FALSE)) {
DBVARIANT dbv;
- if(!DBGetContactSetting(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_STATUSMSG), &dbv)) {
+ if (!DBGetContactSetting(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_STATUSMSG), &dbv)) {
setting.szMsg = _strdup(dbv.pszVal);
DBFreeVariant(&dbv);
} }
@@ -622,7 +622,7 @@ int CSModuleLoaded(WPARAM wParam, LPARAM lParam)
PROTOACCOUNT** protos;
ProtoEnumAccounts(&count, &protos);
- for( int i=0; i < count; i++ )
+ for ( int i=0; i < count; i++ )
if ( IsSuitableProto( protos[i] ))
autoAwaySettings.insert( new TAAAProtoSetting( protos[i] ));
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp
index 9f0da411cc..3fd52ffec1 100644
--- a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp
+++ b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp
@@ -42,7 +42,7 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)&protoCount,(LPARAM)&proto);
DWORD protoModeMsgFlags = 0;
- for( i=0; i < protoCount; i++ ) {
+ for ( i=0; i < protoCount; i++ ) {
if ( (!(CallProtoService(proto[i]->szModuleName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0) & PF1_MODEMSGSEND & ~PF1_INDIVMODEMSG)) )
continue;
@@ -50,7 +50,7 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
}
settings = ( AAMSGSETTING** )malloc(sizeof(AAMSGSETTING*));
count = 0;
- for( i=0; i < SIZEOF(statusModeList); i++ ) {
+ for ( i=0; i < SIZEOF(statusModeList); i++ ) {
if ( !( protoModeMsgFlags & Proto_Status2Flag( statusModeList[i] )))
continue;
diff --git a/plugins/StatusPlugins/KeepStatus/action_keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/action_keepstatus.cpp
index a321ecfcc9..bf71c81543 100644
--- a/plugins/StatusPlugins/KeepStatus/action_keepstatus.cpp
+++ b/plugins/StatusPlugins/KeepStatus/action_keepstatus.cpp
@@ -44,7 +44,7 @@ static void BuildProtoList(HWND hList, BOOL bFromTrigger, char* szPrefix, DWORD
char dbSetting[128];
- for( int i=0; i < count; i++ ) {
+ for ( int i=0; i < count; i++ ) {
if ( !IsSuitableProto( protos[i] ))
continue;
@@ -140,7 +140,7 @@ static int TriggerChecking(DWORD actionID, REPORTINFO *ri)
PROTOACCOUNT** protos;
ProtoEnumAccounts( &count, &protos );
- for( int i=0; i <count; i++ ) {
+ for ( int i=0; i <count; i++ ) {
if ( !IsSuitableProto( protos[i] ))
continue;
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
index 9aaaf39195..5ef0b59b09 100644
--- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
+++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
@@ -771,7 +771,7 @@ static VOID CALLBACK AfterCheckTimer(HWND hwnd,UINT message,UINT_PTR idEvent,DWO
int setStatus = FALSE;
- for( int i=0; i <connectionSettings.getCount(); i++ ) {
+ for ( int i=0; i <connectionSettings.getCount(); i++ ) {
TConnectionSettings& cs = connectionSettings[i];
int realStatus = CallProtoService(cs.szName, PS_GETSTATUS, 0, 0);
int shouldBeStatus = GetStatus(cs);
@@ -802,7 +802,7 @@ static void CheckContinueslyFunction(void *arg)
// do a ping, even if reconnecting
BOOL doPing = FALSE;
- for( int i=0; i < connectionSettings.getCount(); i++ ) {
+ for ( int i=0; i < connectionSettings.getCount(); i++ ) {
TConnectionSettings& cs = connectionSettings[i];
int shouldBeStatus = GetStatus(cs);
if (shouldBeStatus == ID_STATUS_LAST)
diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp
index e81e374328..f0e4a824eb 100644
--- a/plugins/StatusPlugins/commonstatus.cpp
+++ b/plugins/StatusPlugins/commonstatus.cpp
@@ -469,7 +469,7 @@ int GetProtoCount()
PROTOACCOUNT** protos;
ProtoEnumAccounts( &count, &protos );
- for( int i=0; i < count; i++ )
+ for ( int i=0; i < count; i++ )
if ( IsSuitableProto( protos[i] ))
pCount ++;
diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp
index 724ddc2aef..a6073d2373 100644
--- a/plugins/StatusPlugins/confirmdialog.cpp
+++ b/plugins/StatusPlugins/confirmdialog.cpp
@@ -115,7 +115,7 @@ static int SetStatusList(HWND hwndDlg)
lvItem.mask = LVIF_TEXT | LVIF_PARAM;
lvItem.cchTextMax = 256;
- for( int i=0; i < confirmSettings.getCount(); i++ ) {
+ for ( int i=0; i < confirmSettings.getCount(); i++ ) {
lvItem.pszText = confirmSettings[i].tszAccName;
if (ListView_GetItemCount(hList) < confirmSettings.getCount())
ListView_InsertItem(hList,&lvItem);
@@ -377,7 +377,7 @@ static BOOL CALLBACK ConfirmDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l
actualStatus = currentStatus;
}
- for( i = 0; i < SIZEOF(statusModeList); i++ ) {
+ for ( i = 0; i < SIZEOF(statusModeList); i++ ) {
if ( ((flags&statusModePf2List[i]) || (statusModePf2List[i] == PF2_OFFLINE)) && (!((!(flags)&Proto_Status2Flag(statusModePf2List[i]))) || ((CallProtoService(proto->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0)&Proto_Status2Flag(statusModePf2List[i])))) ) {
TCHAR* statusMode = ( TCHAR* )CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, statusModeList[i], GSMDF_TCHAR);
item = SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_ADDSTRING,0,(LPARAM)statusMode);
diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp
index 74d41958a6..bbded01fea 100644
--- a/plugins/StopSpamPlus/src/events.cpp
+++ b/plugins/StopSpamPlus/src/events.cpp
@@ -8,7 +8,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
- if(-1 == dbei.cbBlob)
+ if (-1 == dbei.cbBlob)
return 0;
dbei.pBlob = new BYTE[dbei.cbBlob];
@@ -21,7 +21,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
}
// event is an auth request
- if(!(dbei.flags & DBEF_SENT) && !(dbei.flags & DBEF_READ) && dbei.eventType == EVENTTYPE_AUTHREQUEST)
+ if (!(dbei.flags & DBEF_SENT) && !(dbei.flags & DBEF_READ) && dbei.eventType == EVENTTYPE_AUTHREQUEST)
{
HANDLE hcntct=*(HANDLE*)(dbei.pBlob + sizeof(DWORD));
@@ -32,7 +32,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
!DBGetContactSettingByte(hcntct, pluginName, answeredSetting, 0) &&
!IsExistMyMessage(hcntct))
{
- if(!plSets->HandleAuthReq.Get())
+ if (!plSets->HandleAuthReq.Get())
{
#ifdef _UNICODE
char * buf=mir_utf8encodeW(variables_parse(plSets->AuthRepl.Get(), hcntct).c_str());
@@ -71,7 +71,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
{
HANDLE hContact = (HANDLE)w;
- if(!l) //fix potential DEP crash
+ if (!l) //fix potential DEP crash
return 0;
DBEVENTINFO * dbei = (DBEVENTINFO*)l;
@@ -92,7 +92,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
// checking if message from self-added contact
//Contact in Not in list icq group
- if(!DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) && DBGetContactSettingWord(hContact, dbei->szModule, "SrvGroupId", -1) != 1)
+ if (!DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) && DBGetContactSettingWord(hContact, dbei->szModule, "SrvGroupId", -1) != 1)
return 0;
//if I sent message to this contact
@@ -100,7 +100,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
return 0;
// if message is corrupted or empty it cannot be an answer.
- if(!dbei->cbBlob || !dbei->pBlob)
+ if (!dbei->cbBlob || !dbei->pBlob)
// reject processing of the event
return 1;
@@ -173,7 +173,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
// if message message does not contain infintite talk protection prefix
// and question count for this contact is less then maximum
- if( (!plSets->InfTalkProtection.Get() || tstring::npos==message.find(infTalkProtPrefix))
+ if ( (!plSets->InfTalkProtection.Get() || tstring::npos==message.find(infTalkProtPrefix))
&& (!plSets->MaxQuestCount.Get() || DBGetContactSettingDword(hContact, pluginName, questCountSetting, 0) < plSets->MaxQuestCount.Get()) )
{
// send question
@@ -243,7 +243,7 @@ MIRANDA_HOOK_EVENT(ME_DB_CONTACT_SETTINGCHANGED, w, l)
return 0;
if(strcmp(cws->szSetting, "NotOnList"))
return 0;
- if(!cws->value.type)
+ if (!cws->value.type)
{
DBDeleteContactSetting(hContact, pluginName, answeredSetting);
DBDeleteContactSetting(hContact, pluginName, questCountSetting);
diff --git a/plugins/StopSpamPlus/src/opt_proto.cpp b/plugins/StopSpamPlus/src/opt_proto.cpp
index 201fba693d..30876c72bc 100644
--- a/plugins/StopSpamPlus/src/opt_proto.cpp
+++ b/plugins/StopSpamPlus/src/opt_proto.cpp
@@ -28,7 +28,7 @@ int FillTree(HWND hwnd)
return FALSE;
for ( i = 0; i < n; i++ ) {
- if(IsAccountEnabled( pa[i] )){
+ if(IsAccountEnabled( pa[i] )) {
PD = ( ProtocolData* )mir_alloc( sizeof( ProtocolData ));
PD->RealName = pa[i]->szModuleName;
PD->enabled = IsProtoIM( pa[i]);
diff --git a/plugins/Svc_crshdmp/utils.cpp b/plugins/Svc_crshdmp/utils.cpp
index e1c83ab28f..f1448f184b 100644
--- a/plugins/Svc_crshdmp/utils.cpp
+++ b/plugins/Svc_crshdmp/utils.cpp
@@ -432,7 +432,7 @@ void TrimMultiSpaces(TCHAR* str)
TCHAR *src = str, *dest = str;
bool trimst = false;
- for(;;)
+ for (;;)
{
if (*src == TEXT(' '))
{
diff --git a/plugins/Svc_dbepp/exportimport.cpp b/plugins/Svc_dbepp/exportimport.cpp
index 83b15e7e0a..2ac8d04e6e 100644
--- a/plugins/Svc_dbepp/exportimport.cpp
+++ b/plugins/Svc_dbepp/exportimport.cpp
@@ -390,7 +390,7 @@ HANDLE Clist_GroupExists(WCHAR *tszGroup)
do {
_itoa(i, str, 10);
result = DBGetContactSettingTString(0, "CListGroups", str, &dbv);
- if(!result) {
+ if (!result) {
match = (!lstrcmpW(tszGroup, (LPCWSTR)&dbv.ptszVal[1]) && (lstrlenW(tszGroup) == lstrlenW((LPCWSTR)&dbv.ptszVal[1])));
DBFreeVariant(&dbv);
if(match)
@@ -543,9 +543,9 @@ void importSettings(HANDLE hContact, char *importstring )
case 'g':
case 'G':
{ char *pstr;
- for(pstr=end+2;*pstr;pstr++){
- if(*pstr=='\\'){
- switch(pstr[1]){
+ for(pstr=end+2;*pstr;pstr++) {
+ if (*pstr=='\\') {
+ switch(pstr[1]) {
case 'n': *pstr='\n'; break;
case 't': *pstr='\t'; break;
case 'r': *pstr='\r'; break;
diff --git a/plugins/Svc_dbepp/main.cpp b/plugins/Svc_dbepp/main.cpp
index f230d1e958..be18f13e00 100644
--- a/plugins/Svc_dbepp/main.cpp
+++ b/plugins/Svc_dbepp/main.cpp
@@ -232,7 +232,7 @@ int ModulesLoaded(WPARAM wParam,LPARAM lParam)
// Load the name order
for(i=0;i<NAMEORDERCOUNT;i++) nameOrder[i]=i;
- if(!DBGetContactSetting(NULL,"Contact","NameOrder",&dbv))
+ if (!DBGetContactSetting(NULL,"Contact","NameOrder",&dbv))
{
CopyMemory(nameOrder,dbv.pbVal,dbv.cpbVal);
DBFreeVariant(&dbv);
diff --git a/plugins/Svc_dbepp/main_window.cpp b/plugins/Svc_dbepp/main_window.cpp
index 01916108ac..d7fdb75256 100644
--- a/plugins/Svc_dbepp/main_window.cpp
+++ b/plugins/Svc_dbepp/main_window.cpp
@@ -354,7 +354,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
GetWindowRect(hwnd,&rc2);
- if((HWND)lParam==GetDlgItem(hwnd,IDC_SPLITTER))
+ if ((HWND)lParam==GetDlgItem(hwnd,IDC_SPLITTER))
{
GetClientRect(hwnd,&rc);
pt.x=wParam; pt.y=0;
diff --git a/plugins/Svc_vi/utils.cpp b/plugins/Svc_vi/utils.cpp
index 1111bc96f9..9a29b45fdf 100644
--- a/plugins/Svc_vi/utils.cpp
+++ b/plugins/Svc_vi/utils.cpp
@@ -51,10 +51,10 @@ int SplitStringInfo(const TCHAR *szWholeText, TCHAR *szStartText, TCHAR *szEndTe
const TCHAR *pos = _tcschr(szWholeText, '|');
if (pos) {
size_t index = pos - szWholeText;
- lstrcpyn(szStartText, szWholeText, index);
+ lstrcpyn(szStartText, szWholeText, (int)index);
szStartText[index] = '\0';
StrTrim(szStartText, _T(" "));
- lstrcpyn(szEndText, pos + 1, _tcslen(pos)); //copies the \0 as well ... :)
+ lstrcpyn(szEndText, pos + 1, (int)_tcslen(pos)); //copies the \0 as well ... :)
StrTrim(szEndText, _T(" "));
}
else szStartText[0] = szEndText[0] = '\0';
@@ -171,7 +171,7 @@ PLUGININFOEX *GetPluginInfo(const TCHAR *filename,HINSTANCE *hPlugin)
}
wsprintf(szPluginPath, _T("%s\\Plugins\\%s"), szMirandaPath, filename);
*hPlugin=LoadLibrary(szPluginPath);
- if(*hPlugin==NULL) return NULL;
+ if (*hPlugin==NULL) return NULL;
MirandaPluginInfo=(PLUGININFOEX *(*)(DWORD))GetProcAddress(*hPlugin,"MirandaPluginInfo");
if(MirandaPluginInfo==NULL) {FreeLibrary(*hPlugin); *hPlugin=NULL; return NULL;}
pPlugInfo=MirandaPluginInfo(mirandaVersion);
diff --git a/plugins/TabSRMM/chat/clist.cpp b/plugins/TabSRMM/chat/clist.cpp
index d321c4d017..18f1eba4e4 100644
--- a/plugins/TabSRMM/chat/clist.cpp
+++ b/plugins/TabSRMM/chat/clist.cpp
@@ -52,7 +52,7 @@ static HANDLE Clist_GroupExists(TCHAR *tszGroup)
do {
_itoa(i, str, 10);
result = M->GetTString(0, "CListGroups", str, &dbv);
- if(!result) {
+ if (!result) {
match = (!_tcscmp(tszGroup, &dbv.ptszVal[1]) && (lstrlen(tszGroup) == lstrlen(&dbv.ptszVal[1])));
DBFreeVariant(&dbv);
if(match)
diff --git a/plugins/TabSRMM/chat/muchighlight.cpp b/plugins/TabSRMM/chat/muchighlight.cpp
index d790cc1d2b..80709d863a 100644
--- a/plugins/TabSRMM/chat/muchighlight.cpp
+++ b/plugins/TabSRMM/chat/muchighlight.cpp
@@ -91,20 +91,20 @@ void CMUCHighlight::tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr)
TCHAR *p = tszString;
- if(*p == 0)
+ if (*p == 0)
return;
nr = 0;
- if(*p != ' ')
+ if (*p != ' ')
nr++;
while(*p) {
- if(*p == ' ') {
+ if (*p == ' ') {
p++;
while(*p && _istspace(*p))
p++;
- if(*p)
+ if (*p)
nr++;
}
p++;
@@ -114,15 +114,15 @@ void CMUCHighlight::tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr)
p = tszString;
nr = 0;
- if(*p != ' ')
+ if (*p != ' ')
patterns[nr++] = p;
while(*p) {
- if(*p == ' ') {
+ if (*p == ' ') {
*p++ = 0;
while(*p && _istspace(*p))
p++;
- if(*p)
+ if (*p)
patterns[nr++] = p;
}
p++;
@@ -137,7 +137,7 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF
return(0);
__try {
- if((m_dwFlags & MATCH_TEXT) && (dwFlags & MATCH_TEXT) && (m_fHighlightMe || m_iTextPatterns > 0) && psi != 0) {
+ if ((m_dwFlags & MATCH_TEXT) && (dwFlags & MATCH_TEXT) && (m_fHighlightMe || m_iTextPatterns > 0) && psi != 0) {
#ifdef __HLT_PERFSTATS
int words = 0;
M->startTimer();
@@ -162,12 +162,12 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF
while(*p && (*p == ' ' || *p == ',' || *p == '.' || *p == ':' || *p == ';' || *p == '?' || *p == '!'))
p++;
- if(*p) {
+ if (*p) {
p1 = p;
while(*p1 && *p1 != ' ' && *p1 != ',' && *p1 != '.' && *p1 != ':' && *p1 != ';' && *p1 != '?' && *p1 != '!')
p1++;
- if(*p1)
+ if (*p1)
*p1 = 0;
else
p1 = 0;
@@ -205,11 +205,11 @@ skip_textpatterns:
/*
* optinally, match the nickname against the list of nicks to highlight
*/
- if((m_dwFlags & MATCH_NICKNAME) && (dwFlags & MATCH_NICKNAME) && pgce->ptszNick && m_iNickPatterns > 0) {
+ if ((m_dwFlags & MATCH_NICKNAME) && (dwFlags & MATCH_NICKNAME) && pgce->ptszNick && m_iNickPatterns > 0) {
for(UINT i = 0; i < m_iNickPatterns && !nResult; i++) {
if(pgce->ptszNick)
nResult = wildmatch(m_NickPatterns[i], pgce->ptszNick) ? MATCH_NICKNAME : 0;
- if((m_dwFlags & MATCH_UIN) && pgce->ptszUserInfo)
+ if ((m_dwFlags & MATCH_UIN) && pgce->ptszUserInfo)
nResult = wildmatch(m_NickPatterns[i], pgce->ptszUserInfo) ? MATCH_NICKNAME : 0;
}
}
diff --git a/plugins/TabSRMM/chat/options.cpp b/plugins/TabSRMM/chat/options.cpp
index b2b6d9c63c..d50ed5ecbb 100644
--- a/plugins/TabSRMM/chat/options.cpp
+++ b/plugins/TabSRMM/chat/options.cpp
@@ -1023,8 +1023,8 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
while(*p && (*p == '\\' || *p == '.'))
p++;
- if(*p) {
- if((p1 = _tcschr(p, '\\')))
+ if (*p) {
+ if ((p1 = _tcschr(p, '\\')))
*p1 = 0;
}
diff --git a/plugins/TabSRMM/chat/services.cpp b/plugins/TabSRMM/chat/services.cpp
index e165763861..5e241823b7 100644
--- a/plugins/TabSRMM/chat/services.cpp
+++ b/plugins/TabSRMM/chat/services.cpp
@@ -555,7 +555,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
}
}
if (bActivateTab) {
- if (PluginConfig.m_HideOnClose && !IsWindowVisible(pContainer->hwnd)){
+ if (PluginConfig.m_HideOnClose && !IsWindowVisible(pContainer->hwnd)) {
WINDOWPLACEMENT wp={0};
wp.length = sizeof(wp);
GetWindowPlacement(pContainer->hwnd, &wp);
diff --git a/plugins/TabSRMM/chat/tools.cpp b/plugins/TabSRMM/chat/tools.cpp
index 0726a01869..c7ad91cc4c 100644
--- a/plugins/TabSRMM/chat/tools.cpp
+++ b/plugins/TabSRMM/chat/tools.cpp
@@ -337,7 +337,7 @@ static BOOL DoPopup(SESSION_INFO* si, GCEVENT* gce, struct TWindowData* dat)
}
if (dat && pContainer != 0) { // message window is open, need to check the container config if we want to see a popup nonetheless
if (nen_options.bWindowCheck) { // no popups at all for open windows... no exceptions
- if(!PluginConfig.m_HideOnClose)
+ if (!PluginConfig.m_HideOnClose)
return(0);
if(pContainer->fHidden)
goto passed;
@@ -364,7 +364,7 @@ passed:
int iNewEvent = iEvent;
COLORREF clr = 0;
- if((iNewEvent & GC_EVENT_HIGHLIGHT)) {
+ if ((iNewEvent & GC_EVENT_HIGHLIGHT)) {
clr = aFonts[16].color;
iNewEvent &= ~GC_EVENT_HIGHLIGHT;
}
@@ -541,7 +541,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO* si, GCEVENT * gce, BOOL bHighligh
params->bInactive = TRUE;
if(si->hWnd && si->dat) {
dat = si->dat;
- if((si->hWnd == si->dat->pContainer->hwndActive) && GetForegroundWindow() == si->dat->pContainer->hwnd)
+ if ((si->hWnd == si->dat->pContainer->hwndActive) && GetForegroundWindow() == si->dat->pContainer->hwnd)
params->bInactive = FALSE;
}
params->bActiveTab = params->bMustFlash = params->bMustAutoswitch = FALSE;
@@ -776,7 +776,7 @@ BOOL LogToFile(SESSION_INFO* si, GCEVENT * gce)
/*
* check whether we have to log this event
*/
- if(!(gce->pDest->iType & si->iDiskLogFlags))
+ if (!(gce->pDest->iType & si->iDiskLogFlags))
return FALSE;
szBuffer[0] = '\0';
@@ -919,7 +919,7 @@ BOOL LogToFile(SESSION_INFO* si, GCEVENT * gce)
mir_sntprintf(tszNewName, _MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20, _T("%s%s-%s%s"), tszNewPath, tszName, tszTimestamp, tszExt);
fclose(hFile);
hFile = 0;
- if(!PathFileExists(tszNewName))
+ if (!PathFileExists(tszNewName))
CopyFile(si->pszLogFileName, tszNewName, TRUE);
DeleteFile(si->pszLogFileName);
}
@@ -1272,7 +1272,7 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
int i;
bool fReparse = false;
- if(!tTime)
+ if (!tTime)
time(&tTime);
/*
@@ -1331,7 +1331,7 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
dat.variables = rva;
tszParsedName = (TCHAR*) CallService(MS_UTILS_REPLACEVARS, (WPARAM)g_Settings.pszLogDir, (LPARAM)&dat);
- if(!M->pathIsAbsolute(tszParsedName))
+ if (!M->pathIsAbsolute(tszParsedName))
mir_sntprintf(si->pszLogFileName, MAX_PATH, _T("%s%s"), M->getChatLogPath(), tszParsedName);
else
mir_sntprintf(si->pszLogFileName, MAX_PATH, _T("%s"), tszParsedName);
diff --git a/plugins/TabSRMM/chat/window.cpp b/plugins/TabSRMM/chat/window.cpp
index 0c7d3c8f99..61913f04b5 100644
--- a/plugins/TabSRMM/chat/window.cpp
+++ b/plugins/TabSRMM/chat/window.cpp
@@ -268,7 +268,7 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg)
GetCursorPos(&pt);
GetWindowRect(si->hwndFilter, &rcFilter);
- if(!PtInRect(&rcFilter, pt)) {
+ if (!PtInRect(&rcFilter, pt)) {
SendMessage(si->hwndFilter, WM_CLOSE, 1, 1);
si->hwndFilter = 0;
}
@@ -972,8 +972,8 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
}
SendMessage(hwnd, WM_SETREDRAW, TRUE, 0);
RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE);
- if(!fCompleted && !PluginConfig.m_AllowTab) {
- if((GetSendButtonState(mwdat->hwnd) != PBS_DISABLED))
+ if (!fCompleted && !PluginConfig.m_AllowTab) {
+ if ((GetSendButtonState(mwdat->hwnd) != PBS_DISABLED))
SetFocus(GetDlgItem(mwdat->hwnd, IDOK));
else
SetFocus(GetDlgItem(mwdat->hwnd, IDC_CHAT_LOG));
@@ -1984,7 +1984,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
dat->fIsAutosizingInput = IsAutoSplitEnabled(dat);
dat->fLimitedUpdate = false;
dat->iInputAreaHeight = -1;
- if(!dat->pContainer->settings->fPrivate)
+ if (!dat->pContainer->settings->fPrivate)
psi->iSplitterY = g_Settings.iSplitterY;
else {
if(M->GetByte("Chat", "SyncSplitter", 0))
@@ -2198,10 +2198,10 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
//Mad: strange rare crash here...
mi = MM_FindModule(si->pszModule);
- if(!mi)
+ if (!mi)
break;
- if(!mi->ptszModDispName)
+ if (!mi->ptszModDispName)
break;
x += GetTextPixelSize(mi->ptszModDispName, (HFONT)SendMessage(dat->pContainer->hwndStatus, WM_GETFONT, 0, 0), TRUE);
@@ -2211,7 +2211,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
time_t now = time(0);
DWORD diff = (now - mi->idleTimeStamp) / 60;
- if((diff >= 1 && diff != mi->lastIdleCheck) || lParam) {
+ if ((diff >= 1 && diff != mi->lastIdleCheck) || lParam) {
mi->lastIdleCheck = diff;
if(diff == 0)
mi->tszIdleMsg[0] = 0;
@@ -2720,7 +2720,7 @@ LABEL_SHOWWINDOW:
if(msg == WM_SYSKEYUP) {
if(wp == VK_MENU) {
- if(!dat->fkeyProcessed && !(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_SHIFT) & 0x8000) && !(lp & (1 << 24)))
+ if (!dat->fkeyProcessed && !(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_SHIFT) & 0x8000) && !(lp & (1 << 24)))
dat->pContainer->MenuBar->autoShow();
}
return(_dlgReturn(hwndDlg, 0));
@@ -2777,7 +2777,7 @@ LABEL_SHOWWINDOW:
}
if(msg == WM_KEYDOWN && wp == VK_TAB) {
- if(((NMHDR *)lParam)->idFrom == IDC_CHAT_LOG) {
+ if (((NMHDR *)lParam)->idFrom == IDC_CHAT_LOG) {
SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
return(_dlgReturn(hwndDlg, 1));
}
@@ -3072,7 +3072,7 @@ LABEL_SHOWWINDOW:
POINT tmp; //+ Protogenes
POINTS cur; //+ Protogenes
GetCursorPos(&tmp); //+ Protogenes
- if(!dat->Panel->isHovered()) {
+ if (!dat->Panel->isHovered()) {
cur.x = (SHORT)tmp.x; //+ Protogenes
cur.y = (SHORT)tmp.y; //+ Protogenes
SendMessage(dat->pContainer->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, *((LPARAM*)(&cur))); //+ Protogenes
@@ -3446,7 +3446,7 @@ LABEL_SHOWWINDOW:
dat->Panel->renderContent(hdcMem);
- if(!CSkin::m_skinEnabled)
+ if (!CSkin::m_skinEnabled)
CSkin::RenderToolbarBG(dat, hdcMem, rcClient);
if(hbp)
@@ -3457,7 +3457,7 @@ LABEL_SHOWWINDOW:
DeleteObject(hbm);
DeleteDC(hdcMem);
}
- if(!dat->fLimitedUpdate)
+ if (!dat->fLimitedUpdate)
SetAeroMargins(dat->pContainer);
return(1);
}
@@ -3540,7 +3540,7 @@ LABEL_SHOWWINDOW:
case DM_CONTAINERSELECTED: {
struct TContainerData *pNewContainer = 0;
TCHAR *szNewName = (TCHAR *)lParam;
- if(!_tcscmp(szNewName, CTranslator::get(CTranslator::GEN_DEFAULT_CONTAINER_NAME)))
+ if (!_tcscmp(szNewName, CTranslator::get(CTranslator::GEN_DEFAULT_CONTAINER_NAME)))
szNewName = CGlobals::m_default_container_name;
int iOldItems = TabCtrl_GetItemCount(hwndTab);
if (!_tcsncmp(dat->pContainer->szName, szNewName, CONTAINER_NAMELEN))
@@ -3797,7 +3797,7 @@ LABEL_SHOWWINDOW:
TABSRMM_FireEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_CLOSING, 0);
- if(!dat->fIsAutosizingInput)
+ if (!dat->fIsAutosizingInput)
DBWriteContactSettingWord(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
if(dat->pContainer->settings->fPrivate && !IsAutoSplitEnabled(dat))
diff --git a/plugins/TabSRMM/include/msgs.h b/plugins/TabSRMM/include/msgs.h
index 51c59a1561..94bca920c1 100644
--- a/plugins/TabSRMM/include/msgs.h
+++ b/plugins/TabSRMM/include/msgs.h
@@ -648,7 +648,7 @@ public:
STDMETHOD_(ULONG, Release)(void)
{
--mRefCounter;
- //if(--mRefCounter == 0)
+ //if (--mRefCounter == 0)
// delete this;
return (mRefCounter);
}
diff --git a/plugins/TabSRMM/include/themes.h b/plugins/TabSRMM/include/themes.h
index d1cc15d53c..e06110c6f3 100644
--- a/plugins/TabSRMM/include/themes.h
+++ b/plugins/TabSRMM/include/themes.h
@@ -160,7 +160,7 @@ public:
m_inner_height = m_height - m_bBottom - m_bTop;
m_inner_width = m_width - m_bLeft - m_bRight;
- if(!(m_dwFlags & IMAGE_FLAG_DIVIDED))
+ if (!(m_dwFlags & IMAGE_FLAG_DIVIDED))
m_bStretch = IMAGE_STRETCH_B;
}
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index fb50f7b576..43115a116b 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -705,7 +705,7 @@ BOOL TSAPI BB_SetButtonsPos(TWindowData *dat)
if (bNeedResort)
qsort(LButtonsList->items, LButtonsList->realCount, sizeof(BBButton *), sstSortButtons);
- if((dat->pContainer->dwFlags & CNT_SIDEBAR) && (dat->pContainer->SideBar->getFlags() & CSideBar::SIDEBARORIENTATION_LEFT)) {
+ if ((dat->pContainer->dwFlags & CNT_SIDEBAR) && (dat->pContainer->SideBar->getFlags() & CSideBar::SIDEBARORIENTATION_LEFT)) {
DeferWindowPos(hdwp, hwndToggleSideBar , NULL, 4, 2 + splitterY - iOff,
0, 0, SWP_NOZORDER | SWP_NOSIZE);// | SWP_NOCOPYBITS);
lwidth += 10;
@@ -758,7 +758,7 @@ BOOL TSAPI BB_SetButtonsPos(TWindowData *dat)
bNeedResort = FALSE;
}
- if((dat->pContainer->dwFlags & CNT_SIDEBAR) && (dat->pContainer->SideBar->getFlags() & CSideBar::SIDEBARORIENTATION_RIGHT)) {
+ if ((dat->pContainer->dwFlags & CNT_SIDEBAR) && (dat->pContainer->SideBar->getFlags() & CSideBar::SIDEBARORIENTATION_RIGHT)) {
DeferWindowPos(hdwp, hwndToggleSideBar , NULL, rect.right - foravatar - 10, 2 + splitterY - iOff,
0, 0, SWP_NOZORDER | SWP_NOSIZE);// | SWP_NOCOPYBITS);
rwidth += 12;
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp
index b30290d447..0c743b8a81 100644
--- a/plugins/TabSRMM/src/contactcache.cpp
+++ b/plugins/TabSRMM/src/contactcache.cpp
@@ -489,7 +489,7 @@ void CContactCache::updateStatusMsg(const char *szKey)
BYTE bStatusMsgValid = 0;
INT_PTR res = 0;
- if(!m_Valid)
+ if (!m_Valid)
return;
if(szKey == 0 || (szKey && !strcmp("StatusMsg", szKey))) {
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 2edbca9281..ac72ba55cf 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -100,7 +100,7 @@ void TSAPI SetAeroMargins(TContainerData *pContainer)
GetWindowRect(dat->hwnd, &rcWnd);
pt.x = rcWnd.left;
- if(!pContainer->SideBar->isActive())
+ if (!pContainer->SideBar->isActive())
pt.y = rcWnd.bottom + ((pContainer->iChilds > 1 || !(pContainer->dwFlags & CNT_HIDETABS)) ? pContainer->tBorder : 0);
else {
pt.y = rcWnd.bottom;
@@ -844,7 +844,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
}
pContainer->SideBar->scrollIntoView();
- if(!M->isAero()) { // aero mode uses buffered paint, no forced redraw needed
+ if (!M->isAero()) { // aero mode uses buffered paint, no forced redraw needed
RedrawWindow(hwndTab, NULL, NULL, RDW_INVALIDATE | (pContainer->bSizingLoop ? RDW_ERASE : 0));
RedrawWindow(hwndDlg, NULL, NULL, (bSkinned ? RDW_FRAME : 0) | RDW_INVALIDATE | ((pContainer->bSizingLoop || wParam == SIZE_RESTORED ) ? RDW_ERASE : 0));
}
@@ -1661,7 +1661,7 @@ buttons_done:
/*
* avoid flickering of the menu bar when aero is active
*/
- if(!pContainer)
+ if (!pContainer)
break;
HDC hdc = (HDC)wParam;
@@ -1917,7 +1917,7 @@ buttons_done:
Win7Taskbar->setOverlayIcon(hwndDlg, lParam);
if(GetForegroundWindow() != hwndDlg)
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, lParam);
- if((HICON)lParam == hIconMsg)
+ if ((HICON)lParam == hIconMsg)
pContainer->hIconTaskbarOverlay = hIconMsg;
break;
}
@@ -1926,7 +1926,7 @@ buttons_done:
if(dat->hTaskbarIcon == 0)
dat->hTaskbarIcon = ((dat->pContainer->dwFlags & CNT_AVATARSONTASKBAR) ? Utils::iconFromAvatar(dat) : 0);
else {
- if(!(dat->pContainer->dwFlags & CNT_AVATARSONTASKBAR)) {
+ if (!(dat->pContainer->dwFlags & CNT_AVATARSONTASKBAR)) {
DestroyIcon(dat->hTaskbarIcon);
dat->hTaskbarIcon = 0;
}
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp
index dd87ef56d2..e030bcacab 100644
--- a/plugins/TabSRMM/src/containeroptions.cpp
+++ b/plugins/TabSRMM/src/containeroptions.cpp
@@ -72,7 +72,7 @@ void TSAPI ApplyContainerSetting(TContainerData *pContainer, DWORD flags, UINT m
bool set = (mode & 0x01) ? true : false;
if (!pContainer->settings->fPrivate) {
- if(!isEx)
+ if (!isEx)
pContainer->dwFlags = (set ? pContainer->dwFlags | flags : pContainer->dwFlags & ~flags);
else
pContainer->dwFlagsEx = (set ? pContainer->dwFlagsEx | flags : pContainer->dwFlagsEx & ~flags);
@@ -93,7 +93,7 @@ void TSAPI ApplyContainerSetting(TContainerData *pContainer, DWORD flags, UINT m
ReloadGlobalContainerSettings(fForceResize);
}
else {
- if(!isEx)
+ if (!isEx)
pContainer->dwFlags = (set ? pContainer->dwFlags | flags : pContainer->dwFlags & ~flags);
else
pContainer->dwFlagsEx = (set ? pContainer->dwFlagsEx | flags : pContainer->dwFlagsEx & ~flags);
@@ -464,7 +464,7 @@ do_apply:
SendMessage(hwndDlg, DM_SC_CONFIG, 0, 0);
- if(!(dwFlagsEx & (TCF_SBARLEFT | TCF_SBARRIGHT)))
+ if (!(dwFlagsEx & (TCF_SBARLEFT | TCF_SBARRIGHT)))
SendDlgItemMessage(hwndDlg, IDC_TABMODE, CB_SETCURSEL, dwFlags & CNT_TABSBOTTOM ? 1 : 0, 0);
else
SendDlgItemMessage(hwndDlg, IDC_TABMODE, CB_SETCURSEL, dwFlagsEx & TCF_SBARLEFT ? 2 : 3, 0);
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp
index f524de5f1a..ef6e15d35e 100644
--- a/plugins/TabSRMM/src/controls.cpp
+++ b/plugins/TabSRMM/src/controls.cpp
@@ -320,7 +320,7 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm)
CSkin::ApplyAeroEffect(m_hdcDraw, &m_rcItem, CSkin::AERO_EFFECT_AREA_MENUBAR);
nm->rc.bottom++;
}
- else if((PluginConfig.m_fillColor || M->isVSThemed()) && !CSkin::m_skinEnabled) {
+ else if ((PluginConfig.m_fillColor || M->isVSThemed()) && !CSkin::m_skinEnabled) {
if(PluginConfig.m_fillColor && PluginConfig.m_tbBackgroundHigh && PluginConfig.m_tbBackgroundLow) {
::DrawAlpha(m_hdcDraw, &m_rcItem, PluginConfig.m_tbBackgroundHigh, 100, PluginConfig.m_tbBackgroundLow, 0,
GRADIENT_TB, 0, 0, 0);
@@ -660,7 +660,7 @@ LRESULT CALLBACK CMenuBar::MessageHook(int nCode, WPARAM wParam, LPARAM lParam)
POINT pt;
::GetCursorPos(&pt);
- if(::MenuItemFromPoint(0, m_Owner->m_activeMenu, pt) >= 0) // inside menu
+ if (::MenuItemFromPoint(0, m_Owner->m_activeMenu, pt) >= 0) // inside menu
break;
if(m_Owner->m_activeSubMenu && ::MenuItemFromPoint(0, m_Owner->m_activeSubMenu, pt) >= 0)
break;
@@ -1006,7 +1006,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
ScreenToClient(hWnd, &pt1);
SendMessage(hWnd, SB_GETRECT, 2, (LPARAM)&rcIconpart);
- if(!PtInRect(&rcIconpart, pt1))
+ if (!PtInRect(&rcIconpart, pt1))
return SendMessage(pContainer->hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
}
break;
@@ -1093,7 +1093,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
CallService(szTTService, (WPARAM)wBuf, (LPARAM)&ti);
tooltip_active = TRUE;
}
- else if((int)iconNum == list_icons + 2) {
+ else if ((int)iconNum == list_icons + 2) {
TCHAR wBuf[512];
mir_sntprintf(wBuf, safe_sizeof(wBuf), _T("%s"), CTranslator::get(CTranslator::CNT_SBAR_SLIST));
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp
index ea1df5a209..d6eac87767 100644
--- a/plugins/TabSRMM/src/eventpopups.cpp
+++ b/plugins/TabSRMM/src/eventpopups.cpp
@@ -57,7 +57,7 @@ static const PLUGIN_DATAT* PU_GetByContact(const HANDLE hContact)
if(PopupList.size()) {
PopupListIterator it = PopupList.begin();
while(it != PopupList.end()) {
- if((*it)->hContact == hContact)
+ if ((*it)->hContact == hContact)
return(*it);
it++;
}
@@ -77,9 +77,9 @@ static void PU_CleanUp()
while(it != PopupList.end()) {
if(PopupList.size() == 0)
break;
- if((*it)->hContact == 0) {
+ if ((*it)->hContact == 0) {
//_DebugTraceW(_T("found stale popup %s"), (*it)->eventData->szText);
- if((*it)->eventData)
+ if ((*it)->eventData)
free((*it)->eventData);
free(*it);
it = PopupList.erase(it);
@@ -180,7 +180,7 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
HIMAGELIST himl = (HIMAGELIST)SendDlgItemMessage(hWnd, IDC_EVENTOPTIONS, TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)CreateStateImageList());
ImageList_Destroy(himl);
- if(!PluginConfig.g_PopupAvail) {
+ if (!PluginConfig.g_PopupAvail) {
HWND hwndChild = FindWindowEx(hWnd, 0, 0, 0);
while(hwndChild) {
ShowWindow(hwndChild, SW_HIDE);
@@ -563,7 +563,7 @@ static TCHAR *GetPreviewT(WORD eventType, DBEVENTINFO* dbe)
break;
case EVENTTYPE_FILE:
if(pBlob) {
- if(!nen_options.bPreview) {
+ if (!nen_options.bPreview) {
commentFix = mir_tstrdup(CTranslator::get(CTranslator::GEN_STRING_EVENT_FILE));
break;
}
@@ -627,7 +627,7 @@ static int PopupUpdateT(HANDLE hContact, HANDLE hEvent)
pdata = const_cast<PLUGIN_DATAT *>(PU_GetByContact(hContact));
- if(!pdata)
+ if (!pdata)
return(1);
ZeroMemory((void *)&dbe, sizeof(dbe));
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index d507076eae..54337a5df2 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -110,7 +110,7 @@ void TSAPI DM_CheckAutoHide(const TWindowData* dat, WPARAM wParam, LPARAM lParam
*fResult = FALSE;
return; // unread events, do not hide or close the container
}
- if(((GetTickCount() - dat->dwLastActivity) / 1000) <= wParam)
+ if (((GetTickCount() - dat->dwLastActivity) / 1000) <= wParam)
*fResult = FALSE; // time since last activity did not yet reach the threshold.
}
}
@@ -123,7 +123,7 @@ void TSAPI DM_DismissTip(TWindowData *dat, const POINT& pt)
{
RECT rc;
- if(!IsWindowVisible(dat->hwndTip))
+ if (!IsWindowVisible(dat->hwndTip))
return;
GetWindowRect(dat->hwndTip, &rc);
@@ -570,7 +570,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
break;
}
- if(!dat->fIsAutosizingInput) {
+ if (!dat->fIsAutosizingInput) {
dat->iSplitterSaved = dat->splitterY;
dat->splitterY = rc.bottom / 2;
SendMessage(hwndDlg, WM_SIZE, 1, 1);
@@ -591,7 +591,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
M->WriteTString(dat->hContact, "UserInfo", "MyNotes", buf);
SetDlgItemText(hwndDlg, IDC_MESSAGE, _T(""));
- if(!dat->fIsAutosizingInput) {
+ if (!dat->fIsAutosizingInput) {
dat->splitterY = dat->iSplitterSaved;
SendMessage(hwndDlg, WM_SIZE, 0, 0);
DM_ScrollToBottom(dat, 0, 1);
@@ -654,7 +654,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
LRESULT TSAPI DM_ContainerCmdHandler(TContainerData *pContainer, UINT cmd, WPARAM wParam, LPARAM lParam)
{
- if(!pContainer)
+ if (!pContainer)
return(0);
HWND hwndDlg = pContainer->hwnd;
@@ -810,7 +810,7 @@ void TSAPI DM_InitRichEdit(TWindowData *dat)
dat->inputbg = fIsChat ? M->GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR) : dat->pContainer->theme.inputbg;
colour = fIsChat ? M->GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR_MUC, SRMSGDEFSET_BKGCOLOUR) : dat->pContainer->theme.bg;
- if(!fIsChat) {
+ if (!fIsChat) {
if (GetWindowTextLengthA(hwndEdit) > 0)
szStreamOut = Message_GetFromStream(hwndEdit, dat, (CP_UTF8 << 16) | (SF_RTFNOOBJS | SFF_PLAINRTF | SF_USECODEPAGE));
}
@@ -827,7 +827,7 @@ void TSAPI DM_InitRichEdit(TWindowData *dat)
/*
* correct the input area text color to avoid a color from the table of usable bbcode colors
*/
- if(!fIsChat) {
+ if (!fIsChat) {
for (i = 0; i < Utils::rtf_ctable_size; i++) {
if (Utils::rtf_ctable[i].clr == inputcharcolor)
inputcharcolor = RGB(GetRValue(inputcharcolor), GetGValue(inputcharcolor), GetBValue(inputcharcolor) == 0 ? GetBValue(inputcharcolor) + 1 : GetBValue(inputcharcolor) - 1);
@@ -889,7 +889,7 @@ void TSAPI DM_InitRichEdit(TWindowData *dat)
pf2.dxRightIndent = 30;
}
pf2.dxOffset = dat->pContainer->theme.left_indent + 30;
- if(!fIsChat) {
+ if (!fIsChat) {
SetWindowText(hwndLog, _T(""));
SendMessage(hwndLog, EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
SendMessage(hwndLog, EM_SETLANGOPTIONS, 0, (LPARAM) SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETLANGOPTIONS, 0, 0) & ~IMF_AUTOKEYBOARD);
@@ -899,7 +899,7 @@ void TSAPI DM_InitRichEdit(TWindowData *dat)
* set the scrollbars etc to RTL/LTR (only for manual RTL mode)
*/
- if(!fIsChat) {
+ if (!fIsChat) {
if (dat->dwFlags & MWF_LOG_RTL) {
SetWindowLongPtr(hwndEdit, GWL_EXSTYLE, GetWindowLongPtr(hwndEdit, GWL_EXSTYLE) | WS_EX_RIGHT | WS_EX_RTLREADING | WS_EX_LEFTSCROLLBAR);
SetWindowLongPtr(hwndLog, GWL_EXSTYLE, GetWindowLongPtr(hwndLog, GWL_EXSTYLE) | WS_EX_RIGHT | WS_EX_RTLREADING | WS_EX_LEFTSCROLLBAR);
@@ -1169,7 +1169,7 @@ LRESULT TSAPI DM_LoadLocale(TWindowData *dat)
DBFreeVariant(&dbv);
CloseHandle((HANDLE)mir_forkthreadex(LoadKLThread, reinterpret_cast<void *>(dat->hContact), 16000, NULL));
} else {
- if(!PluginConfig.m_dontUseDefaultKbd) {
+ if (!PluginConfig.m_dontUseDefaultKbd) {
TCHAR szBuf[20];
GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, szBuf, 20);
@@ -1312,7 +1312,7 @@ LRESULT TSAPI DM_WMCopyHandler(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPA
HWND TSAPI DM_CreateClist(TWindowData *dat)
{
- if(!sendLater->isAvail()) {
+ if (!sendLater->isAvail()) {
CWarning::show(CWarning::WARN_NO_SENDLATER, MB_OK|MB_ICONINFORMATION, CTranslator::get(CTranslator::QMGR_ERROR_NOMULTISEND));
dat->sendMode &= ~SMODE_MULTIPLE;
return(0);
@@ -1609,7 +1609,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff)
} else {
struct TWindowData *dat_active = NULL;
- if(!fForceOff) {
+ if (!fForceOff) {
dat->showTyping = 2;
dat->nTypeSecs = 86400;
@@ -1692,7 +1692,7 @@ int TSAPI DM_SplitterGlobalEvent(TWindowData *dat, WPARAM wParam, LPARAM lParam)
GetWindowRect(dat->hwnd, &rcWin);
if(wParam == 0 && lParam == 0) {
- if((dat->dwFlagsEx & MWF_SHOW_SPLITTEROVERRIDE) && dat != srcDat)
+ if ((dat->dwFlagsEx & MWF_SHOW_SPLITTEROVERRIDE) && dat != srcDat)
return(0);
if(srcDat->bType == dat->bType)
@@ -1725,12 +1725,12 @@ int TSAPI DM_SplitterGlobalEvent(TWindowData *dat, WPARAM wParam, LPARAM lParam)
return(0);
}
- if(!fCntGlobal && dat->pContainer != srcCnt)
+ if (!fCntGlobal && dat->pContainer != srcCnt)
return(0);
if(srcCnt->settings->fPrivate && dat->pContainer != srcCnt)
return(0);
- if(!PluginConfig.lastSPlitterPos.bSync && dat->bType != srcDat->bType)
+ if (!PluginConfig.lastSPlitterPos.bSync && dat->bType != srcDat->bType)
return(0);
/*
@@ -1950,7 +1950,7 @@ void TSAPI DM_HandleAutoSizeRequest(TWindowData *dat, REQRESIZE* rr)
}
else if (dat->si) {
dat->si->iSplitterY = (rc.bottom - (rc.bottom - iNewHeight + DPISCALEY_S(3))) + DPISCALEY_S(34);
- if(!(dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR))
+ if (!(dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR))
dat->si->iSplitterY -= DPISCALEY_S(22);
SendMessage(dat->hwnd, WM_SIZE, 0, 0);
}
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 689b4cb53b..4894e29681 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -497,13 +497,13 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam)
hwnd = M->FindWindow((HANDLE)wParam);
if (hwnd == 0 && wParam != 0) { // we are not interested in this event if there is no open message window/tab
- if(!strcmp(setting, "Status") || !strcmp(setting, "MyHandle") || !strcmp(setting, "Nick") || !strcmp(cws->szModule, SRMSGMOD_T)) {
+ if (!strcmp(setting, "Status") || !strcmp(setting, "MyHandle") || !strcmp(setting, "Nick") || !strcmp(cws->szModule, SRMSGMOD_T)) {
c = CContactCache::getContactCache((HANDLE)wParam);
if(c) {
fChanged = c->updateStatus();
if(strcmp(setting, "Status"))
c->updateNick();
- if(!strcmp(setting, "isFavorite") || !strcmp(setting, "isRecent"))
+ if (!strcmp(setting, "isFavorite") || !strcmp(setting, "isRecent"))
c->updateFavorite();
}
}
@@ -519,8 +519,8 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam)
c = CContactCache::getContactCache((HANDLE)wParam);
if(c) {
szProto = c->getProto();
- if(!strcmp(cws->szModule, SRMSGMOD_T)) { // catch own relevant settings
- if(!strcmp(setting, "isFavorite") || !strcmp(setting, "isRecent"))
+ if (!strcmp(cws->szModule, SRMSGMOD_T)) { // catch own relevant settings
+ if (!strcmp(setting, "isFavorite") || !strcmp(setting, "isRecent"))
c->updateFavorite();
}
}
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp
index d203e2fd4d..ef5eeaf3af 100644
--- a/plugins/TabSRMM/src/hotkeyhandler.cpp
+++ b/plugins/TabSRMM/src/hotkeyhandler.cpp
@@ -654,7 +654,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
/*
* start processing the job list
*/
- if(!sendLater->isJobListEmpty()) {
+ if (!sendLater->isJobListEmpty()) {
KillTimer(hwndDlg, wParam);
sendLater->startJobListProcess();
SetTimer(hwndDlg, TIMERID_SENDLATER_TICK, TIMEOUT_SENDLATER_TICK, 0);
@@ -667,7 +667,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
* queue.
*/
else if(wParam == TIMERID_SENDLATER_TICK) {
- if(!sendLater->haveJobs()) {
+ if (!sendLater->haveJobs()) {
KillTimer(hwndDlg, wParam);
SetTimer(hwndDlg, TIMERID_SENDLATER, TIMEOUT_SENDLATER, 0);
sendLater->qMgrUpdate(true);
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp
index 044266b1a1..c33dd35f90 100644
--- a/plugins/TabSRMM/src/infopanel.cpp
+++ b/plugins/TabSRMM/src/infopanel.cpp
@@ -112,8 +112,8 @@ void CInfoPanel::saveHeight(bool fFlush)
BYTE bSync = M->GetByte("syncAllPanels", 0);
if (m_height < 110 && m_height >= MIN_PANELHEIGHT) { // only save valid panel splitter positions
- if(!m_fPrivateHeight) {
- if(!m_isChat || bSync) {
+ if (!m_fPrivateHeight) {
+ if (!m_isChat || bSync) {
if(m_dat->pContainer->settings->fPrivate)
m_dat->pContainer->settings->panelheight = m_height;
else {
@@ -155,8 +155,8 @@ void CInfoPanel::setHeight(LONG newHeight, bool fBroadcast)
m_height = newHeight;
if(fBroadcast) {
- if(!m_fPrivateHeight) {
- if(!m_dat->pContainer->settings->fPrivate)
+ if (!m_fPrivateHeight) {
+ if (!m_dat->pContainer->settings->fPrivate)
M->BroadcastMessage(DM_SETINFOPANEL, (WPARAM)m_dat, (LPARAM)newHeight);
else
::BroadCastContainer(m_dat->pContainer, DM_SETINFOPANEL, (WPARAM)m_dat, (LPARAM)newHeight);
@@ -176,7 +176,7 @@ void CInfoPanel::showHide() const
BITMAP bm;
HWND hwndDlg = m_dat->hwnd;
- if(!m_isChat) {
+ if (!m_isChat) {
::ShowWindow(m_dat->hwndPanelPicParent, m_active && (m_dat->hwndPanelPic || m_dat->hwndFlash) ? SW_SHOW : SW_HIDE);
//
m_dat->iRealAvatarHeight = 0;
@@ -298,7 +298,7 @@ void CInfoPanel::renderBG(const HDC hdc, RECT& rc, CSkinItem *item, bool fAero,
* if new (= tabsrmm 3.x) skin item is not defined, use the old info panel
* field background items. That should break less skins
*/
- if(!item->IGNORED)
+ if (!item->IGNORED)
CSkin::DrawItem(hdc, &rc, item);
} else {
rc.bottom -= 2;
@@ -323,7 +323,7 @@ void CInfoPanel::renderBG(const HDC hdc, RECT& rc, CSkinItem *item, bool fAero,
void CInfoPanel::renderContent(const HDC hdc)
{
if(m_active) {
- if(!m_isChat) {
+ if (!m_isChat) {
RECT rc;
/*
@@ -335,7 +335,7 @@ void CInfoPanel::renderContent(const HDC hdc)
dis.rcItem = m_dat->rcPic;
dis.hDC = hdc;
dis.hwndItem = m_dat->hwnd;
- if(::MsgWindowDrawHandler(0, (LPARAM)&dis, m_dat) == 0) {
+ if (::MsgWindowDrawHandler(0, (LPARAM)&dis, m_dat) == 0) {
::PostMessage(m_dat->hwnd, WM_SIZE, 0, 1);
::PostMessage(m_dat->hwnd, DM_FORCEREDRAW, 0, 0);
}
@@ -737,7 +737,7 @@ HMENU CInfoPanel::constructContextualMenu() const
mii.fMask = MIIM_DATA | MIIM_ID | MIIM_BITMAP | MIIM_STRING;
mii.hbmpItem = HBMMENU_CALLBACK;
- if(!(m_hoverFlags & HOVER_NICK))
+ if (!(m_hoverFlags & HOVER_NICK))
return(0);
HMENU m = ::CreatePopupMenu();
@@ -747,7 +747,7 @@ HMENU CInfoPanel::constructContextualMenu() const
IDC_NAME, 0);
Utils::addMenuItem(m, mii, ::LoadSkinnedIcon(SKINICON_OTHER_HISTORY), CTranslator::get(CTranslator::GEN_IP_MENU_HISTORY),
m_isChat ? IDC_CHAT_HISTORY : IDC_HISTORY, 0);
- if(!m_isChat)
+ if (!m_isChat)
Utils::addMenuItem(m, mii, PluginConfig.g_iconContainer, CTranslator::get(CTranslator::GEN_IP_MENU_MSGPREFS),
ID_MESSAGELOGSETTINGS_FORTHISCONTACT, 1);
else {
@@ -806,10 +806,10 @@ LRESULT CInfoPanel::cmdHandler(UINT cmd)
*/
void CInfoPanel::handleClick(const POINT& pt)
{
- if(!m_active || m_hoverFlags == 0)
+ if (!m_active || m_hoverFlags == 0)
return;
- if(!m_isChat) {
+ if (!m_isChat) {
::KillTimer(m_dat->hwnd, TIMERID_AWAYMSG);
m_dat->dwFlagsEx &= ~MWF_SHOW_AWAYMSGTIMER;
}
@@ -836,11 +836,11 @@ int CInfoPanel::hitTest(POINT pt)
{
::ScreenToClient(m_dat->hwnd, &pt);
- if(!m_isChat && ::PtInRect(&m_rcStatus, pt))
+ if (!m_isChat && ::PtInRect(&m_rcStatus, pt))
return(HTSTATUS);
- else if(::PtInRect(&m_rcNick, pt))
+ else if (::PtInRect(&m_rcNick, pt))
return(HTNICK);
- else if(::PtInRect(&m_rcUIN, pt))
+ else if (::PtInRect(&m_rcUIN, pt))
return(HTUIN);
return(HTNIRVANA);
@@ -853,7 +853,7 @@ int CInfoPanel::hitTest(POINT pt)
*/
void CInfoPanel::trackMouse(POINT& pt)
{
- if(!m_active)
+ if (!m_active)
return;
int result = hitTest(pt);
@@ -924,7 +924,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam)
m_dat->cache->getStatusMsg() ? m_dat->cache->getStatusMsg() : CTranslator::get(CTranslator::GEN_NO_STATUS));
str->append(temp);
- if((xStatus = m_dat->cache->getXStatusId())) {
+ if ((xStatus = m_dat->cache->getXStatusId())) {
TCHAR *tszXStatusName = 0;
if(0 == M->GetTString(m_dat->cache->getContact(), m_dat->cache->getProto(), "XStatusName", &dbv))
tszXStatusName = dbv.ptszVal;
@@ -996,7 +996,7 @@ void CInfoPanel::hideTip(const HWND hwndNew)
if(m_tip) {
if(hwndNew == m_tip->getHwnd())
return;
- if(::IsWindow(m_tip->getHwnd()))
+ if (::IsWindow(m_tip->getHwnd()))
::DestroyWindow(m_tip->getHwnd());
m_tip = 0;
}
@@ -1024,7 +1024,7 @@ INT_PTR CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wP
GetClientRect(hwnd, &rcItem);
rc = rcItem;
- if(!IsWindowEnabled(hwnd) || !dat->Panel->isActive() || dat->showInfoPic == 0)
+ if (!IsWindowEnabled(hwnd) || !dat->Panel->isActive() || dat->showInfoPic == 0)
return(TRUE);
HDC dcWin = (HDC)wParam;
@@ -1147,7 +1147,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
Utils::showDlgControl(hwnd, IDC_IPCONFIG_PRIVATECONTAINER, m_dat->pContainer->settings->fPrivate ? SW_SHOW : SW_HIDE);
- if(!m_isChat) {
+ if (!m_isChat) {
v = M->GetByte(m_dat->hContact, SRMSGMOD_T, "hideavatar", -1);
::SendDlgItemMessage(hwnd, IDC_PANELPICTUREVIS, CB_INSERTSTRING, -1, (LPARAM)CTranslator::getOpt(CTranslator::OPT_UPREFS_IPGLOBAL));
::SendDlgItemMessage(hwnd, IDC_PANELPICTUREVIS, CB_INSERTSTRING, -1, (LPARAM)CTranslator::getOpt(CTranslator::OPT_UPREFS_AVON));
@@ -1257,14 +1257,14 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
case IDC_NOSYNC:
M->WriteByte(SRMSGMOD_T, "syncAllPanels", ::IsDlgButtonChecked(hwnd, IDC_NOSYNC) ? 0 : 1);
- if(!IsDlgButtonChecked(hwnd, IDC_NOSYNC)) {
+ if (!IsDlgButtonChecked(hwnd, IDC_NOSYNC)) {
loadHeight();
- if(!m_dat->pContainer->settings->fPrivate)
+ if (!m_dat->pContainer->settings->fPrivate)
M->BroadcastMessage(DM_SETINFOPANEL, (WPARAM)m_dat, (LPARAM)m_defaultHeight);
else
::BroadCastContainer(m_dat->pContainer, DM_SETINFOPANEL, (WPARAM)m_dat, (LPARAM)m_defaultHeight);
} else {
- if(!m_dat->pContainer->settings->fPrivate)
+ if (!m_dat->pContainer->settings->fPrivate)
M->BroadcastMessage(DM_SETINFOPANEL, (WPARAM)m_dat, 0);
else
::BroadCastContainer(m_dat->pContainer,DM_SETINFOPANEL, (WPARAM)m_dat, 0);
@@ -1309,14 +1309,14 @@ int CInfoPanel::invokeConfigDialog(const POINT& pt)
RECT rc;
POINT ptTest = pt;
- if(!m_active)
+ if (!m_active)
return(0);
::GetWindowRect(m_dat->hwnd, &rc);
rc.bottom = rc.top + m_height;
rc.right -= m_dat->panelWidth;
- if(!::PtInRect(&rc, ptTest))
+ if (!::PtInRect(&rc, ptTest))
return(0);
if(m_hwndConfig == 0) {
@@ -1356,7 +1356,7 @@ void CInfoPanel::dismissConfig(bool fForced)
POINT pt;
RECT rc;
- if(!m_fDialogCreated) {
+ if (!m_fDialogCreated) {
::GetCursorPos(&pt);
::GetWindowRect(m_hwndConfig, &rc);
if(fForced || !PtInRect(&rc, pt)) {
@@ -1668,7 +1668,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
}
case WM_COMMAND: {
- if((HWND)lParam == m_hRich && HIWORD(wParam) == EN_SETFOCUS)
+ if ((HWND)lParam == m_hRich && HIWORD(wParam) == EN_SETFOCUS)
::HideCaret(m_hRich);
break;
}
@@ -1681,11 +1681,11 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
::KillTimer(hwnd, 1000);
::GetCursorPos(&pt);
::GetWindowRect(hwnd, &rc);
- if(!PtInRect(&rc, pt))
+ if (!PtInRect(&rc, pt))
::DestroyWindow(hwnd);
else
break;
- if(::GetActiveWindow() != hwnd)
+ if (::GetActiveWindow() != hwnd)
::DestroyWindow(hwnd);
}
break;
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index 4dc9128a92..d473020e39 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -242,14 +242,14 @@ const TCHAR* CMimAPI::StriStr(const TCHAR *szString, const TCHAR *szSearchFor)
if (0 == szSearchFor || 0 == *szSearchFor)
return(szString);
- for(; *szString; ++szString) {
+ for (; *szString; ++szString) {
if(_totupper(*szString) == _totupper(*szSearchFor)) {
const TCHAR *h, *n;
for(h = szString, n = szSearchFor; *h && *n; ++h, ++n) {
if(_totupper(*h) != _totupper(*n))
break;
}
- if(!*n)
+ if (!*n)
return(szString);
}
}
@@ -574,7 +574,7 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam)
}
if(M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST)) {
- if(!hwnd && !M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, 1))
+ if (!hwnd && !M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, 1))
fShowOnClist = FALSE;
if(hwnd && !M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, 1))
fShowOnClist = FALSE;
@@ -582,7 +582,7 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam)
else
fShowOnClist = FALSE;
- if((!foundWin || !(pContainer->dwFlags&CNT_NOSOUND)) && preTyping != (lParam != 0)){
+ if ((!foundWin || !(pContainer->dwFlags&CNT_NOSOUND)) && preTyping != (lParam != 0)) {
if (lParam)
SkinPlaySound("TNStart");
else
@@ -598,7 +598,7 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam)
fShow = TRUE;
break;
case 1:
- if(!foundWin || !(pContainer && pContainer->hwndActive == hwnd && GetForegroundWindow() == pContainer->hwnd))
+ if (!foundWin || !(pContainer && pContainer->hwndActive == hwnd && GetForegroundWindow() == pContainer->hwnd))
fShow = TRUE;
break;
case 2:
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 33b8234ae7..306258ad61 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -300,7 +300,7 @@ LRESULT CALLBACK HPPKFSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
return(CSkin::DrawRichEditFrame(hwnd, mwdat, ID_EXTBKHISTORY, msg, wParam, lParam, mwdat->oldIEViewProc));
case WM_KEYDOWN:
- if(!isCtrl && !isAlt&&!isShift) {
+ if (!isCtrl && !isAlt&&!isShift) {
{
if (wParam != VK_PRIOR&&wParam != VK_NEXT&&
wParam != VK_DELETE&&wParam != VK_MENU&&wParam != VK_END&&
@@ -579,7 +579,7 @@ static LRESULT CALLBACK MessageLogSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
break;
}
case WM_KEYDOWN:
- if(!isCtrl && !isAlt&&!isShift)
+ if (!isCtrl && !isAlt&&!isShift)
{
if (/*wParam != VK_ESCAPE&&*/wParam != VK_PRIOR&&wParam != VK_NEXT&&
wParam != VK_DELETE&&wParam != VK_MENU&&wParam != VK_END&&
@@ -1167,7 +1167,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *
}
//Bolshevik: resizes avatar control _FIXED
- if( dat->hwndContactPic ) //if Panel control was created?
+ if ( dat->hwndContactPic ) //if Panel control was created?
SetWindowPos(dat->hwndContactPic, HWND_TOP, 1, ((urc->rcItem.bottom-urc->rcItem.top)-(dat->pic.cy))/2+1, //resizes it
dat->pic.cx-2,
dat->pic.cy-2, SWP_SHOWWINDOW);
@@ -1745,7 +1745,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
* draw aero related stuff
*/
- if(!CSkin::m_skinEnabled)
+ if (!CSkin::m_skinEnabled)
CSkin::RenderToolbarBG(dat, hdcMem, rcClient);
/*
* render info panel fields
@@ -1760,7 +1760,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
DeleteObject(hbm);
DeleteDC(hdcMem);
}
- if(!dat->fLimitedUpdate)
+ if (!dat->fLimitedUpdate)
SetAeroMargins(dat->pContainer);
return(1);
}
@@ -1931,7 +1931,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
UINT ctrlId = 0;
if(wp == VK_MENU) {
- if(!dat->fkeyProcessed && !(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_SHIFT) & 0x8000) && !(lp & (1 << 24)))
+ if (!dat->fkeyProcessed && !(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_SHIFT) & 0x8000) && !(lp & (1 << 24)))
m_pContainer->MenuBar->autoShow();
}
return(_dlgReturn(hwndDlg, 0));
@@ -1981,7 +1981,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
DWORD dwFlags = M->GetDword(dat->hContact, "mwflags", 0);
dat->dwFlags ^= MWF_LOG_RTL;
- if((dwGlobal & MWF_LOG_RTL) != (dat->dwFlags & MWF_LOG_RTL)) {
+ if ((dwGlobal & MWF_LOG_RTL) != (dat->dwFlags & MWF_LOG_RTL)) {
dwMask |= MWF_LOG_RTL;
dwFlags |= (dat->dwFlags & MWF_LOG_RTL);
}
@@ -2118,7 +2118,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
SendMessage(hwndDlg, DM_REPLAYQUEUE, 0, 0);
dat->dwFlagsEx ^= MWF_SHOW_SCROLLINGDISABLED;
Utils::showDlgControl(hwndDlg, IDC_LOGFROZENTEXT, (dat->bNotOnList || dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED) ? SW_SHOW : SW_HIDE);
- if(!(dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED))
+ if (!(dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED))
SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, CTranslator::get(CTranslator::GEN_MSG_CONTACT_NOT_ON_LIST));
else
SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, CTranslator::get(CTranslator::GEN_MSG_LOGFROZENSTATIC));
@@ -2129,15 +2129,15 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
//MAD: tabulation mod
if(msg == WM_KEYDOWN && wp == VK_TAB) {
if(PluginConfig.m_AllowTab) {
- if(((NMHDR *)lParam)->idFrom == IDC_MESSAGE)
+ if (((NMHDR *)lParam)->idFrom == IDC_MESSAGE)
SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)"\t");
_clrMsgFilter(lParam);
- if(((NMHDR *)lParam)->idFrom != IDC_MESSAGE)
+ if (((NMHDR *)lParam)->idFrom != IDC_MESSAGE)
SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
return(_dlgReturn(hwndDlg, 1));
}
else {
- if(((NMHDR *)lParam)->idFrom == IDC_MESSAGE) {
+ if (((NMHDR *)lParam)->idFrom == IDC_MESSAGE) {
if(GetSendButtonState(hwndDlg) != PBS_DISABLED && !(dat->pContainer->dwFlags & CNT_HIDETOOLBAR)) {
SetFocus(GetDlgItem(hwndDlg, IDOK));
return(_dlgReturn(hwndDlg, 1));
@@ -2147,7 +2147,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
return(_dlgReturn(hwndDlg, 1));
}
}
- if(((NMHDR *)lParam)->idFrom == IDC_LOG) {
+ if (((NMHDR *)lParam)->idFrom == IDC_LOG) {
SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
return(_dlgReturn(hwndDlg, 1));
}
@@ -2870,7 +2870,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
GetCursorPos(&tmp); //+ Protogenes
cur.x = (SHORT)tmp.x; //+ Protogenes
cur.y = (SHORT)tmp.y; //+ Protogenes
- if(!dat->Panel->isHovered())
+ if (!dat->Panel->isHovered())
SendMessage(hwndContainer, WM_NCLBUTTONDOWN, HTCAPTION, *((LPARAM*)(&cur))); //+ Protogenes
break;
}
@@ -3211,7 +3211,7 @@ quote_from_last:
if (!M->GetByte(dat->hContact, "CList", "NotOnList", 0)) {
dat->bNotOnList = FALSE;
ShowMultipleControls(hwndDlg, addControls, 2, SW_HIDE);
- if(!(dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED))
+ if (!(dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED))
Utils::showDlgControl(hwndDlg, IDC_LOGFROZENTEXT, SW_HIDE);
SendMessage(hwndDlg, WM_SIZE, 0, 0);
}
@@ -3220,7 +3220,7 @@ quote_from_last:
case IDC_CANCELADD:
dat->bNotOnList = FALSE;
ShowMultipleControls(hwndDlg, addControls, 2, SW_HIDE);
- if(!(dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED))
+ if (!(dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED))
Utils::showDlgControl(hwndDlg, IDC_LOGFROZENTEXT, SW_HIDE);
SendMessage(hwndDlg, WM_SIZE, 0, 0);
break;
@@ -3322,7 +3322,7 @@ quote_from_last:
struct TContainerData *pNewContainer = 0;
TCHAR *szNewName = (TCHAR *)lParam;
- if(!_tcscmp(szNewName, CTranslator::get(CTranslator::GEN_DEFAULT_CONTAINER_NAME)))
+ if (!_tcscmp(szNewName, CTranslator::get(CTranslator::GEN_DEFAULT_CONTAINER_NAME)))
szNewName = CGlobals::m_default_container_name;
int iOldItems = TabCtrl_GetItemCount(hwndTab);
@@ -3731,7 +3731,7 @@ quote_from_last:
LoadSkinnedProtoIcon(dat->cache->getActiveProto(), dat->cache->getActiveStatus()), 1, PluginConfig.g_hMenuRecent);
if (dat->hContact) {
- if(!dat->fEditNotesActive) {
+ if (!dat->fEditNotesActive) {
char *msg = Message_GetFromStream(GetDlgItem(hwndDlg, IDC_MESSAGE), dat, (CP_UTF8 << 16) | (SF_TEXT | SF_USECODEPAGE));
if (msg) {
DBWriteContactSettingString(dat->hContact, SRMSGMOD, "SavedMsg", msg);
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index caefdcffc3..3a85f830d7 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -1539,7 +1539,7 @@ void TSAPI LoadSplitter(TWindowData *dat)
}
#endif
if (!(dat->dwFlagsEx & MWF_SHOW_SPLITTEROVERRIDE))
- if(!dat->pContainer->settings->fPrivate)
+ if (!dat->pContainer->settings->fPrivate)
dat->splitterY = (int)M->GetDword("splitsplity", (DWORD) 60);
else
dat->splitterY = dat->pContainer->settings->splitterPos;
@@ -1620,7 +1620,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName)
TCHAR* p;
szLI[255] = 0;
- if((p = _tcschr(szLI, ';')) != 0)
+ if ((p = _tcschr(szLI, ';')) != 0)
*p = 0;
}
RegCloseKey(hKey);
@@ -1833,7 +1833,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat)
DestroyWindow(dat->hwndContactPic);
dat->hwndContactPic = NULL;
}
- if(!PluginConfig.g_bDisableAniAvatars && fa.hWindow == 0 && dat->hwndContactPic == 0) {
+ if (!PluginConfig.g_bDisableAniAvatars && fa.hWindow == 0 && dat->hwndContactPic == 0) {
dat->hwndContactPic =CreateWindowEx(WS_EX_TOPMOST, AVATAR_CONTROL_CLASS, _T(""), WS_VISIBLE | WS_CHILD, 1, 1, 1, 1, GetDlgItem(hwndDlg, IDC_CONTACTPIC), (HMENU)0, NULL, NULL);
SendMessage(dat->hwndContactPic, AVATAR_SETCONTACT, (WPARAM)0, (LPARAM)dat->hContact);
}
@@ -1857,7 +1857,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat)
else {
if (dat->panelWidth) {
dat->panelWidth = -1;
- if(!CSkin::m_skinEnabled)
+ if (!CSkin::m_skinEnabled)
SendMessage(hwndDlg, WM_SIZE, 0, 0);
}
return TRUE;
@@ -2067,7 +2067,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat)
SelectObject(hdcDraw, hPenOld);
SelectObject(hdcDraw, hOldBrush);
DeleteObject(hPenBorder);
- if(!bPanelPic)
+ if (!bPanelPic)
BitBlt(dis->hDC, 0, 0, cx, cy, hdcDraw, 0, 0, SRCCOPY);
SelectObject(hdcDraw, hbmOld);
DeleteObject(hbmDraw);
@@ -2400,7 +2400,7 @@ void TSAPI DetermineMinHeight(TWindowData* dat)
RECT rc;
LONG height = (dat->Panel->isActive() ? dat->Panel->getHeight() + 2 : 0);
- if(!(dat->pContainer->dwFlags & CNT_HIDETOOLBAR))
+ if (!(dat->pContainer->dwFlags & CNT_HIDETOOLBAR))
height += DPISCALEY_S(24); // toolbar
GetClientRect(GetDlgItem(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_MESSAGE : IDC_CHAT_MESSAGE), &rc);
height += rc.bottom; // input area
@@ -2461,10 +2461,10 @@ void TSAPI SendHBitmapAsFile(const TWindowData* dat, HBITMAP hbmp)
* to determine whether the file can be sent. Throw a warning if any of
* these checks fails.
*/
- if(!(protoCaps & PF1_FILESEND))
+ if (!(protoCaps & PF1_FILESEND))
fSend = false;
- if((ID_STATUS_OFFLINE == wMyStatus) || (ID_STATUS_OFFLINE == dat->cache->getActiveStatus() && !(typeCaps & PF4_OFFLINEFILES)))
+ if ((ID_STATUS_OFFLINE == wMyStatus) || (ID_STATUS_OFFLINE == dat->cache->getActiveStatus() && !(typeCaps & PF4_OFFLINEFILES)))
fSend = false;
if (protoCaps & PF1_VISLIST && DBGetContactSettingWord(dat->cache->getActiveContact(), szProto, "ApparentMode", 0) == ID_STATUS_OFFLINE)
@@ -2473,7 +2473,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData* dat, HBITMAP hbmp)
if (protoCaps & PF1_INVISLIST && wMyStatus == ID_STATUS_INVISIBLE && DBGetContactSettingWord(dat->cache->getActiveContact(), szProto, "ApparentMode", 0) != ID_STATUS_ONLINE)
fSend = false;
- if(!fSend) {
+ if (!fSend) {
CWarning::show(CWarning::WARN_SENDFILE, MB_OK|MB_ICONEXCLAMATION|CWarning::CWF_NOALLOWHIDE);
return;
}
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index eb030bba9d..ff5fd5a68b 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -993,7 +993,7 @@ static char *Template_CreateRTFFromDbEvent(struct TWindowData *dat, HANDLE hCont
case 'U': // UIN
if (!skipFont)
AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s ", GetRTFFont(isSent ? MSGFONTID_MYNAME + iFontIDOffset : MSGFONTID_YOURNAME + iFontIDOffset));
- if(!isSent)
+ if (!isSent)
AppendUnicodeToBuffer(&buffer, &bufferEnd, &bufferAlloced, (wchar_t *)dat->cache->getUIN(), MAKELONG(isSent, dat->isHistory));
else
AppendUnicodeToBuffer(&buffer, &bufferEnd, &bufferAlloced, (wchar_t *)dat->myUin, MAKELONG(isSent, dat->isHistory));
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index 7438925df1..4e239672c1 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -147,13 +147,13 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox)
mir_sntprintf(tszFinalName, MAX_PATH, _T("%s%s"), tszFolder, fd.cFileName);
GetPrivateProfileString(_T("Global"), _T("Name"), _T("None"), szBuf, 500, tszFinalName);
- if(!_tcscmp(szBuf, _T("None"))) {
+ if (!_tcscmp(szBuf, _T("None"))) {
fd.cFileName[lstrlen(fd.cFileName) - 4] = 0;
mir_sntprintf(szBuf, 255, _T("%s"), fd.cFileName);
}
M->pathToRelative(tszFinalName, tszRel, M->getSkinPath());
- if((lr = SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)szBuf)) != CB_ERR) {
+ if ((lr = SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)szBuf)) != CB_ERR) {
TCHAR *idata = (TCHAR *)malloc((lstrlen(tszRel) + 1) * sizeof(TCHAR));
_tcscpy(idata, tszRel);
@@ -208,7 +208,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox)
TCHAR* idata = (TCHAR *)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0);
if(idata && idata != (TCHAR *)CB_ERR) {
- if(!_tcsicmp(dbv.ptszVal, idata)) {
+ if (!_tcsicmp(dbv.ptszVal, idata)) {
SendMessage(hwndCombobox, CB_SETCURSEL, i, 0);
break;
}
@@ -259,7 +259,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
}
case WM_CTLCOLORSTATIC:
- if((HWND)lParam == GetDlgItem(hwndDlg, IDC_SKIN_WARN)) {
+ if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SKIN_WARN)) {
SetTextColor((HDC)wParam, RGB(255, 50, 50));
return(0);
}
@@ -956,7 +956,7 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam
SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_SETCURSEL, (WPARAM)M->GetByte("MTN_PopupMode", 0), 0);
- if(!PluginConfig.g_PopupWAvail) {
+ if (!PluginConfig.g_PopupWAvail) {
Utils::showDlgControl(hwndDlg, IDC_NOTIFYPOPUP, SW_HIDE);
Utils::showDlgControl(hwndDlg, IDC_STATIC111, SW_HIDE);
Utils::showDlgControl(hwndDlg, IDC_MTN_POPUPMODE, SW_HIDE);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index 5c67a6a797..214d65ac54 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -818,14 +818,14 @@ HWND TSAPI CreateNewTabForContact(struct TContainerData *pContainer, HANDLE hCon
if (GetForegroundWindow() != pContainer->hwnd && bPopupContainer == TRUE)
SetForegroundWindow(pContainer->hwnd);
}
- else if(!IsIconic(pContainer->hwnd) && IsWindowVisible(pContainer->hwnd)){
+ else if (!IsIconic(pContainer->hwnd) && IsWindowVisible(pContainer->hwnd)) {
SendMessage(pContainer->hwndActive, WM_SIZE, 0, 0);
RedrawWindow(pContainer->hwndActive, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_UPDATENOW);
RedrawWindow(pContainer->hwndActive, NULL, NULL, RDW_ERASENOW | RDW_UPDATENOW);
}
//MaD
- if (PluginConfig.m_HideOnClose&&!IsWindowVisible(pContainer->hwnd)){
+ if (PluginConfig.m_HideOnClose&&!IsWindowVisible(pContainer->hwnd)) {
WINDOWPLACEMENT wp={0};
wp.length = sizeof(wp);
GetWindowPlacement(pContainer->hwnd, &wp);
@@ -902,10 +902,10 @@ void TSAPI CreateImageList(BOOL bInitial)
PluginConfig.g_IconFileEvent = LoadSkinnedIcon(SKINICON_EVENT_FILE);
PluginConfig.g_IconMsgEvent = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
PluginConfig.g_IconMsgEventBig = LoadSkinnedIconBig(SKINICON_EVENT_MESSAGE);
- if((HICON)CALLSERVICE_NOTFOUND == PluginConfig.g_IconMsgEventBig)
+ if ((HICON)CALLSERVICE_NOTFOUND == PluginConfig.g_IconMsgEventBig)
PluginConfig.g_IconMsgEventBig = 0;
PluginConfig.g_IconTypingEventBig = LoadSkinnedIconBig(SKINICON_OTHER_TYPING);
- if((HICON)CALLSERVICE_NOTFOUND == PluginConfig.g_IconTypingEventBig)
+ if ((HICON)CALLSERVICE_NOTFOUND == PluginConfig.g_IconTypingEventBig)
PluginConfig.g_IconTypingEventBig = 0;
PluginConfig.g_IconSend = PluginConfig.g_buttonBarIcons[9];
PluginConfig.g_IconTypingEvent = PluginConfig.g_buttonBarIcons[5];
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp
index 975f7496a4..eada4d1c7d 100644
--- a/plugins/TabSRMM/src/selectcontainer.cpp
+++ b/plugins/TabSRMM/src/selectcontainer.cpp
@@ -114,7 +114,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME));
if (iLen) {
GetWindowText(GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME), szNewName, CONTAINER_NAMELEN);
- if(!_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN) || !_tcsncmp(szNewName, CTranslator::get(CTranslator::GEN_DEFAULT_CONTAINER_NAME), CONTAINER_NAMELEN)) {
+ if (!_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN) || !_tcsncmp(szNewName, CTranslator::get(CTranslator::GEN_DEFAULT_CONTAINER_NAME), CONTAINER_NAMELEN)) {
MessageBox(hwndDlg, CTranslator::get(CTranslator::CNT_SELECT_RENAMEERROR), _T("Error"), MB_OK | MB_ICONERROR);
break;
}
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp
index 2cbf0b7237..5a03e985d3 100644
--- a/plugins/TabSRMM/src/sendlater.cpp
+++ b/plugins/TabSRMM/src/sendlater.cpp
@@ -130,7 +130,7 @@ CSendLaterJob::~CSendLaterJob()
if(fSuccess || fFailed) {
POPUPDATAT_V2 ppd = {0};
- if((sendLater->haveErrorPopups() && fFailed) || (sendLater->haveSuccessPopups() && fSuccess)) {
+ if ((sendLater->haveErrorPopups() && fFailed) || (sendLater->haveSuccessPopups() && fSuccess)) {
bool fShowPopup = true;
if(fFailed && bCode == JOB_REMOVABLE) // no popups for jobs removed on user's request
@@ -235,8 +235,8 @@ bool CSendLater::processCurrentJob()
if(m_sendLaterJobList.empty() || m_jobIterator == m_sendLaterJobList.end())
return(false);
- if((*m_jobIterator)->fSuccess || (*m_jobIterator)->fFailed) {
- if((*m_jobIterator)->mustDelete()) {
+ if ((*m_jobIterator)->fSuccess || (*m_jobIterator)->fFailed) {
+ if ((*m_jobIterator)->mustDelete()) {
delete *m_jobIterator;
m_jobIterator = m_sendLaterJobList.erase(m_jobIterator);
}
@@ -313,7 +313,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam)
DBVARIANT dbv = {0};
char *szOrig_Utf = 0;
- if(!m_fAvail || !szSetting || !strcmp(szSetting, "count") || lstrlenA(szSetting) < 8)
+ if (!m_fAvail || !szSetting || !strcmp(szSetting, "count") || lstrlenA(szSetting) < 8)
return(0);
if(szSetting[0] != 'S' && szSetting[0] != 'M')
@@ -325,7 +325,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam)
* check for possible dupes
*/
while(it != m_sendLaterJobList.end()) {
- if((*it)->hContact == hContact && !strcmp((*it)->szId, szSetting)) {
+ if ((*it)->hContact == hContact && !strcmp((*it)->szId, szSetting)) {
return(0);
}
it++;
@@ -339,7 +339,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam)
}
else if(szSetting[0] == 'M') {
char *szSep = strchr(const_cast<char *>(szSetting), '|');
- if(!szSep)
+ if (!szSep)
return(0);
*szSep = 0;
szOrig_Utf = szSep + 1;
@@ -429,10 +429,10 @@ int CSendLater::sendIt(CSendLaterJob *job)
}
CContactCache *c = CContactCache::getContactCache(hContact);
- if(!c)
+ if (!c)
return(0); // should not happen
- if(!c->isValid()) {
+ if (!c->isValid()) {
job->fFailed = true;
job->bCode = CSendLaterJob::INVALID_CONTACT;
return(0); // can happen (contact has been deleted). mark the job as failed
@@ -441,7 +441,7 @@ int CSendLater::sendIt(CSendLaterJob *job)
hContact = c->getActiveContact();
szProto = c->getActiveProto();
- if(!hContact || szProto == 0)
+ if (!hContact || szProto == 0)
return(0);
WORD wMyStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
@@ -455,7 +455,7 @@ int CSendLater::sendIt(CSendLaterJob *job)
return(0);
}
if(job->szId[0] == 'S') {
- if(!(wMyStatus == ID_STATUS_ONLINE || wMyStatus == ID_STATUS_FREECHAT)) {
+ if (!(wMyStatus == ID_STATUS_ONLINE || wMyStatus == ID_STATUS_FREECHAT)) {
job->bCode = CSendLaterJob::JOB_MYSTATUS;
return(0);
}
@@ -489,7 +489,7 @@ int CSendLater::sendIt(CSendLaterJob *job)
void CSendLater::addContact(const HANDLE hContact)
{
- if(!m_fAvail)
+ if (!m_fAvail)
return;
std::vector<HANDLE>::iterator it = m_sendLaterContactList.begin();
@@ -505,7 +505,7 @@ void CSendLater::addContact(const HANDLE hContact)
*/
while(it != m_sendLaterContactList.end()) {
- if(*it == hContact)
+ if (*it == hContact)
return;
it++;
}
@@ -528,10 +528,10 @@ HANDLE CSendLater::processAck(const ACKDATA *ack)
SendLaterJobIterator it = m_sendLaterJobList.begin();
while(it != m_sendLaterJobList.end()) {
- if((*it)->hProcess == ack->hProcess && (*it)->hTargetContact == ack->hContact && !((*it)->fSuccess || (*it)->fFailed)) {
+ if ((*it)->hProcess == ack->hProcess && (*it)->hTargetContact == ack->hContact && !((*it)->fSuccess || (*it)->fFailed)) {
DBEVENTINFO dbei = {0};
- if(!(*it)->fSuccess) {
+ if (!(*it)->fSuccess) {
dbei.cbSize = sizeof(dbei);
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT;
@@ -648,11 +648,11 @@ void CSendLater::qMgrFillList(bool fClear)
mir_free(preview);
mir_free(msg);
- if((*it)->fFailed) {
+ if ((*it)->fFailed) {
tszStatusText = (*it)->bCode == CSendLaterJob::JOB_REMOVABLE ?
CTranslator::get(CTranslator::QMGR_STATUS_REMOVED) : CTranslator::get(CTranslator::QMGR_STATUS_FAILED);
}
- else if((*it)->fSuccess)
+ else if ((*it)->fSuccess)
tszStatusText = CTranslator::get(CTranslator::QMGR_STATUS_SENTOK);
else {
switch((*it)->bCode) {
@@ -670,7 +670,7 @@ void CSendLater::qMgrFillList(bool fClear)
break;
}
}
- if((*it)->bCode)
+ if ((*it)->bCode)
bCode = (*it)->bCode;
mir_sntprintf(tszStatus, 20, _T("X/%s[%c] (%d)"), tszStatusText, bCode, (*it)->iSendCount);
tszStatus[0] = static_cast<TCHAR>((*it)->szId[0]);
@@ -678,7 +678,7 @@ void CSendLater::qMgrFillList(bool fClear)
lvItem.iSubItem = 3;
::SendMessage(m_hwndList, LVM_SETITEM, 0, reinterpret_cast<LPARAM>(&lvItem));
- if((*it)->lastSent == 0)
+ if ((*it)->lastSent == 0)
mir_sntprintf(tszTimestamp, 30, _T("%s"), _T("Never"));
else {
_tcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&(*it)->lastSent));
@@ -823,7 +823,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
/*
* copy to clipboard only allowed with a single selection
*/
- if(::SendMessage(m_hwndList, LVM_GETSELECTEDCOUNT, 0, 0) == 1)
+ if (::SendMessage(m_hwndList, LVM_GETSELECTEDCOUNT, 0, 0) == 1)
::EnableMenuItem(hSubMenu, ID_QUEUEMANAGER_COPYMESSAGETOCLIPBOARD, MF_ENABLED);
m_fIsInteractive = true;
@@ -831,7 +831,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if(selection == ID_QUEUEMANAGER_CANCELALLMULTISENDJOBS) {
SendLaterJobIterator it = m_sendLaterJobList.begin();
while(it != m_sendLaterJobList.end()) {
- if((*it)->szId[0] == 'M') {
+ if ((*it)->szId[0] == 'M') {
(*it)->fFailed = true;
(*it)->bCode = CSendLaterJob::JOB_REMOVABLE;
}
@@ -888,7 +888,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
* exception: kill all open multisend jobs is directly handled from the context menu
*/
case IDC_QMGR_REMOVE: {
- if(::SendMessage(m_hwndList, LVM_GETSELECTEDCOUNT, 0, 0) != 0) {
+ if (::SendMessage(m_hwndList, LVM_GETSELECTEDCOUNT, 0, 0) != 0) {
LVITEM item = {0};
LRESULT items = ::SendMessage(m_hwndList, LVM_GETITEMCOUNT, 0, 0);
item.mask = LVIF_STATE|LVIF_PARAM;
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index b4e90359e9..a608f7006a 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -922,7 +922,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HANDLE hContact, boo
dat->dwFlags &= ~MWF_SAVEBTN_SAV;
mir_free(utfText);
- if(!fAvail)
+ if (!fAvail)
return(0);
}
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp
index 85dbf3e6c3..d5e2e86cdd 100644
--- a/plugins/TabSRMM/src/sidebar.cpp
+++ b/plugins/TabSRMM/src/sidebar.cpp
@@ -332,13 +332,13 @@ int CSideBarButton::testCloseButton() const
if(getLayout()->dwFlags & CSideBar::SIDEBARLAYOUT_VERTICALORIENTATION) {
rc.bottom = rc.top + 18; rc.top += 2;
rc.left += 2; rc.right -= 2;
- if(::PtInRect(&rc, pt))
+ if (::PtInRect(&rc, pt))
return(1);
}
else {
rc.bottom -= 4; rc.top += 4;
rc.right -= 3; rc.left = rc.right - 16;
- if(::PtInRect(&rc, pt))
+ if (::PtInRect(&rc, pt))
return(1);
}
}
@@ -451,7 +451,7 @@ void CSideBar::setVisible(bool fNewVisible)
* only needed on hiding. Layout() will do it when showing it
*/
- if(!m_isVisible)
+ if (!m_isVisible)
showAll(SW_HIDE);
else {
m_up->Show(SW_SHOW);
@@ -531,7 +531,7 @@ void CSideBar::populateAll()
if(item.lParam && ::IsWindow((HWND)item.lParam)) {
TWindowData *dat = (TWindowData *)::GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
if(dat) {
- if((b_item = findSession(dat)) == m_buttonlist.end())
+ if ((b_item = findSession(dat)) == m_buttonlist.end())
addSession(dat, i);
else {
(*b_item)->setLayout(m_currentLayout);
@@ -556,7 +556,7 @@ void CSideBar::populateAll()
*/
void CSideBar::addSession(const TWindowData *dat, int position)
{
- if(!m_isActive)
+ if (!m_isActive)
return;
CSideBarButton *item = new CSideBarButton(dat, this);
@@ -620,7 +620,7 @@ void CSideBar::scrollIntoView(const CSideBarButton *item)
LONG spaceUsed = 0, itemHeight;
bool fNeedLayout = false;
- if(!m_isActive)
+ if (!m_isActive)
return;
if(item == 0)
@@ -631,7 +631,7 @@ void CSideBar::scrollIntoView(const CSideBarButton *item)
while(it != m_buttonlist.end()) {
itemHeight = (*it)->getHeight();
spaceUsed += (itemHeight + 1);
- if(*it == item )
+ if (*it == item )
break;
it++;
}
@@ -677,7 +677,7 @@ void CSideBar::scrollIntoView(const CSideBarButton *item)
*/
void CSideBar::updateSession(const TWindowData *dat)
{
- if(!m_isVisible || !m_isActive)
+ if (!m_isVisible || !m_isActive)
return;
ButtonIterator item = findSession(dat);
@@ -731,7 +731,7 @@ const CSideBarButton* CSideBar::setActiveItem(const TWindowData *dat)
*/
void CSideBar::Layout(const RECT *rc, bool fOnlyCalc)
{
- if(!m_isVisible)
+ if (!m_isVisible)
return;
RECT rcWnd;
@@ -777,14 +777,14 @@ void CSideBar::Layout(const RECT *rc, bool fOnlyCalc)
if ((*item)->isTopAligned()) {
if(m_totalItemHeight <= m_firstVisibleOffset) { // partially visible
- if(!fOnlyCalc)
+ if (!fOnlyCalc)
hdwp = ::DeferWindowPos(hdwp, hwnd, 0, 2, -(m_firstVisibleOffset - m_totalItemHeight),
m_elementWidth, height, SWP_SHOWWINDOW | dwFlags);
spaceUsed += ((height + 1) - (m_firstVisibleOffset - m_totalItemHeight));
m_totalItemHeight += (height + 1);
}
else {
- if(!fOnlyCalc)
+ if (!fOnlyCalc)
hdwp = ::DeferWindowPos(hdwp, hwnd, 0, 2, spaceUsed,
m_elementWidth, height, SWP_SHOWWINDOW | dwFlags);
spaceUsed += (height + 1);
@@ -800,7 +800,7 @@ void CSideBar::Layout(const RECT *rc, bool fOnlyCalc)
::EndDeferWindowPos(hdwp);
//_DebugTraceA("layout: total %d, used: %d, first visible: %d", m_totalItemHeight, spaceUsed, m_firstVisibleOffset);
- if(!fOnlyCalc) {
+ if (!fOnlyCalc) {
RECT rcContainer;
::GetClientRect(m_pContainer->hwnd, &rcContainer);
@@ -849,7 +849,7 @@ ButtonIterator CSideBar::findSession(const TWindowData *dat)
if(m_buttonlist.size() > 0) {
while(item != m_buttonlist.end()) {
- if((*item)->getDat() == dat)
+ if ((*item)->getDat() == dat)
return(item);
item++;
}
@@ -873,7 +873,7 @@ ButtonIterator CSideBar::findSession(const HANDLE hContact)
if(m_buttonlist.size() > 0) {
while(item != m_buttonlist.end()) {
- if((*item)->getContactHandle() == hContact)
+ if ((*item)->getContactHandle() == hContact)
return(item);
item++;
}
@@ -884,7 +884,7 @@ ButtonIterator CSideBar::findSession(const HANDLE hContact)
void CSideBar::processScrollerButtons(UINT commandID)
{
- if(!m_isActive || m_down == 0)
+ if (!m_isActive || m_down == 0)
return;
if(commandID == IDC_SIDEBARDOWN && ::IsWindowEnabled(m_down->getHwnd()))
@@ -897,7 +897,7 @@ void CSideBar::processScrollerButtons(UINT commandID)
void CSideBar::resizeScrollWnd(LONG x, LONG y, LONG width, LONG height) const
{
- if(!m_isVisible || !m_isActive) {
+ if (!m_isVisible || !m_isActive) {
::ShowWindow(m_hwndScrollWnd, SW_HIDE);
return;
}
@@ -1079,7 +1079,7 @@ void __fastcall CSideBar::m_DefaultBackgroundRenderer(const HDC hdc, const RECT
}
else {
RECT *rcDraw = const_cast<RECT *>(rc);
- if(!(id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN)) {
+ if (!(id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN)) {
HBRUSH br = (stateId == PBS_HOT && !fIsActiveItem) ? ::GetSysColorBrush(COLOR_BTNSHADOW) : (fIsActiveItem || stateId == PBS_PRESSED ? ::GetSysColorBrush(COLOR_HOTLIGHT) : ::GetSysColorBrush(COLOR_3DFACE));
::FillRect(hdc, rc, br);
::DrawEdge(hdc, rcDraw, (stateId == PBS_HOT && !fIsActiveItem) ? EDGE_ETCHED : (fIsActiveItem || stateId == PBS_PRESSED) ? EDGE_BUMP : EDGE_ETCHED, BF_RECT | BF_SOFT | BF_FLAT);
@@ -1105,7 +1105,7 @@ void __fastcall CSideBar::m_DefaultContentRenderer(const HDC hdc, const RECT *rc
if(id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN) {
::DrawIconEx(hdc, (rcBox->left + rcBox->right) / 2 - 8, (rcBox->top + rcBox->bottom) / 2 - 8, id == IDC_SIDEBARUP ? PluginConfig.g_buttonBarIcons[26] : PluginConfig.g_buttonBarIcons[16],
16, 16, 0, 0, DI_NORMAL);
- if(!M->isAero() && stateID == PBS_HOT)
+ if (!M->isAero() && stateID == PBS_HOT)
::DrawEdge(hdc, const_cast<RECT *>(rcBox), BDR_INNER, BF_RECT | BF_SOFT | BF_FLAT);
}
else if(dat)
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp
index 2aadbd91f5..4f9827e733 100644
--- a/plugins/TabSRMM/src/tabctrl.cpp
+++ b/plugins/TabSRMM/src/tabctrl.cpp
@@ -1061,7 +1061,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
* option "Show tab bar only when needed".
*/
- if((tabdat->pContainer->dwFlags & CNT_SIDEBAR) || (nCount == 1 && tabdat->pContainer->dwFlags & CNT_HIDETABS)) {
+ if ((tabdat->pContainer->dwFlags & CNT_SIDEBAR) || (nCount == 1 && tabdat->pContainer->dwFlags & CNT_HIDETABS)) {
if(nCount == 0)
FillRect(hdcreal, &ps.rcPaint, GetSysColorBrush(COLOR_3DFACE)); // avoid flickering/ugly black background during container creation
EndPaint(hwnd, &ps);
@@ -1344,7 +1344,7 @@ skip_tabs:
/*
* finally, bitblt the contents of the memory dc to the real dc
*/
- //if(!tabdat->pContainer->bSkinned)
+ //if (!tabdat->pContainer->bSkinned)
if (!tabdat->bRefreshWithoutClip)
ExcludeClipRect(hdcreal, rctClip.left, rctClip.top, rctClip.right, rctClip.bottom);
diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp
index dfe645bd4a..19d042c031 100644
--- a/plugins/TabSRMM/src/taskbar.cpp
+++ b/plugins/TabSRMM/src/taskbar.cpp
@@ -112,7 +112,7 @@ bool CTaskbarInteract::haveLargeIcons()
* always returns S_OK, but the icon is simply ignored when using small taskbar icons.
* also, figure out the button grouping mode.
*/
- if(::RegOpenKey(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"), &hKey) == ERROR_SUCCESS) {
+ if (::RegOpenKey(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"), &hKey) == ERROR_SUCCESS) {
::RegQueryValueEx(hKey, _T("TaskbarSmallIcons"), 0, &dwType, (LPBYTE)&val, &size);
size = 4;
dwType = REG_DWORD;
@@ -281,7 +281,7 @@ CProxyWindow::~CProxyWindow()
*/
void CProxyWindow::verifyDwmState()
{
- if(!M->isDwmActive()) {
+ if (!M->isDwmActive()) {
if(m_thumb) {
delete m_thumb;
m_thumb = 0;
@@ -360,7 +360,7 @@ void CProxyWindow::sendPreview()
* use the last known client area size instead.
*/
- if(!::IsIconic(m_dat->pContainer->hwnd)) {
+ if (!::IsIconic(m_dat->pContainer->hwnd)) {
::GetWindowRect(m_dat->pContainer->hwndActive, &rcLog);
::GetClientRect(m_dat->pContainer->hwnd, &rcContainer);
pt.x = rcLog.left;
@@ -580,7 +580,7 @@ LRESULT CALLBACK CProxyWindow::wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA
SendMessage(m_dat->hwnd, WM_CLOSE, 1, 3);
else
SendMessage(m_dat->hwnd, WM_CLOSE, 1, 2);
- if(!IsIconic(pC->hwnd))
+ if (!IsIconic(pC->hwnd))
SetForegroundWindow(pC->hwnd);
return(0);
}
@@ -832,7 +832,7 @@ void CThumbIM::renderContent()
* status message and bottom line (either UID or nick name, depending on
* task bar grouping mode). For chat rooms, it is the topic.
*/
- if((m_rcBottom.bottom - m_rcBottom.top) < 2 * m_sz.cy)
+ if ((m_rcBottom.bottom - m_rcBottom.top) < 2 * m_sz.cy)
m_dtFlags |= DT_SINGLELINE;
m_rcBottom.bottom -= ((m_rcBottom.bottom - m_rcBottom.top) % m_sz.cy); // adjust to a multiple of line height
@@ -902,7 +902,7 @@ void CThumbMUC::renderContent()
wchar_t* _p = NULL;
if ( m_dat->si->ptszStatusbarText )
_p = wcschr(m_dat->si->ptszStatusbarText, ']');
- if( _p ) {
+ if ( _p ) {
_p++;
wchar_t _t = *_p;
*_p = 0;
@@ -926,7 +926,7 @@ void CThumbMUC::renderContent()
}
}
- if((m_rcBottom.bottom - m_rcBottom.top) < 2 * m_sz.cy)
+ if ((m_rcBottom.bottom - m_rcBottom.top) < 2 * m_sz.cy)
m_dtFlags |= DT_SINGLELINE;
m_rcBottom.bottom -= ((m_rcBottom.bottom - m_rcBottom.top) % m_sz.cy); // adjust to a multiple of line height
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp
index a331d921c1..2eb29884dd 100644
--- a/plugins/TabSRMM/src/themeio.cpp
+++ b/plugins/TabSRMM/src/themeio.cpp
@@ -151,7 +151,7 @@ static void TSAPI LoadLogfontFromINI(int i, char *szKey, LOGFONTA *lf, COLORREF
* filter out font attributes from the message input area font
* (can be disabled by db tweak)
*/
- if(!strcmp(szKey, "Font16") && M->GetByte(0, SRMSGMOD_T, "inputFontFix", 1) == 1) {
+ if (!strcmp(szKey, "Font16") && M->GetByte(0, SRMSGMOD_T, "inputFontFix", 1) == 1) {
lf->lfWeight = FW_NORMAL;
lf->lfItalic = 0;
lf->lfUnderline = 0;
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp
index 65c1ec8e2f..083c827c07 100644
--- a/plugins/TabSRMM/src/themes.cpp
+++ b/plugins/TabSRMM/src/themes.cpp
@@ -857,7 +857,7 @@ TCHAR* CImageItem::Read(const TCHAR *szFilename)
//m_szName[sizeof(m_szName) - 1] = 0;
_tsplitpath(szFilename, szDrive, szPath, NULL, NULL);
mir_sntprintf(szFinalName, MAX_PATH, _T("%s\\%s%s"), szDrive, szPath, buffer);
- if(!PathFileExists(szFinalName)) {
+ if (!PathFileExists(szFinalName)) {
delete[] szFinalName;
szFinalName = 0;
}
@@ -1647,7 +1647,7 @@ void CSkin::Load()
m_fHaveGlyph = false;
if(m_tszFileName[0]) {
- if(::PathFileExists(m_tszFileName)) {
+ if (::PathFileExists(m_tszFileName)) {
TCHAR *p;
TCHAR *szSections = (TCHAR *)malloc(6004);
int i = 1, j = 0;
@@ -1962,7 +1962,7 @@ void CSkin::setupAeroSkins()
HBITMAP hbm;
BITMAP bm;
- if(!m_fAeroSkinsValid)
+ if (!m_fAeroSkinsValid)
return;
mir_sntprintf(tszBasePath, MAX_PATH, _T("%s"), M->getDataPath());
@@ -1974,7 +1974,7 @@ void CSkin::setupAeroSkins()
*/
if(0 == PluginConfig.g_hbmUnknown) {
mir_sntprintf(tszFilename, MAX_PATH, _T("%scustom_unknown.png"), tszBasePath);
- if(!PathFileExists(tszFilename))
+ if (!PathFileExists(tszFilename))
mir_sntprintf(tszFilename, MAX_PATH, _T("%sunknown.png"), tszBasePath);
PluginConfig.g_hbmUnknown = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR);
if (PluginConfig.g_hbmUnknown == 0) {
@@ -1985,7 +1985,7 @@ void CSkin::setupAeroSkins()
}
mir_sntprintf(tszFilename, MAX_PATH, _T("%scustom_tabskin_aero.png"), tszBasePath);
- if(!PathFileExists(tszFilename))
+ if (!PathFileExists(tszFilename))
mir_sntprintf(tszFilename, MAX_PATH, _T("%stabskin_aero.png"), tszBasePath);
if(CMimAPI::m_pfnDwmGetColorizationColor && M->isAero())
@@ -2007,7 +2007,7 @@ void CSkin::setupAeroSkins()
* TODO: this isn't perfect yet, for some colors, the result is a bit off...
*/
- if(!isOpaque && alphafactor > 150 && !(fr == fg && fg == fb)) {
+ if (!isOpaque && alphafactor > 150 && !(fr == fg && fg == fb)) {
float fmax = max(max(fr,fg), fb);
if(fmax == fr) {
@@ -2072,7 +2072,7 @@ void CSkin::setupAeroSkins()
mir_sntprintf(tszFilename, MAX_PATH, _T("%scustom_tabskin_aero_glow.png"), tszBasePath);
- if(!PathFileExists(tszFilename))
+ if (!PathFileExists(tszFilename))
mir_sntprintf(tszFilename, MAX_PATH, _T("%stabskin_aero_glow.png"), tszBasePath);
fib = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR | IMGL_RETURNDIB);
@@ -2107,7 +2107,7 @@ void CSkin::setupAeroSkins()
* background item for the button switch bar
*/
mir_sntprintf(tszFilename, MAX_PATH, _T("%scustom_tabskin_aero_button.png"), tszBasePath);
- if(!PathFileExists(tszFilename))
+ if (!PathFileExists(tszFilename))
mir_sntprintf(tszFilename, MAX_PATH, _T("%stabskin_aero_button.png"), tszBasePath);
hbm = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR);
@@ -2409,7 +2409,7 @@ DWORD __fastcall CSkin::HexStringToLong(const TCHAR *szSource)
int CSkin::RenderText(HDC hdc, HANDLE hTheme, const TCHAR *szText, RECT *rc, DWORD dtFlags, const int iGlowSize, COLORREF clr, bool fForceAero)
{
- if((PluginConfig.m_bIsVista && !CSkin::m_skinEnabled && hTheme) || fForceAero) {
+ if ((PluginConfig.m_bIsVista && !CSkin::m_skinEnabled && hTheme) || fForceAero) {
DTTOPTS dto = {0};
dto.dwSize = sizeof(dto);
if(iGlowSize && (M->isAero() || fForceAero)) {
@@ -2478,7 +2478,7 @@ HBITMAP CSkin::ResizeBitmap(HBITMAP hBmpSrc, LONG width, LONG height, bool &must
*/
bool __fastcall CSkin::DrawItem(const HDC hdc, const RECT *rc, const CSkinItem *item)
{
- if(!item->IGNORED) {
+ if (!item->IGNORED) {
::DrawAlpha(hdc, const_cast<RECT *>(rc), item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT,
item->GRADIENT, item->CORNER, item->BORDERSTYLE, item->imageItem);
return(true);
@@ -2560,7 +2560,7 @@ void CSkin::RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindo
RECT rc, rcToolbar;;
POINT pt;
- if(!(dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR)) {
+ if (!(dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR)) {
::GetWindowRect(::GetDlgItem(dat->hwnd, dat->bType == SESSIONTYPE_CHAT ? IDC_CHAT_LOG : IDC_LOG), &rc);
pt.y = rc.bottom + 0;
::ScreenToClient(dat->hwnd, &pt);
@@ -2616,7 +2616,7 @@ void CSkin::RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindo
dat->pContainer->szOldToolbarSize.cx = cx;
dat->pContainer->szOldToolbarSize.cy = cy;
- if(!fMustDrawNonThemed && M->isVSThemed()) {
+ if (!fMustDrawNonThemed && M->isVSThemed()) {
CMimAPI::m_pfnDrawThemeBackground(dat->hThemeToolbar, dat->pContainer->cachedToolbarDC, 6, 1,
&rcCachedToolbar, &rcCachedToolbar);
dat->pContainer->bTBRenderingMode = 1; // tell TSButton how to render the tool bar buttons
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp
index 5691e71a65..8a311e98f6 100644
--- a/plugins/TabSRMM/src/userprefs.cpp
+++ b/plugins/TabSRMM/src/userprefs.cpp
@@ -278,7 +278,7 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam,
M->WriteDword(hContact, SRMSGMOD_T, "maxhist", 0);
//MAD
- if (IsDlgButtonChecked(hwndDlg, IDC_LOADONLYACTUAL)){
+ if (IsDlgButtonChecked(hwndDlg, IDC_LOADONLYACTUAL)) {
M->WriteByte(hContact, SRMSGMOD_T, "ActualHistory", 1);
if (hWnd && dat) dat->bActualHistory=TRUE;
}else{
@@ -440,7 +440,7 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA
if(hwnd && dat) {
if(dwMask)
*dwActionToTake |= (DWORD)UPREF_ACTION_REMAKELOG;
- if((dat->dwFlags & MWF_LOG_RTL) != (dwFlags & MWF_LOG_RTL))
+ if ((dat->dwFlags & MWF_LOG_RTL) != (dwFlags & MWF_LOG_RTL))
*dwActionToTake |= (DWORD)UPREF_ACTION_APPLYOPTIONS;
}
break;
@@ -562,7 +562,7 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
#endif
LoadLocalFlags(hwnd, dat);
- if((dat->dwFlags & MWF_LOG_ALL) != dwOldFlags) {
+ if ((dat->dwFlags & MWF_LOG_ALL) != dwOldFlags) {
BOOL fShouldHide = TRUE;
if(IsIconic(dat->pContainer->hwnd))
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index f4bd5ab118..66a8effe7a 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -856,7 +856,7 @@ HICON Utils::iconFromAvatar(const TWindowData *dat)
HIMAGELIST hIml_c = 0;
HICON hIcon = 0;
- if(!ServiceExists(MS_AV_GETAVATARBITMAP))
+ if (!ServiceExists(MS_AV_GETAVATARBITMAP))
return(0);
if(dat) {
@@ -955,7 +955,7 @@ void Utils::addMenuItem(const HMENU& m, MENUITEMINFO& mii, HICON hIcon, const TC
*/
int TSAPI Utils::mustPlaySound(const TWindowData *dat)
{
- if(!dat)
+ if (!dat)
return(0);
if(dat->pContainer->fHidden) // hidden container is treated as closed, so play the sound
@@ -1043,11 +1043,11 @@ void TSAPI Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *
char *pData = (char *)LockResource(hResource);
DWORD dwSize = SizeofResource(g_hInst, hRes), written = 0;
mir_sntprintf(szFilename, MAX_PATH, _T("%s%s"), tszPath, tszFilename);
- if(!fForceOverwrite) {
+ if (!fForceOverwrite) {
if(PathFileExists(szFilename))
return;
}
- if((hFile = CreateFile(szFilename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)) != INVALID_HANDLE_VALUE) {
+ if ((hFile = CreateFile(szFilename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)) != INVALID_HANDLE_VALUE) {
WriteFile(hFile, (void *)pData, dwSize, &written, NULL);
CloseHandle(hFile);
}
@@ -1194,7 +1194,7 @@ CWarning::~CWarning()
LRESULT CWarning::ShowDialog() const
{
- if(!m_fIsModal) {
+ if (!m_fIsModal) {
::CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_WARNING), 0, stubDlgProc, reinterpret_cast<LPARAM>(this));
return(0);
}
@@ -1266,7 +1266,7 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt)
_s = const_cast<wchar_t *>(CTranslator::getUntranslatedWarning(uId));
}
}
- else if(-1 == uId && tszTxt) {
+ else if (-1 == uId && tszTxt) {
dwFlags |= CWF_NOALLOWHIDE;
_s = (dwFlags & CWF_UNTRANSLATED ? const_cast<wchar_t *>(tszTxt) : TranslateW(tszTxt));
}
@@ -1274,7 +1274,7 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt)
return(-1);
}
- if((wcslen(_s) > 3) && ((separator_pos = wcschr(_s, '|')) != 0)) {
+ if ((wcslen(_s) > 3) && ((separator_pos = wcschr(_s, '|')) != 0)) {
if(uId >= 0) {
mask = getMask();
@@ -1293,7 +1293,7 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt)
separator_pos[0] = 0;
CWarning *w = new CWarning(s, &separator_pos[1], uId, dwFlags);
- if(!(dwFlags & MB_YESNO || dwFlags & MB_YESNOCANCEL)) {
+ if (!(dwFlags & MB_YESNO || dwFlags & MB_YESNOCANCEL)) {
w->ShowDialog();
mir_free(s);
}
@@ -1412,7 +1412,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
hIcon = ::LoadSkinnedIconBig(SKINICON_EVENT_MESSAGE);
::SendDlgItemMessageW(hwnd, IDC_WARNICON, STM_SETICON, reinterpret_cast<WPARAM>(hIcon), 0);
- if(!(m_dwFlags & MB_YESNO || m_dwFlags & MB_YESNOCANCEL))
+ if (!(m_dwFlags & MB_YESNO || m_dwFlags & MB_YESNOCANCEL))
::ShowWindow(hwnd, SW_SHOWNORMAL);
WindowList_Add(hWindowList, hwnd, hwnd);
@@ -1450,7 +1450,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
case IDCANCEL:
case IDYES:
case IDNO:
- if(!m_fIsModal && (IDOK == LOWORD(wParam) || IDCANCEL == LOWORD(wParam))) { // modeless dialogs can receive a IDCANCEL from destroyAll()
+ if (!m_fIsModal && (IDOK == LOWORD(wParam) || IDCANCEL == LOWORD(wParam))) { // modeless dialogs can receive a IDCANCEL from destroyAll()
::SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
delete this;
WindowList_Remove(hWindowList, hwnd);
@@ -1469,7 +1469,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
newVal = mask | val64;
- if(::IsDlgButtonChecked(hwnd, IDC_DONTSHOWAGAIN)) {
+ if (::IsDlgButtonChecked(hwnd, IDC_DONTSHOWAGAIN)) {
DWORD val = (DWORD)(newVal & 0x00000000ffffffff);
M->WriteDword(SRMSGMOD_T, "cWarningsL", val);
val = (DWORD)((newVal >> 32) & 0x00000000ffffffff);
diff --git a/plugins/TabSRMM/tabmodplus/modplus.cpp b/plugins/TabSRMM/tabmodplus/modplus.cpp
index b20b17c99e..686e171604 100644
--- a/plugins/TabSRMM/tabmodplus/modplus.cpp
+++ b/plugins/TabSRMM/tabmodplus/modplus.cpp
@@ -85,7 +85,7 @@ static TCHAR* getMenuEntry(int i) {
int ChangeClientIconInStatusBar(const TWindowData *dat)
{
- if(!ServiceExists(MS_FP_GETCLIENTICON))
+ if (!ServiceExists(MS_FP_GETCLIENTICON))
return(S_FALSE);
char *msg = getMirVer(dat->hContact);
diff --git a/plugins/TabSRMM/tabsrmm_10.vcxproj b/plugins/TabSRMM/tabsrmm_10.vcxproj
index f6f6421174..96aea9e9be 100644
--- a/plugins/TabSRMM/tabsrmm_10.vcxproj
+++ b/plugins/TabSRMM/tabsrmm_10.vcxproj
@@ -244,67 +244,67 @@
<ClCompile Include="src\utils.cpp" />
<ClCompile Include="chat\clist.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="chat\colorchooser.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="chat\log.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="chat\main.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="chat\manager.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="chat\message.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="chat\muchighlight.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="chat\options.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="chat\services.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="chat\tools.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
<ClCompile Include="chat\window.cpp">
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../commonheaders.h</PrecompiledHeaderFile>
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../src/commonheaders.h</PrecompiledHeaderFile>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../src/commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
diff --git a/plugins/TabSRMM/tabsrmm_10.vcxproj.filters b/plugins/TabSRMM/tabsrmm_10.vcxproj.filters
index 76b1ec3639..6ab4275810 100644
--- a/plugins/TabSRMM/tabsrmm_10.vcxproj.filters
+++ b/plugins/TabSRMM/tabsrmm_10.vcxproj.filters
@@ -261,12 +261,6 @@
</ResourceCompile>
</ItemGroup>
<ItemGroup>
- <None Include="..\..\src\res\cursor_drop_user.cur">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="..\..\src\res\cursor_hyperlink.cur">
- <Filter>Resource Files</Filter>
- </None>
<None Include="docs\changelog.txt">
<Filter>Docs</Filter>
</None>
@@ -282,12 +276,6 @@
<None Include="skin\tabsrmm.tsk">
<Filter>Docs</Filter>
</None>
- <None Include="BuildScripts\VS_2010_Toolset9.bat">
- <Filter>BuildScripts</Filter>
- </None>
- <None Include="..\..\src\res\cursor_drag_copy.CUR">
- <Filter>Resource Files</Filter>
- </None>
<None Include="res\SKIN\tabskin_aero.png">
<Filter>Resource Files</Filter>
</None>
diff --git a/plugins/TipperYM/options.cpp b/plugins/TipperYM/options.cpp
index d5946cae76..cf763bd861 100644
--- a/plugins/TipperYM/options.cpp
+++ b/plugins/TipperYM/options.cpp
@@ -193,7 +193,7 @@ bool LoadDI(DISPLAYITEM *di, int index)
mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index);
di->swzValue[0] = 0;
- if(!DBGetContactSettingTString(0, MODULE_ITEMS, setting, &dbv))
+ if (!DBGetContactSettingTString(0, MODULE_ITEMS, setting, &dbv))
{
_tcsncpy(di->swzValue, dbv.ptszVal, SIZEOF(di->swzValue));
di->swzValue[SIZEOF(di->swzValue) - 1] = 0;
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp
index ac480dc1e6..d21cae65d2 100644
--- a/plugins/TooltipNotify/src/TooltipNotify.cpp
+++ b/plugins/TooltipNotify/src/TooltipNotify.cpp
@@ -727,8 +727,8 @@ BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP
lvi.lParam = i;
#ifdef _UNICODE
WCHAR wszProto[128];
- long lLen = MultiByteToWideChar(CP_ACP, 0, ppProtos[i]->szName,
- strlen(ppProtos[i]->szName), wszProto, ARRAY_SIZE(wszProto));
+ long lLen = MultiByteToWideChar(CP_ACP, 0, ppProtos[i]->szName,
+ (int)strlen(ppProtos[i]->szName), wszProto, ARRAY_SIZE(wszProto));
wszProto[lLen] = L'\0';
lvi.pszText = wszProto;
@@ -1009,7 +1009,7 @@ TCHAR *CTooltipNotify::MakeTooltipString(HANDLE hContact, int iStatus, TCHAR *sz
#ifdef _UNICODE
WCHAR wszProto[32];
- long lLen = MultiByteToWideChar(CP_ACP, 0, szProto, strlen(szProto), wszProto, ARRAY_SIZE(wszProto));
+ long lLen = MultiByteToWideChar(CP_ACP, 0, szProto, (int)strlen(szProto), wszProto, ARRAY_SIZE(wszProto));
wszProto[lLen] = _T('\0');
_sntprintf(szString, iBufSize-1, szFormatString, wszProto, _T(": "), szContactName);
diff --git a/plugins/TooltipNotify/src/TooltipNotify.h b/plugins/TooltipNotify/src/TooltipNotify.h
index 5e17597dd6..00ed0bb932 100644
--- a/plugins/TooltipNotify/src/TooltipNotify.h
+++ b/plugins/TooltipNotify/src/TooltipNotify.h
@@ -126,7 +126,7 @@ private:
{
CTooltipNotify::GetObjInstance()->OnTooltipTimer(hwnd, uMsg, idEvent, dwTime);
}
- static BOOL CALLBACK OptionsDlgProcWrapper(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+ static INT_PTR CALLBACK OptionsDlgProcWrapper(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
return CTooltipNotify::GetObjInstance()->OptionsDlgProc(hDlg, msg, wParam, lParam);
}
diff --git a/plugins/TooltipNotify/src/Utils.cpp b/plugins/TooltipNotify/src/Utils.cpp
index ce73dbc59b..67b9b670b6 100644
--- a/plugins/TooltipNotify/src/Utils.cpp
+++ b/plugins/TooltipNotify/src/Utils.cpp
@@ -14,19 +14,16 @@ BOOL IsNt50()
return (bMajorVer>=5 && bMinorVer>=0);
}
-void TruncateWithDots(TCHAR* szString, int iNewLen)
+void TruncateWithDots(TCHAR* szString, size_t iNewLen)
{
assert(iNewLen >= 0);
- int iOrigLen = _tcslen(szString);
- if (iNewLen < iOrigLen)
- {
+ size_t iOrigLen = _tcslen(szString);
+ if (iNewLen < iOrigLen) {
TCHAR* p = szString+iNewLen;
*p = _T('\0');
for(int i=0; --p>=szString && i<3; i++)
- {
*p = _T('.');
- }
}
}
diff --git a/plugins/TooltipNotify/src/Utils.h b/plugins/TooltipNotify/src/Utils.h
index d1ad4d0fe7..7264e4c27c 100644
--- a/plugins/TooltipNotify/src/Utils.h
+++ b/plugins/TooltipNotify/src/Utils.h
@@ -5,4 +5,4 @@
#pragma once
BOOL IsNt50();
-void TruncateWithDots(TCHAR* szString, int iNewLen); \ No newline at end of file
+void TruncateWithDots(TCHAR* szString, size_t iNewLen); \ No newline at end of file
diff --git a/plugins/TooltipNotify/src/stdafx.h b/plugins/TooltipNotify/src/stdafx.h
index d77c5a3037..d00b996556 100644
--- a/plugins/TooltipNotify/src/stdafx.h
+++ b/plugins/TooltipNotify/src/stdafx.h
@@ -5,7 +5,7 @@
#pragma once
-
+#define _CRT_SECURE_NO_WARNINGS
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define _WIN32_WINNT 0x0500
diff --git a/plugins/TranslitSwitcher/Src/Layoutproc.cpp b/plugins/TranslitSwitcher/Src/Layoutproc.cpp
index ff77523d6c..763b94277a 100644
--- a/plugins/TranslitSwitcher/Src/Layoutproc.cpp
+++ b/plugins/TranslitSwitcher/Src/Layoutproc.cpp
@@ -423,7 +423,7 @@ VOID SwitchLayout(BOOL lastword)
TCHAR szClassName[MAX_PATH];
GetClassName(hwnd2, szClassName, SIZEOF(szClassName));
- if((lstrcmp(szClassName, _T("THppRichEdit.UnicodeClass")) == 0 || lstrcmp(szClassName, _T("THistoryGrid.UnicodeClass")) == 0 || lstrcmp(szClassName, _T("TExtHistoryGrid.UnicodeClass")) == 0 || lstrcmp(szClassName, _T("Internet Explorer_Server")) == 0) && ServiceExists(MS_POPUP_SHOWMESSAGE)) // make popup here
+ if ((lstrcmp(szClassName, _T("THppRichEdit.UnicodeClass")) == 0 || lstrcmp(szClassName, _T("THistoryGrid.UnicodeClass")) == 0 || lstrcmp(szClassName, _T("TExtHistoryGrid.UnicodeClass")) == 0 || lstrcmp(szClassName, _T("Internet Explorer_Server")) == 0) && ServiceExists(MS_POPUP_SHOWMESSAGE)) // make popup here
{
TCHAR buf[2048];
diff --git a/plugins/Updater/allocations.h b/plugins/Updater/allocations.h
index 842d7daf01..719b42383a 100644
--- a/plugins/Updater/allocations.h
+++ b/plugins/Updater/allocations.h
@@ -40,14 +40,14 @@ __inline static void *safe_alloc(size_t bytes) {
}
__inline static char *safe_strdup(const char *s) {
- if(!s) return 0;
+ if (!s) return 0;
char *ret = _strdup(s);
allocations.push_back(ret);
return ret;
}
__inline static wchar_t *safe_wstrdup(const wchar_t *s) {
- if(!s) return 0;
+ if (!s) return 0;
wchar_t *ret = _wcsdup(s);
allocations.push_back(ret);
return ret;
@@ -60,7 +60,7 @@ __inline static wchar_t *safe_wstrdup(const wchar_t *s) {
#endif
__inline static BYTE *safe_bytedup(BYTE *bytes, int size) {
- if(!bytes || size == 0) return 0;
+ if (!bytes || size == 0) return 0;
BYTE *ret = (BYTE *)malloc(size + 1);
memcpy(ret, bytes, size);
diff --git a/plugins/Updater/bzip2-1.0.3/bzlib.c b/plugins/Updater/bzip2-1.0.3/bzlib.c
index bd358a793b..a3015c2533 100644
--- a/plugins/Updater/bzip2-1.0.3/bzlib.c
+++ b/plugins/Updater/bzip2-1.0.3/bzlib.c
@@ -1518,7 +1518,7 @@ void BZ_API(BZ2_bzclose) (BZFILE* b)
if (b==NULL) {return;}
fp = ((bzFile *)b)->handle;
- if(((bzFile*)b)->writing){
+ if (((bzFile*)b)->writing){
BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL);
if(bzerr != BZ_OK){
BZ2_bzWriteClose(NULL,b,1,NULL,NULL);
diff --git a/plugins/Updater/bzip2-1.0.3/dlltest.c b/plugins/Updater/bzip2-1.0.3/dlltest.c
index 03fa14620e..b6e8339226 100644
--- a/plugins/Updater/bzip2-1.0.3/dlltest.c
+++ b/plugins/Updater/bzip2-1.0.3/dlltest.c
@@ -82,13 +82,13 @@ int main(int argc,char *argv[])
BZ2_LIBNAME, BZ2_bzlibVersion() );
#endif
while(++argv,--argc){
- if(**argv =='-' || **argv=='/'){
+ if (**argv =='-' || **argv=='/') {
char *p;
- for(p=*argv+1;*p;p++){
- if(*p=='d'){
+ for(p=*argv+1;*p;p++) {
+ if (*p=='d') {
decompress = 1;
- }else if('1'<=*p && *p<='9'){
+ }else if ('1'<=*p && *p<='9') {
level = *p - '0';
}else{
usage();
@@ -121,7 +121,7 @@ int main(int argc,char *argv[])
FILE *fp_w = NULL;
if(fn_w){
- if((fp_w = fopen(fn_w,"wb"))==NULL){
+ if ((fp_w = fopen(fn_w,"wb"))==NULL){
printf("can't open [%s]\n",fn_w);
perror("reason:");
exit(1);
@@ -129,8 +129,8 @@ int main(int argc,char *argv[])
}else{
fp_w = stdout;
}
- if((fn_r == NULL && (BZ2fp_r = BZ2_bzdopen(fileno(stdin),"rb"))==NULL)
- || (fn_r != NULL && (BZ2fp_r = BZ2_bzopen(fn_r,"rb"))==NULL)){
+ if ((fn_r == NULL && (BZ2fp_r = BZ2_bzdopen(fileno(stdin),"rb"))==NULL)
+ || (fn_r != NULL && (BZ2fp_r = BZ2_bzopen(fn_r,"rb"))==NULL)) {
printf("can't bz2openstream\n");
exit(1);
}
@@ -144,7 +144,7 @@ int main(int argc,char *argv[])
FILE *fp_r = NULL;
if(fn_r){
- if((fp_r = fopen(fn_r,"rb"))==NULL){
+ if ((fp_r = fopen(fn_r,"rb"))==NULL){
printf("can't open [%s]\n",fn_r);
perror("reason:");
exit(1);
@@ -156,8 +156,8 @@ int main(int argc,char *argv[])
mode[1] = '0' + level;
mode[2] = '\0';
- if((fn_w == NULL && (BZ2fp_w = BZ2_bzdopen(fileno(stdout),mode))==NULL)
- || (fn_w !=NULL && (BZ2fp_w = BZ2_bzopen(fn_w,mode))==NULL)){
+ if ((fn_w == NULL && (BZ2fp_w = BZ2_bzdopen(fileno(stdout),mode))==NULL)
+ || (fn_w !=NULL && (BZ2fp_w = BZ2_bzopen(fn_w,mode))==NULL)) {
printf("can't bz2openstream\n");
exit(1);
}
diff --git a/plugins/Updater/conf_comp_dialog.cpp b/plugins/Updater/conf_comp_dialog.cpp
index b2ab25227a..7f7abca925 100644
--- a/plugins/Updater/conf_comp_dialog.cpp
+++ b/plugins/Updater/conf_comp_dialog.cpp
@@ -90,14 +90,14 @@ INT_PTR CALLBACK DlgProcConfirmComponents(HWND hwndDlg, UINT msg, WPARAM wParam,
return TRUE;
case WM_NOTIFY:
- if(((LPNMHDR) lParam)->hwndFrom == GetDlgItem(hwndDlg, IDC_LIST_COMPONENTS)) {
+ if (((LPNMHDR) lParam)->hwndFrom == GetDlgItem(hwndDlg, IDC_LIST_COMPONENTS)) {
switch (((LPNMHDR) lParam)->code) {
case LVN_ITEMCHANGED:
if(GetWindowLongPtr(hwndDlg, GWLP_USERDATA)) {
NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
- if((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK) {
+ if ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK) {
int size = ListView_GetItemCount(GetDlgItem(hwndDlg, IDC_LIST_COMPONENTS));
bool enableOk = false;
@@ -172,7 +172,7 @@ INT_PTR CALLBACK DlgProcConfirmComponents(HWND hwndDlg, UINT msg, WPARAM wParam,
int size = ListView_GetItemCount(GetDlgItem(hwndDlg, IDC_LIST_COMPONENTS));
//bool enableOk = false;
for(int i = 0; i < size; i++) {
- if(!ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_LIST_COMPONENTS), i)) {
+ if (!ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_LIST_COMPONENTS), i)) {
// delete file
ListView_GetItemText(GetDlgItem(hwndDlg, IDC_LIST_COMPONENTS), i, 0, p, MAX_PATH - path_len);
DeleteFile(fname_buff);
diff --git a/plugins/Updater/conf_dialog.cpp b/plugins/Updater/conf_dialog.cpp
index a284952230..6eedb809b3 100644
--- a/plugins/Updater/conf_dialog.cpp
+++ b/plugins/Updater/conf_dialog.cpp
@@ -138,7 +138,7 @@ INT_PTR CALLBACK DlgProcConfirm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
return TRUE;
case WM_NOTIFY:
- if(((LPNMHDR) lParam)->hwndFrom == hwndList) {
+ if (((LPNMHDR) lParam)->hwndFrom == hwndList) {
switch (((LPNMHDR) lParam)->code) {
case LVN_ITEMCHANGED:
@@ -153,13 +153,13 @@ INT_PTR CALLBACK DlgProcConfirm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
ListView_GetItem(hwndList, &lvI);
//if(IsWindowVisible(hwndList) && ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK)) {
- if((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK) {
+ if ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK) {
((UpdateInternal *)lvI.lParam)->update_options.enabled = ListView_GetCheckState(hwndList, nmlv->iItem) != 0;
char stored_setting[256];
mir_snprintf(stored_setting, 256, "DisabledVer%s", ((UpdateInternal *)lvI.lParam)->update.szComponentName);
- if(((UpdateInternal *)lvI.lParam)->update_options.enabled)
+ if (((UpdateInternal *)lvI.lParam)->update_options.enabled)
DBDeleteContactSetting(0, "Updater", stored_setting); // user has re-enabled update to this version - remove setting from db
else
DBWriteContactSettingString(0, "Updater", stored_setting, ((UpdateInternal *)lvI.lParam)->newVersion);
@@ -178,7 +178,7 @@ INT_PTR CALLBACK DlgProcConfirm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
EnableWindow(hwOk, enableOk ? TRUE : FALSE);
}
if(nmlv->uNewState & LVIS_SELECTED) {
- if((!((UpdateInternal *)lvI.lParam)->update_options.use_beta && ((UpdateInternal *)lvI.lParam)->file_id != -1)
+ if ((!((UpdateInternal *)lvI.lParam)->update_options.use_beta && ((UpdateInternal *)lvI.lParam)->file_id != -1)
|| (((UpdateInternal *)lvI.lParam)->update_options.use_beta && ((UpdateInternal *)lvI.lParam)->update.szBetaChangelogURL))
{
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_CHANGELOG), TRUE);
@@ -202,10 +202,10 @@ INT_PTR CALLBACK DlgProcConfirm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
MessageBox(0, _T("LVN_GETDISPINFO (0)"), _T("msg"), MB_OK);
break;
case 1:
- ((NMLVDISPINFO *)lParam)->item.pszText = Translate( u->newVersion );
+ ((NMLVDISPINFO *)lParam)->item.pszText = TranslateTS( _A2T(u->newVersion));
break;
case 2:
- ((NMLVDISPINFO *)lParam)->item.pszText = Translate((char *)u->update.pbVersion);
+ ((NMLVDISPINFO *)lParam)->item.pszText = TranslateTS( _A2T((char *)u->update.pbVersion));
break;
}
}
@@ -231,10 +231,10 @@ INT_PTR CALLBACK DlgProcConfirm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvI.mask = LVIF_PARAM;
ListView_GetItem(hwndList, &lvI);
- if(!((UpdateInternal *)lvI.lParam)->update_options.use_beta && ((UpdateInternal *)lvI.lParam)->file_id != -1) {
+ if (!((UpdateInternal *)lvI.lParam)->update_options.use_beta && ((UpdateInternal *)lvI.lParam)->file_id != -1) {
sprintf(url, MIM_CHANGELOG_URL_PREFIX "%d", ((UpdateInternal *)lvI.lParam)->file_id);
CallService(MS_UTILS_OPENURL, (WPARAM)TRUE, (LPARAM)url);
- } else if(((UpdateInternal *)lvI.lParam)->update_options.use_beta && ((UpdateInternal *)lvI.lParam)->update.szBetaChangelogURL) {
+ } else if (((UpdateInternal *)lvI.lParam)->update_options.use_beta && ((UpdateInternal *)lvI.lParam)->update.szBetaChangelogURL) {
CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)((UpdateInternal *)lvI.lParam)->update.szBetaChangelogURL);
}
diff --git a/plugins/Updater/extern.cpp b/plugins/Updater/extern.cpp
index d33e0c2132..500c11c9de 100644
--- a/plugins/Updater/extern.cpp
+++ b/plugins/Updater/extern.cpp
@@ -87,7 +87,7 @@ int ExternProcess(bool restart)
mir_free(plugins_folder);
/*
- if(!CallService(MS_SYSTEM_OKTOEXIT,0,0)) {
+ if (!CallService(MS_SYSTEM_OKTOEXIT,0,0)) {
DeleteFile(data_filename);
MessageBox(0, TranslateT("Miranda's not 'OK TO EXIT'."), TranslateT("Error"), MB_OK | MB_ICONERROR);
return;
@@ -202,7 +202,7 @@ void MoveFiles(HANDLE hLogFile, TCHAR *src_folder, TCHAR *dst_folder, TCHAR *bac
{
// move files from src_folder to dst_folder
- if(!src_folder || _tcslen(src_folder) == 0) {
+ if (!src_folder || _tcslen(src_folder) == 0) {
MessageBox(0, _T("Your 'temporary files' folder is set to NULL. Install aborted."), _T("Updater Error"), MB_OK | MB_ICONERROR);
return;
}
@@ -251,7 +251,7 @@ void MoveFiles(HANDLE hLogFile, TCHAR *src_folder, TCHAR *dst_folder, TCHAR *bac
{
// exception for langpack files - move to root_folder
// exception for dbtool.exe (e.g. translated) - move to root_folder
- if((_tcsnicmp(findData.cFileName, _T("dbtool.exe"), _tcslen(_T("dbtool.exe"))) == 0)
+ if ((_tcsnicmp(findData.cFileName, _T("dbtool.exe"), _tcslen(_T("dbtool.exe"))) == 0)
|| (_tcsnicmp(findData.cFileName, _T("langpack_"), _tcslen(_T("langpack_"))) == 0))
{
_sntprintf(szNewFileName, SIZEOF(szNewFileName), _T("%s\\%s"), root_folder, findData.cFileName);
@@ -271,7 +271,7 @@ void MoveFiles(HANDLE hLogFile, TCHAR *src_folder, TCHAR *dst_folder, TCHAR *bac
move_file = true;
DeleteFile(szBackupFileName);
- if(!MoveFile(szNewFileName, szBackupFileName))
+ if (!MoveFile(szNewFileName, szBackupFileName))
{
// MessageBox(0, szNewFileName, __T("Could not backup!"), MB_OK | MB_ICONWARNING);
}
@@ -433,7 +433,7 @@ void CALLBACK ExternalUpdate(HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmdLine,
if (res == idContinue) {
//if the user chooses Continue then kill the application
TerminateProcess(hMiranda, 1);
- if((exitStatus = WaitForSingleObjectEx(hMiranda, 5 * 1000, FALSE)) == WAIT_TIMEOUT) {
+ if ((exitStatus = WaitForSingleObjectEx(hMiranda, 5 * 1000, FALSE)) == WAIT_TIMEOUT) {
//hMiranda = OpenProcess(SYNCHRONIZE, FALSE, mpi);
//if(hMiranda) {
//CloseHandle(hMiranda);
diff --git a/plugins/Updater/options.cpp b/plugins/Updater/options.cpp
index 7315ca2858..22ace012a6 100644
--- a/plugins/Updater/options.cpp
+++ b/plugins/Updater/options.cpp
@@ -67,7 +67,7 @@ static int EnumerateFuncFillList(char *szComponentName, UpdateOptions *update_op
lvI.mask = LVIF_TEXT;
lvI.iSubItem = 1;
//lvI.pszText = LPSTR_TEXTCALLBACK;
- if(((int)lvI.lParam & 4) == 4) {
+ if (((int)lvI.lParam & 4) == 4) {
lvI.pszText = (((int)lvI.lParam & 2) == 2 ? TranslateT("FORCED") : TranslateT("N/A"));
} else {
lvI.pszText = (((int)lvI.lParam & 2) == 2 ? TranslateT("TRUE") : TranslateT("FALSE"));
@@ -94,7 +94,7 @@ static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
CheckDlgButton(hwndDlg, IDC_CHK_ONCE, options.check_once);
CheckDlgButton(hwndDlg, IDC_CHK_DAILY, options.check_daily);
- if(!ServiceExists(MS_TRIGGER_REGISTERACTION)) {
+ if (!ServiceExists(MS_TRIGGER_REGISTERACTION)) {
HWND hw = GetDlgItem(hwndDlg, IDC_CHK_NOCONFIDLE);
EnableWindow(hw, (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAILY) ? TRUE : FALSE));
}
@@ -219,7 +219,7 @@ static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
return TRUE;
case IDC_CHK_DAILY:
- if(!ServiceExists(MS_TRIGGER_REGISTERACTION)) {
+ if (!ServiceExists(MS_TRIGGER_REGISTERACTION)) {
HWND hw = GetDlgItem(hwndDlg, IDC_CHK_NOCONFIDLE);
EnableWindow(hw, (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAILY) ? TRUE : FALSE));
}
@@ -253,7 +253,7 @@ static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
break;
case WM_NOTIFY:
- if(((LPNMHDR) lParam)->hwndFrom == GetDlgItem(hwndDlg, IDC_LST_REGISTERED)) {
+ if (((LPNMHDR) lParam)->hwndFrom == GetDlgItem(hwndDlg, IDC_LST_REGISTERED)) {
switch (((LPNMHDR) lParam)->code) {
case NM_CLICK:
if (((LPNMLISTVIEW)lParam)->iSubItem == 1) {
@@ -262,13 +262,13 @@ static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
lvi.iItem = ((LPNMLISTVIEW)lParam)->iItem;
lvi.iSubItem = 0;
SendMessage(GetDlgItem(hwndDlg, IDC_LST_REGISTERED), LVM_GETITEM, 0, (LPARAM)&lvi);
- if(((int)lvi.lParam & 4) == 0) {
+ if (((int)lvi.lParam & 4) == 0) {
lvi.lParam ^= 2;
ListView_SetItem(GetDlgItem(hwndDlg, IDC_LST_REGISTERED), &lvi);
lvi.iSubItem = 1;
lvi.mask = LVIF_TEXT;
- if(((int)lvi.lParam & 4) == 4) {
+ if (((int)lvi.lParam & 4) == 4) {
lvi.pszText = (((int)lvi.lParam & 2) == 2 ? TranslateT("FORCED") : TranslateT("N/A"));
} else {
lvi.pszText = (((int)lvi.lParam & 2) == 2 ? TranslateT("TRUE") : TranslateT("FALSE"));
@@ -300,7 +300,7 @@ static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
MessageBox(0, _T("LVN_GETDISPINFO (0)"), _T("msg"), MB_OK);
break;
case 1:
- if(((int)lvi.lParam & 4) == 4) {
+ if (((int)lvi.lParam & 4) == 4) {
((NMLVDISPINFO *)lParam)->item.pszText = ((lvi.lParam & 2) == 2 ? TranslateT("FORCED") : TranslateT("N/A"));
((NMLVDISPINFO *)lParam)->item.cchTextMax = (int)_tcslen(((NMLVDISPINFO *)lParam)->item.pszText);
} else {
diff --git a/plugins/Updater/scan.cpp b/plugins/Updater/scan.cpp
index ac068ca347..ad8fa165e2 100644
--- a/plugins/Updater/scan.cpp
+++ b/plugins/Updater/scan.cpp
@@ -96,7 +96,7 @@ void ScanPlugins(FilenameMap *fn_map, UpdateList *update_list)
{
dll_info_func = (Miranda_Plugin_Info)GetProcAddress(hModule, "MirandaPluginInfo");
dll_info_func_ex = (Miranda_Plugin_Info_Ex)GetProcAddress(hModule, "MirandaPluginInfoEx");
- if((dll_info_func_ex && (pluginInfo = (PLUGININFO *)dll_info_func_ex(mirandaVersion))) || (dll_info_func && (pluginInfo = dll_info_func(mirandaVersion))))
+ if ((dll_info_func_ex && (pluginInfo = (PLUGININFO *)dll_info_func_ex(mirandaVersion))) || (dll_info_func && (pluginInfo = dll_info_func(mirandaVersion))))
{
// *** This is a dodgy and unfair hack...
// In order to disable new plugins that may be unintentionally installed with an update,
@@ -204,7 +204,7 @@ bool GetLangpackData(const TCHAR *filename, LangpackData *ld)
void ScanLangpacks(FilenameMap *fn_map, UpdateList *update_list)
{
- if(!XMLDataAvailable(MC_LOCALIZATION)) return;
+ if (!XMLDataAvailable(MC_LOCALIZATION)) return;
TCHAR mir_folder[MAX_PATH], langpack_path[MAX_PATH], *langpack_name;
@@ -276,7 +276,7 @@ bool RearrangeDllsWorker(char *shortName, StrList &filenames, TCHAR *basedir)
{
dll_info_func = (Miranda_Plugin_Info)GetProcAddress(hModule, "MirandaPluginInfo");
dll_info_func_ex = (Miranda_Plugin_Info_Ex)GetProcAddress(hModule, "MirandaPluginInfoEx");
- if((dll_info_func_ex && (pluginInfo = (PLUGININFO *)dll_info_func_ex(mirandaVersion))) || (dll_info_func && (pluginInfo = dll_info_func(mirandaVersion))))
+ if ((dll_info_func_ex && (pluginInfo = (PLUGININFO *)dll_info_func_ex(mirandaVersion))) || (dll_info_func && (pluginInfo = dll_info_func(mirandaVersion))))
{
bool found = !_stricmp(pluginInfo->shortName, shortName);
if (!found)
diff --git a/plugins/Updater/services.cpp b/plugins/Updater/services.cpp
index 61e87c3665..8d3883b895 100644
--- a/plugins/Updater/services.cpp
+++ b/plugins/Updater/services.cpp
@@ -56,7 +56,7 @@ bool DownloadUpdates(UpdateList &todo, FilenameMap *map, bool dlls_only) {
mir_snprintf(stored_setting, SIZEOF(stored_setting), "DisabledVer%s", todo[index].update.szComponentName);
DBVARIANT dbv;
bool download = todo[index].update_options.enabled;
- if(!DBGetContactSettingString(0, "Updater", stored_setting, &dbv))
+ if (!DBGetContactSettingString(0, "Updater", stored_setting, &dbv))
{
if(dbv.pszVal && strcmp(dbv.pszVal, todo[index].newVersion) == 0)
download = false;
@@ -129,7 +129,7 @@ bool DownloadUpdates(UpdateList &todo, FilenameMap *map, bool dlls_only) {
//if(hwndPop) PostMessage(hwndPop, WMU_CLOSEPOP, 0, 0);
if (hwndPop) SendMessage(hwndPop, WMU_CLOSEPOP, 0, 0);
- if(!a_download_succeeded)
+ if (!a_download_succeeded)
{
for(int i = 0; i < todo.getCount(); ++i)
free(todo[i].newVersion);
@@ -179,7 +179,7 @@ void CheckForUpdatesWorker(void *param)
if (checking) return;
/*
// this check doesn't work on some systems - not sure which or why
- if(!(GetSystemMetrics(SM_NETWORK) & 1)) {
+ if (!(GetSystemMetrics(SM_NETWORK) & 1)) {
ShowError(TranslateT("No network - aborting update check"));
NLog("worker thread aborting - no network");
return 1; // no network
@@ -231,7 +231,7 @@ void CheckForUpdatesWorker(void *param)
ScanLangpacks(&fn_map, &update_list);
}
- if(!use_popup) SendMessage(hwndProgress, WMU_SETMESSAGE, (WPARAM)TranslateT("Updating component file listing ids"), 0);
+ if (!use_popup) SendMessage(hwndProgress, WMU_SETMESSAGE, (WPARAM)TranslateT("Updating component file listing ids"), 0);
UpdateFLIDs(update_list);
}
@@ -260,7 +260,7 @@ void CheckForUpdatesWorker(void *param)
mir_free(temp_str);
}
- if(!use_popup) {
+ if (!use_popup) {
SendMessage(hwndProgress, WMU_SETMESSAGE, (WPARAM)msg, 0);
SendMessage(hwndProgress, WMU_SETPROGRESS, (WPARAM)(int)(index * 100.0 / count), 0);
} //else if(hwndPop) // disabled - just annoying
@@ -450,7 +450,7 @@ void LoadUpdateOptions(char *szComponentName, UpdateOptions *update_options) {
char buff[256];
sprintf(buff, "Enable%s", szComponentName);
update_options->enabled = (DBGetContactSettingByte(0, MODULE, buff, 1) == 1);
- if(!update_options->fixed) {
+ if (!update_options->fixed) {
sprintf(buff, "UseBeta%s", szComponentName);
update_options->use_beta = (DBGetContactSettingByte(0, MODULE, buff, 0) == 1);
}
@@ -460,7 +460,7 @@ void SaveUpdateOptions(char *szComponentName, UpdateOptions *update_options) {
char buff[256];
sprintf(buff, "Enable%s", szComponentName);
DBWriteContactSettingByte(0, MODULE, buff, update_options->enabled ? 1 : 0);
- if(!update_options->fixed) {
+ if (!update_options->fixed) {
sprintf(buff, "UseBeta%s", szComponentName);
DBWriteContactSettingByte(0, MODULE, buff, update_options->use_beta ? 1 : 0);
}
diff --git a/plugins/Updater/socket.cpp b/plugins/Updater/socket.cpp
index 52a82bd6b1..7b921a42dd 100644
--- a/plugins/Updater/socket.cpp
+++ b/plugins/Updater/socket.cpp
@@ -15,7 +15,7 @@ bool GetFile(char *url, TCHAR *temp_folder, char *plugin_name, char *version, bo
return false;
// ensure temp_folder exists
- if(!CreatePath(options.temp_folder)) {
+ if (!CreatePath(options.temp_folder)) {
NLogF("GetFile: error creating temp folder, code %u", GetLastError());
return false;
}
diff --git a/plugins/Updater/updater_10.vcxproj b/plugins/Updater/updater_10.vcxproj
index 72e9ac10c8..935436291b 100644
--- a/plugins/Updater/updater_10.vcxproj
+++ b/plugins/Updater/updater_10.vcxproj
@@ -255,7 +255,6 @@
<None Include="ue.ico" />
</ItemGroup>
<ItemGroup>
- <ResourceCompile Include="resource.rc" />
<ResourceCompile Include="updater.rc" />
<ResourceCompile Include="version.rc" />
</ItemGroup>
diff --git a/plugins/Updater/updater_10.vcxproj.filters b/plugins/Updater/updater_10.vcxproj.filters
index 7b7157ea9a..99e8f9da46 100644
--- a/plugins/Updater/updater_10.vcxproj.filters
+++ b/plugins/Updater/updater_10.vcxproj.filters
@@ -183,9 +183,6 @@
</None>
</ItemGroup>
<ItemGroup>
- <ResourceCompile Include="resource.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
<ResourceCompile Include="updater.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
diff --git a/plugins/Updater/utils.cpp b/plugins/Updater/utils.cpp
index cd776782f9..6936a905ae 100644
--- a/plugins/Updater/utils.cpp
+++ b/plugins/Updater/utils.cpp
@@ -10,12 +10,12 @@ bool VersionFromString(const char *szVer, DWORD *pdwVer)
int digit_count = 0;
while(*p && bytes <= 4 && digit_count <= 3)
{
- if(*p >= '0' && *p <= '9')
+ if (*p >= '0' && *p <= '9')
{
*pdwVer = (*pdwVer & 0xFFFFFF00) + (*pdwVer & 0xFF) * 10 + (*p - '0');
digit_count++;
}
- else if(*p == '.')
+ else if (*p == '.')
{
*pdwVer = *pdwVer << 8;
bytes++;
diff --git a/plugins/Updater/xmldata.cpp b/plugins/Updater/xmldata.cpp
index 5a7aed440b..3bcf15f24c 100644
--- a/plugins/Updater/xmldata.cpp
+++ b/plugins/Updater/xmldata.cpp
@@ -126,7 +126,7 @@ bool SaveXMLData(const Category cat) {
options.data_folder, (ts = GetTString(category_files[cat])));
mir_free(ts);
- if(!CreatePath(options.data_folder)) {
+ if (!CreatePath(options.data_folder)) {
return false;
}
@@ -144,7 +144,7 @@ bool SaveXMLData(const Category cat) {
return false;
}
-extern "C" void bz_internal_error ( int errcode ){}
+extern "C" void bz_internal_error ( int errcode ) {}
bool bz2_decompress_xml(char *in_data, int in_data_length, BYTE **pDat, int *data_length) {
const int BLOCKSIZE = 1024 * 100;
@@ -238,7 +238,7 @@ bool UpdateXMLData(const Category cat, const char *redirect_url /*= 0*/, int rec
strcat(buff, category_files[cat]);
cgs.szSetting = buff;
cgs.pValue = &dbv;
- if(!CallService(MS_DB_CONTACT_GETSETTING, 0, (LPARAM)&cgs)) {
+ if (!CallService(MS_DB_CONTACT_GETSETTING, 0, (LPARAM)&cgs)) {
req.headersCount = 1;
req.headers = &etag_hdr;
etag_hdr.szName = "If-None-Match";
@@ -250,7 +250,7 @@ bool UpdateXMLData(const Category cat, const char *redirect_url /*= 0*/, int rec
req.cbSize = sizeof(req);
req.requestType = REQUEST_GET;
char URL[MAX_PATH];
- if(!redirect_url) {
+ if (!redirect_url) {
strcpy(URL, MIM_BACKEND_URL_PREFIX);
strcat(URL, category_files[cat]);
strcat(URL, ".bz2");
@@ -313,7 +313,7 @@ bool UpdateXMLData(const Category cat, const char *redirect_url /*= 0*/, int rec
}
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)resp);
resp = 0;
- if(!ret) return LoadOldXMLData(cat, false);
+ if (!ret) return LoadOldXMLData(cat, false);
return ret;
@@ -331,7 +331,7 @@ bool UpdateXMLData(const Category cat, const char *redirect_url /*= 0*/, int rec
// resp->resultCode == 200
hNetlibHttp = resp->nlc;
- if(!bz2_decompress_xml(resp->pData, resp->dataLength, &pData[cat], &dataLength[cat])) {
+ if (!bz2_decompress_xml(resp->pData, resp->dataLength, &pData[cat], &dataLength[cat])) {
ShowError(TranslateT("Failed to decompress XML data"));
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)resp);
resp = 0;
@@ -396,7 +396,7 @@ bool VersionLess(const char *current, const char *potential) {
const char *FindVersion(int file_id, BYTE *pbVersionBytes, int cpbVersionBytes, const Category cat) {
- if(!doc[cat]) return 0;
+ if (!doc[cat]) return 0;
char version_string[128];
strncpy(version_string, (char *)pbVersionBytes, cpbVersionBytes);
diff --git a/plugins/Updater/zbin/minizip/minizip.c b/plugins/Updater/zbin/minizip/minizip.c
index 7a4fa5a643..d979e14bf2 100644
--- a/plugins/Updater/zbin/minizip/minizip.c
+++ b/plugins/Updater/zbin/minizip/minizip.c
@@ -417,18 +417,18 @@ int main(argc,argv)
}
/*should the zip file contain any path at all?*/
- if( opt_exclude_path )
+ if ( opt_exclude_path )
{
const char *tmpptr;
const char *lastslash = 0;
- for( tmpptr = savefilenameinzip; *tmpptr; tmpptr++)
+ for ( tmpptr = savefilenameinzip; *tmpptr; tmpptr++)
{
- if( *tmpptr == '\\' || *tmpptr == '/')
+ if ( *tmpptr == '\\' || *tmpptr == '/')
{
lastslash = tmpptr;
}
}
- if( lastslash != NULL )
+ if ( lastslash != NULL )
{
savefilenameinzip = lastslash+1; // base filename follows last slash.
}
diff --git a/plugins/Updater/zbin/minizip/unzip.c b/plugins/Updater/zbin/minizip/unzip.c
index 44f9876160..2174e2f1c5 100644
--- a/plugins/Updater/zbin/minizip/unzip.c
+++ b/plugins/Updater/zbin/minizip/unzip.c
@@ -753,7 +753,7 @@ local unzFile unzOpenInternal (const void *path,
s=(unz64_s*)ALLOC(sizeof(unz64_s));
- if( s != NULL)
+ if ( s != NULL)
{
*s=us;
unzGoToFirstFile((unzFile)s);
diff --git a/plugins/Updater/zbin/minizip/zip.c b/plugins/Updater/zbin/minizip/zip.c
index 3c34fc8bd4..f672594071 100644
--- a/plugins/Updater/zbin/minizip/zip.c
+++ b/plugins/Updater/zbin/minizip/zip.c
@@ -1587,7 +1587,7 @@ extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_s
zi->ci.stream_initialised = 0;
}
#ifdef HAVE_BZIP2
- else if((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw))
+ else if ((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw))
{
int tmperr = BZ2_bzCompressEnd(&zi->ci.bstream);
if (err==ZIP_OK)
@@ -1650,7 +1650,7 @@ extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_s
{
char* p = NULL;
- if((uLong)(datasize + 4) > zi->ci.size_centralExtraFree)
+ if ((uLong)(datasize + 4) > zi->ci.size_centralExtraFree)
{
// we can not write more data to the buffer that we have room for.
return ZIP_BADZIPFILE;
@@ -1967,7 +1967,7 @@ extern int ZEXPORT zipRemoveExtraInfoBlock (char* pData, int* dataLen, short sHe
header = *(short*)p;
dataSize = *(((short*)p)+1);
- if( header == sHeader ) // Header found.
+ if ( header == sHeader ) // Header found.
{
p += dataSize + 4; // skip it. do not copy to temp buffer
}
diff --git a/plugins/UserInfoEx/Flags/svc_countrylistext.cpp b/plugins/UserInfoEx/Flags/svc_countrylistext.cpp
index 54fcb86675..71b259c7ab 100644
--- a/plugins/UserInfoEx/Flags/svc_countrylistext.cpp
+++ b/plugins/UserInfoEx/Flags/svc_countrylistext.cpp
@@ -301,14 +301,14 @@ INT_PTR ServiceGetCountryByNumber(WPARAM wParam,LPARAM lParam)
int i;
UNREFERENCED_PARAMETER(lParam);
for(i=0; i<SIZEOF(countries); ++i)
- if((int)wParam==countries[i].id)
+ if ((int)wParam==countries[i].id)
return (INT_PTR)countries[i].szName;
return NULL;
}
INT_PTR ServiceGetCountryList(WPARAM wParam,LPARAM lParam)
{
- if((int*)wParam==NULL || (void*)lParam==NULL) return 1;
+ if ((int*)wParam==NULL || (void*)lParam==NULL) return 1;
*(int*)wParam=SIZEOF(countries);
*(struct CountryListEntry**)lParam=countries;
return 0;
@@ -319,8 +319,8 @@ INT_PTR ServiceGetCountryList(WPARAM wParam,LPARAM lParam)
VOID InitCountryListExt()
{
/* hack to replace built-in country list */
- if(!myDestroyServiceFunction(MS_UTILS_GETCOUNTRYLIST))
+ if (!myDestroyServiceFunction(MS_UTILS_GETCOUNTRYLIST))
myCreateServiceFunction(MS_UTILS_GETCOUNTRYLIST,ServiceGetCountryList);
- if(!myDestroyServiceFunction(MS_UTILS_GETCOUNTRYBYNUMBER))
+ if (!myDestroyServiceFunction(MS_UTILS_GETCOUNTRYBYNUMBER))
myCreateServiceFunction(MS_UTILS_GETCOUNTRYBYNUMBER,ServiceGetCountryByNumber);
}
diff --git a/plugins/UserInfoEx/Flags/svc_flags.cpp b/plugins/UserInfoEx/Flags/svc_flags.cpp
index bc3619f273..58fe8eec24 100644
--- a/plugins/UserInfoEx/Flags/svc_flags.cpp
+++ b/plugins/UserInfoEx/Flags/svc_flags.cpp
@@ -91,7 +91,7 @@ static void CALLBACK BufferedProcTimer(HWND hwnd, UINT msg, UINT idTimer, DWORD
for(i=0;i<nCallListCount;++i) {
/* find elapsed procs */
uElapsed=currentTick-callList[i].startTick; /* wraparound works */
- if((uElapsed+USER_TIMER_MINIMUM)>=callList[i].uElapse) {
+ if ((uElapsed+USER_TIMER_MINIMUM)>=callList[i].uElapse) {
/* call elapsed proc */
pfnBuffProc=callList[i].pfnBuffProc;
lParam=callList[i].lParam;
@@ -99,7 +99,7 @@ static void CALLBACK BufferedProcTimer(HWND hwnd, UINT msg, UINT idTimer, DWORD
pszProcName=callList[i].pszProcName;
#endif
/* resize storage array */
- if((i+1)<nCallListCount)
+ if ((i+1)<nCallListCount)
MoveMemory(&callList[i],&callList[i+1],((nCallListCount-i-1)*sizeof(struct BufferedCallData)));
--nCallListCount;
--i; /* reiterate current */
@@ -117,7 +117,7 @@ static void CALLBACK BufferedProcTimer(HWND hwnd, UINT msg, UINT idTimer, DWORD
CallFunctionAsync((void (CALLBACK *)(void*))pfnBuffProc,(void*)lParam); /* compatible */
}
/* find next timer delay */
- else if((callList[i].uElapse-uElapsed)<uElapseNext)
+ else if ((callList[i].uElapse-uElapsed)<uElapseNext)
uElapseNext=callList[i].uElapse-uElapsed;
}
@@ -150,7 +150,7 @@ void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc,LPARAM lParam,BOOL fAccumula
/* find existing */
for(i=0;i<nCallListCount;++i)
if(callList[i].pfnBuffProc==pfnBuffProc)
- if(!fAccumulateSameParam || callList[i].lParam==lParam) {
+ if (!fAccumulateSameParam || callList[i].lParam==lParam) {
data=&callList[i];
break;
}
@@ -173,7 +173,7 @@ void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc,LPARAM lParam,BOOL fAccumula
data->pszProcName=pszProcName;
mir_snprintf(szDbgLine,sizeof(szDbgLine),"buffered queue: %s(0x%X)\n",pszProcName,lParam); /* all ascii */
OutputDebugStringA(szDbgLine);
- if(!idBufferedTimer) {
+ if (!idBufferedTimer) {
mir_snprintf(szDbgLine,sizeof(szDbgLine),"next buffered timeout: %ums\n",uElapse); /* all ascii */
OutputDebugStringA(szDbgLine);
}
@@ -222,7 +222,7 @@ static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM lParam)
else if (countryNumber = (int)DB::Setting::GetWord((HANDLE)wParam,pszProto,"CompanyCountry",0))
return (INT_PTR)countryNumber;
/* fallback ip detect
- else if(countryNumber==0xFFFF && DBGetContactSettingByte(NULL,"Flags","UseIpToCountry",SETTING_USEIPTOCOUNTRY_DEFAULT)){
+ else if(countryNumber==0xFFFF && DBGetContactSettingByte(NULL,"Flags","UseIpToCountry",SETTING_USEIPTOCOUNTRY_DEFAULT)) {
countryNumber=ServiceIpToCountry(DBGetContactSettingDword((HANDLE)wParam,pszProto,"RealIP",0),0);
}*/
@@ -310,7 +310,7 @@ void EnsureExtraImages() //garantieren - sicherstellen - updaten
{
register HANDLE hContact;
//use Clist ExtraImageService?
- if(!myGlobals.ExtraIconsServiceExist) {
+ if (!myGlobals.ExtraIconsServiceExist) {
BYTE idExtraColumnNew = DB::Setting::GetByte(MODNAMEFLAGS,"ExtraImgFlagColumn",SETTING_EXTRAIMGFLAGCOLUMN_DEFAULT);
if(idExtraColumnNew != gFlagsOpts.idExtraColumn) {
/* clear previous column */
@@ -328,11 +328,11 @@ void EnsureExtraImages() //garantieren - sicherstellen - updaten
}
static void CALLBACK UpdateExtraImages(LPARAM lParam) {
- if(!lParam)
+ if (!lParam)
RemoveExtraImages(0);
else EnsureExtraImages();
-/* if(!myGlobals.ExtraIconsServiceExist && !gFlagsOpts.bShowExtraImgFlag)
+/* if (!myGlobals.ExtraIconsServiceExist && !gFlagsOpts.bShowExtraImgFlag)
RemoveExtraImages();
else EnsureExtraImages(); */
}
@@ -364,9 +364,9 @@ static int OnCListApplyIcons(WPARAM wParam,LPARAM lParam) {
//hookProc (ME_DB_CONTACT_SETTINGCHANGED) - workaround for missing event from ExtraIconSvc
static int OnExtraIconSvcChanged(WPARAM wParam,LPARAM lParam) {
DBCONTACTWRITESETTING *dbcws=(DBCONTACTWRITESETTING*)lParam;
- if((HANDLE)wParam!=NULL)return 0;
- if(!lstrcmpA(dbcws->szModule, "ExtraIcons") &&
- !lstrcmpA(dbcws->szSetting,"Slot_Flags") ){
+ if ((HANDLE)wParam!=NULL)return 0;
+ if (!lstrcmpA(dbcws->szModule, "ExtraIcons") &&
+ !lstrcmpA(dbcws->szSetting,"Slot_Flags") ) {
BOOL bEnable;
switch (dbcws->value.type) {
case DBVT_BYTE:
@@ -388,7 +388,7 @@ static int OnExtraIconSvcChanged(WPARAM wParam,LPARAM lParam) {
else if(bEnable && !hApplyIconHook) {
hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
}
- else if(!bEnable && hApplyIconHook) {
+ else if (!bEnable && hApplyIconHook) {
UnhookEvent(hApplyIconHook); hApplyIconHook = NULL;
}
CallFunctionBuffered(UpdateExtraImages,(LPARAM)bEnable,FALSE,EXTRAIMAGE_REFRESHDELAY);
@@ -416,7 +416,7 @@ VOID SvcFlagsEnableExtraIcons(BYTE bColumn, BOOLEAN bUpdateDB) {
LOCALE_USER_DEFAULT,
LOCALE_ICOUNTRY | LOCALE_RETURN_NUMBER ,
(LPTSTR)&langid, sizeof(langid)/sizeof(TCHAR));
- if(!CallService(MS_UTILS_GETCOUNTRYBYNUMBER,langid,0)) langid = 1;
+ if (!CallService(MS_UTILS_GETCOUNTRYBYNUMBER,langid,0)) langid = 1;
EXTRAICON_INFO ico = {0};
ico.cbSize = sizeof(ico);
@@ -440,15 +440,15 @@ VOID SvcFlagsEnableExtraIcons(BYTE bColumn, BOOLEAN bUpdateDB) {
for(int i=0;i<nCountriesCount;++i)
phExtraImageList[i]=INVALID_HANDLE_VALUE;
}
- if(!hRebuildIconsHook) {
+ if (!hRebuildIconsHook) {
hRebuildIconsHook = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, OnCListRebuildIcons);
}
}
//init hooks
- if(!hApplyIconHook) {
+ if (!hApplyIconHook) {
hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
}
- if(!hSettingChangedHook) {
+ if (!hSettingChangedHook) {
hSettingChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
}
}
@@ -498,7 +498,7 @@ MsgWndData::FlagsIconSet() {
sid.cbSize = sizeof(sid);
sid.szModule = MODNAMEFLAGS;
/* ensure status icon is registered */
- if( m_contryID!=0xFFFF || gFlagsOpts.bUseUnknownFlag) {
+ if ( m_contryID!=0xFFFF || gFlagsOpts.bUseUnknownFlag) {
/* copy icon as status icon API will call DestroyIcon() on it */
hIcon = LoadFlagIcon(m_contryID);
sid.hIcon = (hIcon!=NULL)?CopyIcon(hIcon):NULL;
@@ -579,14 +579,14 @@ static __inline int MessageAPI_AddIcon(const char* pszName, const char* szModul/
int res = -1;
IconList* p = new IconList(&sid);
- if(!p->m_ID)delete p;
+ if (!p->m_ID)delete p;
else res = gIListMW.insert(p);
if(res == -1)delete p;
return res;
}
void CALLBACK UpdateStatusIcons(LPARAM lParam) {
- if(!lParam) {
+ if (!lParam) {
/* enum all opened message windows */
for (int i = 0; i < gMsgWndList.getCount(); i++)
gMsgWndList[i]->FlagsIconUpdate();
@@ -655,11 +655,11 @@ static int ExtraImgOptInit(WPARAM wParam,LPARAM lParam)
***********************************************************************************************************/
//hookProc ME_DB_CONTACT_SETTINGCHANGED
static int OnContactSettingChanged(WPARAM wParam,LPARAM lParam) {
- if((HANDLE)wParam==NULL) return 0;
+ if ((HANDLE)wParam==NULL) return 0;
DBCONTACTWRITESETTING *dbcws=(DBCONTACTWRITESETTING*)lParam;
/* user details update */
- if(/*!lstrcmpA(dbcws->szSetting,"RealIP") || */
+ if (/*!lstrcmpA(dbcws->szSetting,"RealIP") || */
!lstrcmpA(dbcws->szSetting,SET_CONTACT_COUNTRY) ||
!lstrcmpA(dbcws->szSetting,SET_CONTACT_ORIGIN_COUNTRY) ||
!lstrcmpA(dbcws->szSetting,SET_CONTACT_COMPANY_COUNTRY))
diff --git a/plugins/UserInfoEx/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/Flags/svc_flagsicons.cpp
index d01941e323..34fec69c39 100644
--- a/plugins/UserInfoEx/Flags/svc_flagsicons.cpp
+++ b/plugins/UserInfoEx/Flags/svc_flagsicons.cpp
@@ -126,7 +126,7 @@ static int CountryNumberToBitmapIndex(int countryNumber)
if(countryNumber>BitmapIndexMap[i]) low=i+1;
else high=i-1;
}*/
- for( i=0; i < high; i++ ){
+ for ( i=0; i < high; i++ ) {
if(BitmapIndexMap[i]==countryNumber) return i;
}
}
@@ -231,7 +231,7 @@ FIBITMAP* LoadResource(UINT ID, LPTSTR lpType)
static INT_PTR ServiceLoadFlagIcon(WPARAM wParam,LPARAM lParam)
{
/* return handle */
- if((BOOL)lParam) {
+ if ((BOOL)lParam) {
if(phIconHandles==NULL) return NULL;
return (INT_PTR)phIconHandles[CountryNumberToIndex((int)wParam)];
}
@@ -358,7 +358,7 @@ VOID InitIcons()
FIP->FI_Unload(dib_mask);
//convert to target resolution
- if(!hbmMask || !(dib_ico = ConvertTo(dib_ico, bitDest, 0))) {
+ if (!hbmMask || !(dib_ico = ConvertTo(dib_ico, bitDest, 0))) {
FIP->FI_Unload(dib_ico);
if(hbmMask) DeleteObject(hbmMask);
return;
@@ -393,7 +393,7 @@ VOID InitIcons()
hScrBM = FIP->FI_CreateHBITMAPFromDIB(dib_ico);
FIP->FI_Unload(dib_ico);
- if(!hScrBM) {
+ if (!hScrBM) {
DeleteObject(hbmMask);
return;
}
diff --git a/plugins/UserInfoEx/UInfoEx_10.vcxproj b/plugins/UserInfoEx/UInfoEx_10.vcxproj
index 5a4ac4b518..12e4bbb4d0 100644
--- a/plugins/UserInfoEx/UInfoEx_10.vcxproj
+++ b/plugins/UserInfoEx/UInfoEx_10.vcxproj
@@ -106,6 +106,8 @@
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -129,6 +131,8 @@
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -154,6 +158,8 @@
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
diff --git a/plugins/UserInfoEx/classMAnnivDate.cpp b/plugins/UserInfoEx/classMAnnivDate.cpp
index 31eeee7cdd..fb487f61d2 100644
--- a/plugins/UserInfoEx/classMAnnivDate.cpp
+++ b/plugins/UserInfoEx/classMAnnivDate.cpp
@@ -546,7 +546,7 @@ INT MAnnivDate::DBMoveBirthDate(HANDLE hContact, BYTE bOld, BYTE bNew) {
Clear();
switch(bOld) {
case 0: //MOD_MBIRTHDAY
- if(!DBGetDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)) {
+ if (!DBGetDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)) {
if(DBWriteDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
return 1;
DBDeleteDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR);
@@ -554,7 +554,7 @@ INT MAnnivDate::DBMoveBirthDate(HANDLE hContact, BYTE bOld, BYTE bNew) {
}
break;
case 1: //USERINFO
- if(!DBGetDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)) {
+ if (!DBGetDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)) {
if(DBWriteDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
return 1;
DB::Setting::WriteByte(hContact, MOD_MBIRTHDAY, "BirthMode", 2);
diff --git a/plugins/UserInfoEx/commonheaders.cpp b/plugins/UserInfoEx/commonheaders.cpp
index f8811bd9c0..a69a664168 100644
--- a/plugins/UserInfoEx/commonheaders.cpp
+++ b/plugins/UserInfoEx/commonheaders.cpp
@@ -176,10 +176,10 @@ unsigned int hashSetting_M2(const wchar_t * key)
INT_PTR myDestroyServiceFunction(const char * key) {
//DestroyServiceFunction always return 0 therfore we must call ServiceExists to enshure it is delete
- if(!ServiceExists(key)) return 0;
+ if (!ServiceExists(key)) return 0;
DestroyServiceFunction((HANDLE)(INT_PTR)hashSetting(key)); //old hash
- if(!ServiceExists(key)) return 0;
+ if (!ServiceExists(key)) return 0;
DestroyServiceFunction((HANDLE)(INT_PTR)hashSetting_M2(key)); //new MurmurHash2
- if(!ServiceExists(key)) return 0;
+ if (!ServiceExists(key)) return 0;
return 1;
}
diff --git a/plugins/UserInfoEx/ctrl_tzcombo.h b/plugins/UserInfoEx/ctrl_tzcombo.h
index d710819441..3034f57481 100644
--- a/plugins/UserInfoEx/ctrl_tzcombo.h
+++ b/plugins/UserInfoEx/ctrl_tzcombo.h
@@ -58,7 +58,7 @@ public:
static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting);
virtual VOID Release();
-// virtual VOID OnReset(){};
+// virtual VOID OnReset() {};
virtual BOOL OnInfoChanged(HANDLE hContact, LPCSTR pszProto);
virtual VOID OnApply(HANDLE hContact, LPCSTR pszProto);
virtual VOID OnChangedByUser(WORD wChangedMsg);
diff --git a/plugins/UserInfoEx/dlg_anniversarylist.cpp b/plugins/UserInfoEx/dlg_anniversarylist.cpp
index a2daefd45d..a7af16c239 100644
--- a/plugins/UserInfoEx/dlg_anniversarylist.cpp
+++ b/plugins/UserInfoEx/dlg_anniversarylist.cpp
@@ -580,9 +580,9 @@ class CAnnivList
{
if (PtrIsValid(pDlg)) {
WINDOWPOS* wndPos = (WINDOWPOS*)lParam;
- if(!pDlg->_wmINIT && (wndPos->cx != 0 || wndPos->cy != 0)) {
+ if (!pDlg->_wmINIT && (wndPos->cx != 0 || wndPos->cy != 0)) {
//win pos change
- if( (wndPos->cx == pDlg->_rcWin.right - pDlg->_rcWin.left) &&
+ if ( (wndPos->cx == pDlg->_rcWin.right - pDlg->_rcWin.left) &&
(wndPos->cy == pDlg->_rcWin.bottom - pDlg->_rcWin.top) ) {
//win pos change (store new pos)
GetWindowRect(hDlg, &pDlg->_rcWin);
@@ -590,7 +590,7 @@ class CAnnivList
//win size change
else {
// l change
- if( (wndPos->cx < pDlg->_sizeMin.cx) && (wndPos->x > pDlg->_rcWin.left) ){
+ if ( (wndPos->cx < pDlg->_sizeMin.cx) && (wndPos->x > pDlg->_rcWin.left) ) {
wndPos->x = wndPos->x + wndPos->cx - pDlg->_sizeMin.cx;
wndPos->cx = pDlg->_sizeMin.cx;
}
@@ -600,7 +600,7 @@ class CAnnivList
}
// t change
- if( (wndPos->cy < pDlg->_sizeMin.cy) && (wndPos->y > pDlg->_rcWin.top) ) {
+ if ( (wndPos->cy < pDlg->_sizeMin.cy) && (wndPos->y > pDlg->_rcWin.top) ) {
wndPos->y = wndPos->y + wndPos->cy - pDlg->_sizeMin.cy;
wndPos->cy = pDlg->_sizeMin.cy;
}
@@ -844,7 +844,7 @@ class CAnnivList
hContact = DB::Contact::FindNext(hContact))
{
// ignore meta subcontacts here, as they are not interesting.
- if (!DB::MetaContact::IsSub(hContact)){
+ if (!DB::MetaContact::IsSub(hContact)) {
// filter protocol
pszProto = DB::Contact::Proto(hContact);
if (pszProto) {
diff --git a/plugins/UserInfoEx/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/ex_import/classExImContactBase.cpp
index c0e0bc05ee..0f75c0df43 100644
--- a/plugins/UserInfoEx/ex_import/classExImContactBase.cpp
+++ b/plugins/UserInfoEx/ex_import/classExImContactBase.cpp
@@ -266,7 +266,7 @@ HANDLE CExImContactBase::toDB()
_hContact = INVALID_HANDLE_VALUE;
return INVALID_HANDLE_VALUE;
}
- if(!IsAccountEnabled(pszAccount)) {
+ if (!IsAccountEnabled(pszAccount)) {
;
}
// create new contact
@@ -347,7 +347,7 @@ VOID CExImContactBase::toIni(FILE* file, int modCount)
ci.szProto = _pszProto;
ci.dwFlag = CNF_DISPLAY;
- if (!GetContactInfo(NULL, (LPARAM) &ci)){
+ if (!GetContactInfo(NULL, (LPARAM) &ci)) {
// CNF_DISPLAY always returns a string type
pszCI = (LPSTR)ci.pszVal;
}
@@ -398,9 +398,9 @@ BOOLEAN CExImContactBase::compareUID(DBVARIANT *dbv)
case DBVT_ASCIIZ:
hash = hashSetting_M2(dbv->pszVal);
case DBVT_WCHAR:
- if(!hash) hash = hashSettingW_M2((const char *)dbv->pwszVal);
+ if (!hash) hash = hashSettingW_M2((const char *)dbv->pwszVal);
case DBVT_UTF8:
- if(!hash) {
+ if (!hash) {
LPWSTR tmp = mir_utf8decodeW(dbv->pszVal);
hash = hashSettingW_M2((const char *)tmp);
mir_free(tmp);
@@ -473,7 +473,7 @@ LPSTR CExImContactBase::uid2String(BOOLEAN bPrependType)
INT_PTR baselen = Base64EncodeGetRequiredLength(_dbvUID.cpbVal, BASE64_FLAG_NOCRLF);
LPSTR t = (LPSTR)mir_alloc(baselen + 5 + bPrependType);
assert(t != NULL);
- if (Base64Encode(_dbvUID.pbVal, _dbvUID.cpbVal, t + bPrependType, &baselen, BASE64_FLAG_NOCRLF)){
+ if (Base64Encode(_dbvUID.pbVal, _dbvUID.cpbVal, t + bPrependType, &baselen, BASE64_FLAG_NOCRLF)) {
if (baselen){
t[baselen + bPrependType] = 0;
if (bPrependType) t[0] = 'n';
diff --git a/plugins/UserInfoEx/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/ex_import/classExImContactXML.cpp
index ecd7bd73c9..11f2aed631 100644
--- a/plugins/UserInfoEx/ex_import/classExImContactXML.cpp
+++ b/plugins/UserInfoEx/ex_import/classExImContactXML.cpp
@@ -438,7 +438,7 @@ INT CExImContactXML::ExportSetting(TiXmlElement *xmlModule, LPCSTR pszModule, LP
str = (LPSTR)mir_alloc(baselen + 6);
assert(str != NULL);
// encode data
- if (Base64Encode(dbv.pbVal, dbv.cpbVal, str+1, &baselen, BASE64_FLAG_NOCRLF)){
+ if (Base64Encode(dbv.pbVal, dbv.cpbVal, str+1, &baselen, BASE64_FLAG_NOCRLF)) {
if (baselen){
str[baselen+1] = 0;
str[0] = 'n';
@@ -683,7 +683,7 @@ INT CExImContactXML::LoadXmlElemnt(TiXmlElement *xContact)
baselen = Base64DecodeGetRequiredLength(len);
pbVal = (PBYTE)mir_alloc(baselen /*+1*/);
if (pbVal != NULL){
- if (Base64Decode(pUID, len, pbVal, &baselen)){
+ if (Base64Decode(pUID, len, pbVal, &baselen)) {
uidn(pbVal, baselen);
}
else {
@@ -934,14 +934,14 @@ INT CExImContactXML::ImportModule(TiXmlNode* xmlModule)
isMetaModule = DB::Module::IsMeta(pszModule);
// just ignore MetaModule on normal contact to avoid errors (only keys)
- if(!isProtoModule && isMetaModule) {
+ if (!isProtoModule && isMetaModule) {
continue;
}
// just ignore MetaModule on Meta to avoid errors (only import spetial keys)
else if(isProtoModule && isMetaModule) {
if (!mir_stricmp(xKey->Attribute("key"),"Nick") ||
!mir_stricmp(xKey->Attribute("key"),"TzName") ||
- !mir_stricmp(xKey->Attribute("key"),"Timezone") ){
+ !mir_stricmp(xKey->Attribute("key"),"Timezone") ) {
if (ImportSetting(pszModule, xKey->ToElement()) == ERROR_OK) {
_pXmlFile->_numSettingsDone++;
}
@@ -1040,7 +1040,7 @@ INT CExImContactXML::ImportSetting(LPCSTR pszModule, TiXmlElement *xmlEntry)
cws.value.type = DBVT_BLOB;
cws.value.pbVal = (PBYTE)mir_alloc(baselen +1);
if (cws.value.pbVal != NULL){
- if (Base64Decode((value + 1), len, cws.value.pbVal, &baselen)){
+ if (Base64Decode((value + 1), len, cws.value.pbVal, &baselen)) {
cws.value.cpbVal = baselen;
}
else {
diff --git a/plugins/UserInfoEx/mir_db.cpp b/plugins/UserInfoEx/mir_db.cpp
index e002bbbdb9..b17dc3e7d0 100644
--- a/plugins/UserInfoEx/mir_db.cpp
+++ b/plugins/UserInfoEx/mir_db.cpp
@@ -1096,7 +1096,7 @@ BYTE GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei)
{
BYTE result;
dbei->cbSize = sizeof(DBEVENTINFO);
- if(!dbei->cbBlob) {
+ if (!dbei->cbBlob) {
INT_PTR size = BlobSizeOf(hEvent);
dbei->cbBlob = (size != -1) ? (DWORD)size : 0;
}
@@ -1225,7 +1225,7 @@ BOOLEAN Exists(HANDLE hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei)
edbe = FindPrev(edbe) ) {
hDbExistingEvent = edbe;
//compare without data (faster)
- if( result = IsEqual(dbei, &edbei, false)) {
+ if ( result = IsEqual(dbei, &edbei, false)) {
if(NULL == (result = !GetInfoWithData(edbe, &edbei))) continue;
//compare with data
result = IsEqual(dbei, &edbei, true);
@@ -1242,7 +1242,7 @@ BOOLEAN Exists(HANDLE hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei)
edbe = FindNext(edbe) ) {
hDbExistingEvent = edbe;
//compare without data (faster)
- if( result = IsEqual(dbei, &edbei, false)) {
+ if ( result = IsEqual(dbei, &edbei, false)) {
if(NULL == (result = !GetInfoWithData(edbe, &edbei))) continue;
//compare with data
result = IsEqual(dbei, &edbei, true);
diff --git a/plugins/UserInfoEx/mir_menuitems.cpp b/plugins/UserInfoEx/mir_menuitems.cpp
index f045751ad7..9fd7f031a6 100644
--- a/plugins/UserInfoEx/mir_menuitems.cpp
+++ b/plugins/UserInfoEx/mir_menuitems.cpp
@@ -486,7 +486,7 @@ VOID RebuildSubGroup()
// Export
strcpy( tDest, "/ExportGroup"); //mi.pszService
- if(!ServiceExists(mi.pszService)) myCreateServiceFunction(mi.pszService, svcExIm_Group_Service);
+ if (!ServiceExists(mi.pszService)) myCreateServiceFunction(mi.pszService, svcExIm_Group_Service);
mi.pszName = mhExIm != HGENMENU_ROOT ? LPGEN("&Export") : LPGEN("&Export Group");
mi.position = 1050200;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXPORT);
@@ -496,7 +496,7 @@ VOID RebuildSubGroup()
// Import
strcpy( tDest, "/ImportGroup"); //mi.pszService
- if(!ServiceExists(mi.pszService)) myCreateServiceFunction(mi.pszService, svcExIm_Group_Service);
+ if (!ServiceExists(mi.pszService)) myCreateServiceFunction(mi.pszService, svcExIm_Group_Service);
mi.pszName = mhExIm != HGENMENU_ROOT ? LPGEN("&Import") : LPGEN("&Import Group");
mi.position = 1050300;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_IMPORT);
@@ -619,7 +619,7 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam)
// Export
strcpy( tDest, "/ExportAccount"); //mi.pszService
- if(!ServiceExists(mi.pszService)) myCreateServiceFunction(mi.pszService, svcExIm_Account_Service);
+ if (!ServiceExists(mi.pszService)) myCreateServiceFunction(mi.pszService, svcExIm_Account_Service);
mir_sntprintf(sztName, SIZEOF(sztName),_T("%s %s"), pAccountName->tszAccountName, TranslateT("&Export"));
mi.ptszName = sztName;
mi.position = 50200;
@@ -628,7 +628,7 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam)
// Import
strcpy( tDest, "/ImportAccount"); //mi.pszService
- if(!ServiceExists(mi.pszService)) myCreateServiceFunction(mi.pszService, svcExIm_Account_Service);
+ if (!ServiceExists(mi.pszService)) myCreateServiceFunction(mi.pszService, svcExIm_Account_Service);
mir_sntprintf(sztName, SIZEOF(sztName),_T("%s %s"), pAccountName->tszAccountName, TranslateT("&Import"));
mi.ptszName = sztName;
mi.position = 50300;
diff --git a/plugins/UserInfoEx/psp_options.cpp b/plugins/UserInfoEx/psp_options.cpp
index 2c7cc2d626..cb82943643 100644
--- a/plugins/UserInfoEx/psp_options.cpp
+++ b/plugins/UserInfoEx/psp_options.cpp
@@ -709,7 +709,7 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam
DBWriteCheckBtn(hDlg, CHECK_OPT_GETCONTACTINFO_ENABLED, SET_GETCONTACTINFO_ENABLED);
DBWriteCheckBtn(hDlg, CHECK_OPT_SREMAIL_ENABLED, SET_EXTENDED_EMAILSERVICE);
- if(!tmi.getTimeZoneTime) {
+ if (!tmi.getTimeZoneTime) {
DBWriteCheckBtn(hDlg, CHECK_OPT_AUTOTIMEZONE, SET_OPT_AUTOTIMEZONE);
if (IsDlgButtonChecked(hDlg, CHECK_OPT_AUTOTIMEZONE)) {
SvcTimezoneSyncWithWindows();
diff --git a/plugins/UserInfoEx/psp_profile.cpp b/plugins/UserInfoEx/psp_profile.cpp
index 1395f43d18..e964db40f6 100644
--- a/plugins/UserInfoEx/psp_profile.cpp
+++ b/plugins/UserInfoEx/psp_profile.cpp
@@ -726,7 +726,7 @@ static INT_PTR CALLBACK ProfileList_LabelEditProc(HWND hwnd, UINT msg, WPARAM wP
// select new list item
lvi.mask = LVIF_STATE;
lvi.state = LVIS_FOCUSED|LVIS_SELECTED;
- if (!ListView_SetItem(pList->hList, &lvi)){
+ if (!ListView_SetItem(pList->hList, &lvi)) {
return 0;
}
}
diff --git a/plugins/UserInfoEx/svc_constants.h b/plugins/UserInfoEx/svc_constants.h
index 575517cf82..2106f9fa3c 100644
--- a/plugins/UserInfoEx/svc_constants.h
+++ b/plugins/UserInfoEx/svc_constants.h
@@ -195,7 +195,7 @@ extern OBJLIST<CService> services;
static __inline HANDLE myCreateServiceFunction( const char * name, MIRANDASERVICE serviceProc)
{
CService* p = new CService(name,serviceProc);
- if(!p->m_hService){delete p; return 0;}
+ if (!p->m_hService){delete p; return 0;}
services.insert(p);
return p->m_hService;
}
diff --git a/plugins/UserInfoEx/svc_email.cpp b/plugins/UserInfoEx/svc_email.cpp
index ff9463c3dd..446556431f 100644
--- a/plugins/UserInfoEx/svc_email.cpp
+++ b/plugins/UserInfoEx/svc_email.cpp
@@ -393,7 +393,7 @@ VOID SvcEMailLoadModule()
disableDefaultModule[DEFMOD_SREMAIL] = TRUE;
// create own email send command
- if(!myDestroyServiceFunction(MS_EMAIL_SENDEMAIL))
+ if (!myDestroyServiceFunction(MS_EMAIL_SENDEMAIL))
myCreateServiceFunction(MS_EMAIL_SENDEMAIL, MenuCommand);
}
}
diff --git a/plugins/Utils/mir_buffer.h b/plugins/Utils/mir_buffer.h
index 492050faf8..3a1f30d558 100644
--- a/plugins/Utils/mir_buffer.h
+++ b/plugins/Utils/mir_buffer.h
@@ -192,7 +192,7 @@ class Buffer
{
alloc(len + n + 1);
- for(; n > 0; n--)
+ for (; n > 0; n--)
{
str[len] = app;
len++;
diff --git a/plugins/Variables/contact.cpp b/plugins/Variables/contact.cpp
index 862beff129..93c48052ec 100644
--- a/plugins/Variables/contact.cpp
+++ b/plugins/Variables/contact.cpp
@@ -228,7 +228,7 @@ static TCHAR* getContactInfo(BYTE type, HANDLE hContact)
case CNF_UNIQUEID:
//UID for ChatRoom
szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if ( szProto != NULL ){
+ if ( szProto != NULL ) {
if ( DBGetContactSettingByte(hContact, szProto, "ChatRoom", 0) == 1) {
DBVARIANT dbv;
if ( !DBGetContactSettingTString(hContact, szProto, "ChatRoomID", &dbv )) {
diff --git a/plugins/YAMN/account.cpp b/plugins/YAMN/account.cpp
index 983bab21f7..d1de8b8e4c 100644
--- a/plugins/YAMN/account.cpp
+++ b/plugins/YAMN/account.cpp
@@ -411,7 +411,7 @@ DWORD ReadMessagesFromMemory(HACCOUNT Which,char **Parser,char *End)
}
else
{
- if (NULL==(ActualMail->Next=CreateAccountMail(Which))){
+ if (NULL==(ActualMail->Next=CreateAccountMail(Which))) {
return EACC_ALLOC;
}
ActualMail=ActualMail->Next;
diff --git a/plugins/YAMN/browser/mailbrowser.cpp b/plugins/YAMN/browser/mailbrowser.cpp
index 7af83115b4..82f4d7eac0 100644
--- a/plugins/YAMN/browser/mailbrowser.cpp
+++ b/plugins/YAMN/browser/mailbrowser.cpp
@@ -603,7 +603,7 @@ int AddNewMailsToListView(HWND hListView,HACCOUNT ActualAccount,struct CMailNumb
item.pszText=L"";
{ CMimeItem *heads;
for (heads=msgq->MailData->TranslatedHeader;heads!=NULL;heads=heads->Next) {
- if (!_stricmp(heads->name,"Date")){
+ if (!_stricmp(heads->name,"Date")) {
MimeDateToLocalizedDateTime(heads->value,LocalDateStr,128);
item.pszText=LocalDateStr;
break;
@@ -667,7 +667,7 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR
{
char sMsg[250];
_snprintf(sMsg,249,Translate("%s : %d new mail message(s), %d total"),ActualAccount->Name,MN->Real.PopUpNC+MN->Virtual.PopUpNC,MN->Real.PopUpTC+MN->Virtual.PopUpTC);
- if (!(nflags & YAMN_ACC_CONTNOEVENT)){
+ if (!(nflags & YAMN_ACC_CONTNOEVENT)) {
CLISTEVENT cEvent;
cEvent.cbSize = sizeof(CLISTEVENT);
cEvent.hContact = ActualAccount->hContact;
@@ -852,7 +852,7 @@ LRESULT CALLBACK NewMailPopUpProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam
memcpy(MailParam,(PINT_PTR)PluginParam,sizeof(YAMN_MAILSHOWPARAM));
hContact = MailParam->account->hContact;
Account = MailParam->account;
- if (NULL!=(MailParam->ThreadRunningEV=CreateEvent(NULL,FALSE,FALSE,NULL))){
+ if (NULL!=(MailParam->ThreadRunningEV=CreateEvent(NULL,FALSE,FALSE,NULL))) {
HANDLE NewThread;
if (NULL!=(NewThread=CreateThread(NULL,0,ShowEmailThread,(LPVOID)MailParam,0,NULL)))
{
@@ -905,7 +905,7 @@ LRESULT CALLBACK NewMailPopUpProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam
DebugLog(SynchroFile,"PopUpProc:LEFTCLICK:ActualAccountSO-read enter failed\n");
#endif
}
- if ((Account->NewMailN.Flags & YAMN_ACC_CONT) && !(Account->NewMailN.Flags & YAMN_ACC_CONTNOEVENT)){
+ if ((Account->NewMailN.Flags & YAMN_ACC_CONT) && !(Account->NewMailN.Flags & YAMN_ACC_CONTNOEVENT)) {
CallService(MS_CLIST_REMOVEEVENT,(WPARAM)hContact,(LPARAM)hContact);
}
}
@@ -1095,8 +1095,8 @@ ULONGLONG MimeDateToFileTime(char *datein)
while (tmp[i]==' ')i++; if (day = strchr(&tmp[i],' ')){day[0]=0; day++;}
}
if (day) {while ( day[0]==' ') day++;if (month= strchr(day, ' ')){month[0]=0; month++;}}
- if (month) {while (month[0]==' ')month++;if (year = strchr(month,' ')){ year[0]=0; year++;}}
- if (year) {while ( year[0]==' ') year++;if (time = strchr(year, ' ')){ time[0]=0; time++;}}
+ if (month) {while (month[0]==' ')month++;if (year = strchr(month,' ')) { year[0]=0; year++;}}
+ if (year) {while ( year[0]==' ') year++;if (time = strchr(year, ' ')) { time[0]=0; time++;}}
if (time) {while ( time[0]==' ') time++;if (shift= strchr(time, ' ')){shift[0]=0; shift++;shift[5]=0;}}
if (year){
@@ -1108,7 +1108,7 @@ ULONGLONG MimeDateToFileTime(char *datein)
if (time) {
char *h, *m, *s;
h = time;
- if (m = strchr(h,':')){
+ if (m = strchr(h,':')) {
m[0]=0; m++;
if (s = strchr(m,':')){s[0] = 0; s++;}
} else s=0;
@@ -1131,7 +1131,7 @@ ULONGLONG MimeDateToFileTime(char *datein)
}
} // if (datein)
FILETIME ft;
- if (SystemTimeToFileTime(&st,&ft)){
+ if (SystemTimeToFileTime(&st,&ft)) {
res = ((ULONGLONG)ft.dwHighDateTime<<32)|((ULONGLONG)ft.dwLowDateTime);
LONGLONG w100nano = Int32x32To64((DWORD)wShiftSeconds,10000000);
res -= w100nano;
@@ -1163,11 +1163,11 @@ void FileTimeToLocalizedDateTime(LONGLONG filetime, WCHAR *dateout, int lendateo
ft.dwLowDateTime = (DWORD)filetime;
ft.dwHighDateTime = (DWORD)(filetime >> 32);
FILETIME localft;
- if (!FileTimeToLocalFileTime(&ft,&localft)){
+ if (!FileTimeToLocalFileTime(&ft,&localft)) {
// this should never happen
wcsncpy(dateout,L"Incorrect FileTime",lendateout);
} else {
- if (!FileTimeToSystemTime(&localft,&st)){
+ if (!FileTimeToSystemTime(&localft,&st)) {
// this should never happen
wcsncpy(dateout,L"Incorrect LocalFileTime",lendateout);
} else {
@@ -1178,7 +1178,7 @@ void FileTimeToLocalizedDateTime(LONGLONG filetime, WCHAR *dateout, int lendateo
templen = GetDateFormatW(localeID,(optDateTime&SHOWDATELONG)?DATE_LONGDATE:DATE_SHORTDATE,&st,NULL,dateout,lendateout-2);
dateout[templen-1] = ' ';
}
- if (templen<(lendateout-1)){
+ if (templen<(lendateout-1)) {
GetTimeFormatW(localeID,(optDateTime&SHOWDATENOSECONDS)?TIME_NOSECONDS:0,&st,NULL,&dateout[templen],lendateout-templen-1);
}
}
@@ -1406,10 +1406,10 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
split=new WCHAR*[count+1];
count=0; ofs=0;
split[0]=str2;
- while (str2[ofs]){
+ while (str2[ofs]) {
if ((str2[ofs]==0x266A)||(str2[ofs]==0x25D9)||(str2[ofs]==0x25CB)||
(str2[ofs]==0x09)||(str2[ofs]==0x0A)||(str2[ofs]==0x0D)) {
- if (str2[ofs-1]){
+ if (str2[ofs-1]) {
count++;
}
split[count]=(WCHAR *)(str2+ofs+1);
@@ -1422,7 +1422,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
item.iItem = 0;
else
item.iItem = 999;
- for (int i=0;i<=count;i++){
+ for (int i=0;i<=count;i++) {
item.iSubItem=0;
if (i==0)
item.pszText=str1;
@@ -1446,11 +1446,11 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
if (contentType) {
if (!_strnicmp(contentType,"text",4)) {
if (transEncoding){
- if (!_stricmp(transEncoding,"base64")){
+ if (!_stricmp(transEncoding,"base64")) {
int size = (int)strlen(body)*3/4+5;
localBody = new char[size+1];
DecodeBase64(body,localBody,size);
- } else if (!_stricmp(transEncoding,"quoted-printable")){
+ } else if (!_stricmp(transEncoding,"quoted-printable")) {
int size = (int)strlen(body)+2;
localBody = new char[size+1];
DecodeQuotedPrintable(body,localBody,size,FALSE);
@@ -1478,7 +1478,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
if (MailParam->mail->Flags & YAMN_MSG_UNSEEN){
MailParam->mail->Flags&=~YAMN_MSG_UNSEEN; //mark the message as seen
HWND hMailBrowser;
- if (hMailBrowser=WindowList_Find(YAMNVar.NewMailAccountWnd,MailParam->account)){
+ if (hMailBrowser=WindowList_Find(YAMNVar.NewMailAccountWnd,MailParam->account)) {
struct CChangeContent Params={MailParam->account->NewMailN.Flags|YAMN_ACC_MSGP,MailParam->account->NoNewMailN.Flags|YAMN_ACC_MSGP};
SendMessageW(hMailBrowser,WM_YAMN_CHANGECONTENT,(WPARAM)MailParam->account,(LPARAM)&Params);
} else {
@@ -1581,7 +1581,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
MoveWindow(hEdit,5,localSplitPos+6,HeadSizeX-10,HeadSizeY-localSplitPos-11,TRUE); //where to put text window while resizing
MoveWindow(hList, 5 ,5 ,HeadSizeX-10 ,(isBodyShown?localSplitPos:HeadSizeY)-10,TRUE); //where to put headers list window while resizing
//if (changeX){
- if (GetClientRect(hList,&coord)){
+ if (GetClientRect(hList,&coord)) {
localSizeX=coord.right-coord.left;
} else localSizeX=HeadSizeX;
LONG iNameWidth = ListView_GetColumnWidth(hList,0);
@@ -1599,7 +1599,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
HTREEITEM hItem = 0;
if (pt.x==-1) pt.x = 0;
if (pt.y==-1) pt.y = 0;
- if (int numRows = ListView_GetItemCount(hList)){
+ if (int numRows = ListView_GetItemCount(hList)) {
HMENU hMenu = CreatePopupMenu();
AppendMenu(hMenu, MF_STRING, (UINT_PTR)1, TranslateT("Copy Selected"));
AppendMenu(hMenu, MF_STRING, (UINT_PTR)2, TranslateT("Copy All"));
@@ -1624,7 +1624,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE,(sizeNeeded+1)*sizeof(TCHAR));
TCHAR *buff = ( TCHAR* )GlobalLock(hData);
int courPos = 0;
- for (courRow=0;courRow<numRows;courRow++){
+ for (courRow=0;courRow<numRows;courRow++) {
if ((nReturnCmd==1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED)==0)) continue;
ListView_GetItemText(hList, courRow, 0, headname, SIZEOF(headname));
ListView_GetItemText(hList, courRow, 1, headvalue, SIZEOF(headvalue));
@@ -1663,7 +1663,7 @@ DWORD WINAPI ShowEmailThread(LPVOID Param){
MyParam.mail->MsgWindow = 0;
goto CREADTEVIEWMESSAGEWINDOW;
}else{
- if (IsIconic(MyParam.mail->MsgWindow)){
+ if (IsIconic(MyParam.mail->MsgWindow)) {
OpenIcon(MyParam.mail->MsgWindow);
}
}
@@ -1672,8 +1672,8 @@ CREADTEVIEWMESSAGEWINDOW:
MyParam.mail->MsgWindow = CreateDialogParamW(YAMNVar.hInst,MAKEINTRESOURCEW(IDD_DLGSHOWMESSAGE),NULL,(DLGPROC)DlgProcYAMNShowMessage,(LPARAM)&MyParam);
WindowList_Add(YAMNVar.MessageWnds,MyParam.mail->MsgWindow,NULL);
MSG msg;
- while(GetMessage(&msg,NULL,0,0)){
- if (!IsDialogMessage(MyParam.mail->MsgWindow, &msg)){
+ while(GetMessage(&msg,NULL,0,0)) {
+ if (!IsDialogMessage(MyParam.mail->MsgWindow, &msg)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
} }
@@ -2013,7 +2013,7 @@ BOOL CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPa
PYAMN_MAILSHOWPARAM MailParam = new YAMN_MAILSHOWPARAM;
MailParam->account = GetWindowAccount(hDlg);
MailParam->mail = ActualMail;
- if (NULL!=(MailParam->ThreadRunningEV=CreateEvent(NULL,FALSE,FALSE,NULL))){
+ if (NULL!=(MailParam->ThreadRunningEV=CreateEvent(NULL,FALSE,FALSE,NULL))) {
HANDLE NewThread;
if (NULL!=(NewThread=CreateThread(NULL,0,ShowEmailThread,MailParam,0,NULL)))
{
@@ -2267,7 +2267,7 @@ BOOL CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPa
break;
case LVN_COLUMNCLICK:
HACCOUNT ActualAccount;
- if (NULL!=(ActualAccount=GetWindowAccount(hDlg))){
+ if (NULL!=(ActualAccount=GetWindowAccount(hDlg))) {
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)lParam;
if (WAIT_OBJECT_0==WaitToReadFcn(ActualAccount->AccountAccessSO))
{
@@ -2393,7 +2393,7 @@ BOOL CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPa
HTREEITEM hItem = 0;
if (pt.x==-1) pt.x = 0;
if (pt.y==-1) pt.y = 0;
- if (int numRows = ListView_GetItemCount(hList)){
+ if (int numRows = ListView_GetItemCount(hList)) {
HMENU hMenu = CreatePopupMenu();
AppendMenu(hMenu, MF_STRING, (UINT_PTR)1, TranslateT("Copy Selected"));
AppendMenu(hMenu, MF_STRING, (UINT_PTR)2, TranslateT("Copy All"));
@@ -2405,7 +2405,7 @@ BOOL CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPa
int courRow=0;
size_t sizeNeeded = 0;
TCHAR from[128]={0}, subject[256]={0}, size[16]={0}, date[64]={0};
- for (courRow=0;courRow<numRows;courRow++){
+ for (courRow=0;courRow<numRows;courRow++) {
if ((nReturnCmd==1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED)==0)) continue;
ListView_GetItemText(hList, courRow, 0, from, SIZEOF(from));
ListView_GetItemText(hList, courRow, 1, subject, SIZEOF(subject));
diff --git a/plugins/YAMN/filter/Base/maindll.cpp b/plugins/YAMN/filter/Base/maindll.cpp
index 6affd00372..d6a645bd14 100644
--- a/plugins/YAMN/filter/Base/maindll.cpp
+++ b/plugins/YAMN/filter/Base/maindll.cpp
@@ -87,7 +87,7 @@ extern "C" int __declspec(dllexport) LoadFilter(MIRANDASERVICE GetYAMNFcnPtr)
InitDebug();
#endif
- if(!LoadRules())
+ if (!LoadRules())
return 0;
pYAMNFcn->RegisterFilterPlugin=(MIRANDASERVICE)GetYAMNFcnPtr((WPARAM)MS_YAMN_REGISTERFILTERPLUGIN,(LPARAM)0);
@@ -96,7 +96,7 @@ extern "C" int __declspec(dllexport) LoadFilter(MIRANDASERVICE GetYAMNFcnPtr)
if(NULL==(POPFilePlugin=(HYAMNFILTERPLUGIN)pYAMNFcn->RegisterFilterPlugin((WPARAM)&FilterRegistration,(LPARAM)YAMN_FILTERREGISTRATIONVERSION)))
return 0;
//And add our imported functions for YAMN
- if(!pYAMNFcn->SetFilterPluginFcnImportFcn(POPFilePlugin,0xb0000000,&FilterFunctions,YAMN_FILTERIMPORTFCNVERSION))
+ if (!pYAMNFcn->SetFilterPluginFcnImportFcn(POPFilePlugin,0xb0000000,&FilterFunctions,YAMN_FILTERIMPORTFCNVERSION))
return 0;
return 1; //Load luccess
}
@@ -136,28 +136,28 @@ DWORD WINAPI FilterMail(HACCOUNT Account,DWORD AccountVer,HYAMNMAIL Mail,DWORD M
#ifdef DEBUG_FILTER
DebugLog(FilterFile,"<New mail>\n");
#endif
- if(!(Mail->Flags & YAMN_MSG_VIRTUAL))
+ if (!(Mail->Flags & YAMN_MSG_VIRTUAL))
for(Browser=Mail->MailData->TranslatedHeader;Browser!=NULL;Browser=Browser->Next) //we browse all header stored in Mail->TranslatedHeader
{
#ifdef DEBUG_FILTER
DebugLog(FilterFile,"<Testing header item %s: %s>\n",Browser->name,Browser->value);
#endif
for(int i=0;i<fts;i++)
- if(!lstrcmpi(Browser->name,ft[i].name))
+ if (!lstrcmpi(Browser->name,ft[i].name))
{
#ifdef DEBUG_FILTER
DebugLog(FilterFile,"\t\t<Found appropriate selector %s>\n",Browser->name);
#endif
if(findsubstr(Browser->value,ft[i].value)) //and if we find
{
- if((ft[i].sl==0) && ((Mail->Flags & YAMN_MSG_SPAMMASK)==0))
+ if ((ft[i].sl==0) && ((Mail->Flags & YAMN_MSG_SPAMMASK)==0))
{
Mail->Flags&=~(YAMN_MSG_POPUP | YAMN_MSG_SYSTRAY | YAMN_MSG_BROWSER | YAMN_MSG_SOUND | YAMN_MSG_APP | YAMN_MSG_NEVENT);
#ifdef DEBUG_FILTER
DebugLog(FilterFile,"\t\tSetting individual flags not to notify mail, but does not consider as spam.");
#endif
}
- else if((Mail->Flags & YAMN_MSG_SPAMMASK) < ft[i].sl) //if some filter plugin set higher level of spam, we do nothing
+ else if ((Mail->Flags & YAMN_MSG_SPAMMASK) < ft[i].sl) //if some filter plugin set higher level of spam, we do nothing
{
Mail->Flags=(Mail->Flags & ~YAMN_MSG_SPAMMASK)+ft[i].sl; //else we set spam level 2 (clearing spam bits and then settting them to level 2
#ifdef DEBUG_FILTER
@@ -232,7 +232,7 @@ int findsubstr(char *original,char *pattern)
int pl=lstrlen(pattern);
for(int i=0;(i+pl)<=ol;i++)
- if(!_strnicmp(original+i,pattern,pl))
+ if (!_strnicmp(original+i,pattern,pl))
return 1;
return 0;
} \ No newline at end of file
diff --git a/plugins/YAMN/filter/Simple/maindll.cpp b/plugins/YAMN/filter/Simple/maindll.cpp
index 77488352b9..62aa87b28d 100644
--- a/plugins/YAMN/filter/Simple/maindll.cpp
+++ b/plugins/YAMN/filter/Simple/maindll.cpp
@@ -67,7 +67,7 @@ extern "C" int __declspec(dllexport) LoadFilter(MIRANDASERVICE GetYAMNFcnPtr)
if(NULL==(POPFilePlugin=(HYAMNFILTERPLUGIN)pYAMNFcn->RegisterFilterPlugin((WPARAM)&FilterRegistration,(LPARAM)YAMN_FILTERREGISTRATIONVERSION)))
return 0;
//And add our imported functions for YAMN
- if(!pYAMNFcn->SetFilterPluginFcnImportFcn(POPFilePlugin,0xb0000000,&FilterFunctions,YAMN_FILTERIMPORTFCNVERSION))
+ if (!pYAMNFcn->SetFilterPluginFcnImportFcn(POPFilePlugin,0xb0000000,&FilterFunctions,YAMN_FILTERIMPORTFCNVERSION))
return 0;
return 1; //Load luccess
}
@@ -105,21 +105,21 @@ DWORD WINAPI FilterMail(HACCOUNT Account,DWORD AccountVer,HYAMNMAIL Mail,DWORD M
return 0;
fp=fopen(FilterPath,"rt");
if(fp != NULL) {
- if(!(Mail->Flags & YAMN_MSG_VIRTUAL))
+ if (!(Mail->Flags & YAMN_MSG_VIRTUAL))
for(Browser=Mail->MailData->TranslatedHeader;Browser!=NULL;Browser=Browser->Next) { //we browse all header stored in Mail->TranslatedHeader
- if((!lstrcmp(Browser->name,"Return-Path")) || (!lstrcmp(Browser->name,"From"))) { //and if we find
+ if ((!lstrcmp(Browser->name,"Return-Path")) || (!lstrcmp(Browser->name,"From"))) { //and if we find
fseek(fp, 0L, SEEK_SET);
while(!feof(fp)) {
if(fscanf(fp, "%255s", EmailSpam) != 0) {
- if(!feof(fp))
+ if (!feof(fp))
if(fscanf(fp, "%d", &spamLevel)==0)
spamLevel=2;
if(spamLevel>4)
spamLevel=2;
if(strstr(Browser->value,EmailSpam)!=NULL) {
- if((Mail->Flags & (YAMN_MSG_SPAMMASK==0)) && (spamLevel==0))
+ if ((Mail->Flags & (YAMN_MSG_SPAMMASK==0)) && (spamLevel==0))
Mail->Flags&=~(YAMN_MSG_SOUND | YAMN_MSG_APP | YAMN_MSG_POPUP | YAMN_MSG_SYSTRAY | YAMN_MSG_BROWSER);
- else if((Mail->Flags & YAMN_MSG_SPAMMASK) < spamLevel) //if some filter plugin set higher level of spam, we do nothing
+ else if ((Mail->Flags & YAMN_MSG_SPAMMASK) < spamLevel) //if some filter plugin set higher level of spam, we do nothing
Mail->Flags=(Mail->Flags & ~YAMN_MSG_SPAMMASK)+spamLevel; //else we set spam level 2 (clearing spam bits and then settting them to level 2
}
}
diff --git a/plugins/YAMN/mails/decode.cpp b/plugins/YAMN/mails/decode.cpp
index 4eeb5b6b76..867ed7ff25 100644
--- a/plugins/YAMN/mails/decode.cpp
+++ b/plugins/YAMN/mails/decode.cpp
@@ -226,10 +226,10 @@ int GetCharsetFromString(char *input,size_t size)
#ifdef DEBUG_DECODECODEPAGE
DebugLog(DecodeFile,"<CodePage>%s</CodePage>",pout);
#endif
- for (int i=0;i<CPLENALL;i++){
+ for (int i=0;i<CPLENALL;i++) {
size_t len = strlen(CodePageNamesAll[i].NameBase);
- if (0==strncmp(pout,CodePageNamesAll[i].NameBase,len)){
- if (0==strcmp(pout+len,CodePageNamesAll[i].NameSub)){
+ if (0==strncmp(pout,CodePageNamesAll[i].NameBase,len)) {
+ if (0==strcmp(pout+len,CodePageNamesAll[i].NameSub)) {
delete[] pout;
return CodePageNamesAll[i].CP;
}
@@ -456,7 +456,7 @@ void ConvertCodedStringToUnicode(char *stream,WCHAR **storeto,DWORD cp,int mode)
size_t outind = 0;
while(*start!=0){
- if (CODES(start)){
+ if (CODES(start)) {
finder=start+2;finderend=finder;
while(!CODED(finderend) && !EOS(finderend)) finderend++;
start = finderend;
@@ -534,7 +534,7 @@ void ConvertCodedStringToUnicode(char *stream,WCHAR **storeto,DWORD cp,int mode)
finderend++;
}
WCHAR *oneWord=0;
- if (ConvertStringToUnicode(DecodedResult,cp,&oneWord)){
+ if (ConvertStringToUnicode(DecodedResult,cp,&oneWord)) {
size_t len = wcslen(oneWord);
memcpy(&tempstore[outind],oneWord,len*sizeof(WCHAR));
outind += len;
diff --git a/plugins/YAMN/mails/mime.cpp b/plugins/YAMN/mails/mime.cpp
index d1e1dd7db2..2a66b80e2b 100644
--- a/plugins/YAMN/mails/mime.cpp
+++ b/plugins/YAMN/mails/mime.cpp
@@ -222,7 +222,7 @@ char *ExtractFromContentType(char *ContentType,char *value)
while(*temp!=0 && *temp!=';') temp++; //jump to the end of setting (to the next ;)
temp--;
while(WS(temp)) temp--; //remove whitespaces from the end
- if (*finder=='\"'){ //remove heading and tailing quotes
+ if (*finder=='\"') { //remove heading and tailing quotes
finder++;
if (*temp=='\"') temp--;
}
@@ -540,7 +540,7 @@ void ParseAPart(APartDataType *data)
prev1=finder;
while(*finder!=':' && !EOS(finder) && !ENDLINE(finder)) finder++;
- if (ENDLINE(finder)||EOS(finder)){
+ if (ENDLINE(finder)||EOS(finder)) {
// no ":" in the line? here the body begins;
data->body = prev1;
break;
@@ -559,9 +559,9 @@ void ParseAPart(APartDataType *data)
while(!ENDLINE(finder) && !EOS(finder)) finder++;
}while(ENDLINEWS(finder));
- if (!_strnicmp(prev1,"Content-type",prev2-prev1)){
+ if (!_strnicmp(prev1,"Content-type",prev2-prev1)) {
data->ContType = prev3;
- } else if (!_strnicmp(prev1,"Content-Transfer-Encoding",prev2-prev1)){
+ } else if (!_strnicmp(prev1,"Content-Transfer-Encoding",prev2-prev1)) {
data->TransEnc = prev3;
}
@@ -622,7 +622,7 @@ WCHAR *ParseMultipartBody(char *src, char *bond)
while (ENDLINE(partData[i].Src)) partData[i].Src++;
}
size_t resultSize=0;
- for (i=0;i<numparts;i++){
+ for (i=0;i<numparts;i++) {
ParseAPart(&partData[i]);
if (partData[i].body){
if (partData[i].TransEnc){
@@ -655,7 +655,7 @@ WCHAR *ParseMultipartBody(char *src, char *bond)
}
ConvertStringToUnicode(localBody?localBody:partData[i].body,partData[i].CodePage,&partData[i].wBody);
if (localBody) delete[] localBody;
- } else if (partData[i].ContType && !_strnicmp(partData[i].ContType,"multipart/",10)){
+ } else if (partData[i].ContType && !_strnicmp(partData[i].ContType,"multipart/",10)) {
//Multipart in mulitipart recursive? should be SPAM. Ah well
char *bondary=NULL;
if (NULL!=(bondary=ExtractFromContentType(partData[i].ContType,"boundary=")))
@@ -673,7 +673,7 @@ FailBackRaw:
}
dest = new WCHAR[resultSize+1];
size_t destpos = 0;
- for (i=0;i<numparts;i++){
+ for (i=0;i<numparts;i++) {
if (i){ // part before first boudary should not have headers
char infoline[104]; size_t linesize = 0;
_snprintf(infoline,100,"%s %d",Translate("Part"),i);
diff --git a/plugins/YAMN/main.cpp b/plugins/YAMN/main.cpp
index d2ccb6769c..b9ff072410 100644
--- a/plugins/YAMN/main.cpp
+++ b/plugins/YAMN/main.cpp
@@ -213,7 +213,7 @@ BOOL CALLBACK EnumSystemCodePagesProc(LPTSTR cpStr)
//Get Code Page name
CPINFOEX info;
- if (GetCPInfoEx(cp, 0, &info)){
+ if (GetCPInfoEx(cp, 0, &info)) {
#ifdef YAMN_DEBUG
BOOLEAN found = FALSE;
#endif
@@ -542,7 +542,7 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
static void UnloadPlugins()
{
for (int i = iDllPlugins-1;i>=0;i--) {
- if (FreeLibrary(hDllPlugins[i])){
+ if (FreeLibrary(hDllPlugins[i])) {
hDllPlugins[i] = NULL; //for safety
iDllPlugins --;
}
diff --git a/plugins/YAMN/proto/pop3/pop3.cpp b/plugins/YAMN/proto/pop3/pop3.cpp
index 152eda6bb2..05e85d7156 100644
--- a/plugins/YAMN/proto/pop3/pop3.cpp
+++ b/plugins/YAMN/proto/pop3/pop3.cpp
@@ -71,7 +71,7 @@ char *CPop3Client::Connect(const char* servername,const int port,BOOL UseSSL, BO
temp = RecvRest(NetClient->Recv(),POP3_SEARCHACK);
extern BOOL SSLLoaded;
- if (!NoTLS & !(SSL)){
+ if (!NoTLS & !(SSL)) {
if (NetClient->Stopped) //check if we can work with this POP3 client session
throw POP3Error=(DWORD)EPOP3_STOPPED;
NetClient->Send("STLS\r\n");
diff --git a/plugins/YAMN/proto/pop3/pop3comm.cpp b/plugins/YAMN/proto/pop3/pop3comm.cpp
index 039cc666c7..dcd38ee2c8 100644
--- a/plugins/YAMN/proto/pop3/pop3comm.cpp
+++ b/plugins/YAMN/proto/pop3/pop3comm.cpp
@@ -411,7 +411,7 @@ HYAMNMAIL WINAPI CreatePOP3Mail(HACCOUNT Account,DWORD MailDataVersion)
}
static void SetContactStatus(HACCOUNT account, int status){
- if ((account->hContact) && (account->NewMailN.Flags & YAMN_ACC_CONT)){
+ if ((account->hContact) && (account->NewMailN.Flags & YAMN_ACC_CONT)) {
DBWriteContactSettingWord(account->hContact, YAMN_DBMODULE, "Status", status);
}
}
@@ -712,7 +712,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
if (MsgQueuePtr->Flags&YAMN_MSG_BODYREQUESTED){
HYAMNMAIL NewMsgsPtr=NULL;
for (NewMsgsPtr=(HYAMNMAIL)NewMails;NewMsgsPtr!=NULL;NewMsgsPtr=NewMsgsPtr->Next){
- if (!strcmp(MsgQueuePtr->ID,NewMsgsPtr->ID)){
+ if (!strcmp(MsgQueuePtr->ID,NewMsgsPtr->ID)) {
TCHAR accstatus[512];
wsprintf(accstatus,TranslateT("Reading body %s"),NewMsgsPtr->ID);
SetAccountStatus(ActualAccount,accstatus);
@@ -770,7 +770,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
#endif
MsgsWriteDone(ActualAccount);
for (MsgQueuePtr=(HYAMNMAIL)ActualAccount->Mails;MsgQueuePtr!=NULL;MsgQueuePtr=MsgQueuePtr->Next){
- if ((MsgQueuePtr->Flags&YAMN_MSG_BODYREQUESTED) && (MsgQueuePtr->Flags&YAMN_MSG_BODYRECEIVED)){
+ if ((MsgQueuePtr->Flags&YAMN_MSG_BODYREQUESTED) && (MsgQueuePtr->Flags&YAMN_MSG_BODYRECEIVED)) {
MsgQueuePtr->Flags&=~YAMN_MSG_BODYREQUESTED;
if (MsgQueuePtr->MsgWindow){
SendMessage(MsgQueuePtr->MsgWindow,WM_YAMN_CHANGECONTENT,0,0);
diff --git a/plugins/YAMN/services.cpp b/plugins/YAMN/services.cpp
index 975c6627e9..b0b524eddc 100644
--- a/plugins/YAMN/services.cpp
+++ b/plugins/YAMN/services.cpp
@@ -382,12 +382,12 @@ void HookEvents(void)
//We set function which registers needed POP3 accounts. This is a part of internal POP3 plugin.
//Your plugin should do the same task in your Load fcn. Why we call it in MODULESLOADED? Because netlib
//user can be registered after all modules are loaded (see m_netlib.h in Miranda)
- for (int i = 0;hookData[i].hookName;i++){
+ for (int i = 0;hookData[i].hookName;i++) {
hookData[i].hookHandle = HookEvent(hookData[i].hookName, hookData[i].mirandaFunction);
}
}
void UnhookEvents(void){
- for (int i = 0;i<(sizeof(hookData)/sizeof(hookData[0]));i++){
+ for (int i = 0;i<(sizeof(hookData)/sizeof(hookData[0]));i++) {
if (hookData[i].hookHandle) UnhookEvent(hookData[i].hookHandle);
}
}
@@ -480,14 +480,14 @@ static ServiceDataType serviceData[] = {
void CreateServiceFunctions(void)
{
- for (int i = 0;serviceData[i].serviceName;i++){
+ for (int i = 0;serviceData[i].serviceName;i++) {
serviceData[i].serviceHandle = CreateServiceFunction(serviceData[i].serviceName, serviceData[i].serviceFunction);
}
};
void DestroyServiceFunctions(void)
{
- for (int i = 0;serviceData[i].serviceName;i++){
+ for (int i = 0;serviceData[i].serviceName;i++) {
if (serviceData[i].serviceHandle) DestroyServiceFunction(serviceData[i].serviceHandle);
}
};
diff --git a/plugins/YAPP/message_pump.cpp b/plugins/YAPP/message_pump.cpp
index 1d88388002..ff35ade82e 100644
--- a/plugins/YAPP/message_pump.cpp
+++ b/plugins/YAPP/message_pump.cpp
@@ -79,7 +79,7 @@ unsigned __stdcall MessagePumpThread(void* param) {
MSG hwndMsg = {0};
while(GetMessage(&hwndMsg, 0, 0, 0) > 0 && !Miranda_Terminated()) {
- if(!IsDialogMessage(hwndMsg.hwnd, &hwndMsg)) {
+ if (!IsDialogMessage(hwndMsg.hwnd, &hwndMsg)) {
switch(hwndMsg.message) {
case MUM_CREATEPOPUP:
{
@@ -87,7 +87,7 @@ unsigned __stdcall MessagePumpThread(void* param) {
int status = CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
if(status >= ID_STATUS_OFFLINE && status <= ID_STATUS_OUTTOLUNCH && options.disable_status[status - ID_STATUS_OFFLINE])
enabled = false;
- if((options.disable_full_screen && is_full_screen()) || is_workstation_locked())
+ if ((options.disable_full_screen && is_full_screen()) || is_workstation_locked())
enabled = false;
PopupData *pd = (PopupData *)hwndMsg.lParam;
diff --git a/plugins/YAPP/options.cpp b/plugins/YAPP/options.cpp
index f039c0e958..d161234afe 100644
--- a/plugins/YAPP/options.cpp
+++ b/plugins/YAPP/options.cpp
@@ -184,7 +184,7 @@ static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
char *strptr;
int i = 0;
- for(; i < 10; i++) {
+ for (; i < 10; i++) {
strptr = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)(ID_STATUS_OFFLINE + i), (LPARAM)0);
lvI.pszText = mir_a2t(strptr);
lvI.iItem = i;
@@ -290,7 +290,7 @@ static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case LVN_ITEMCHANGED:
{
NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
- if((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK) {
+ if ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK) {
SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 );
}
}
@@ -340,7 +340,7 @@ static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
options.global_hover = IsDlgButtonChecked(hwndDlg, IDC_CHK_GLOBALHOVER) ? true : false;
int i = 0;
- for(; i < 10; i++)
+ for (; i < 10; i++)
options.disable_status[i] = (ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_LST_STATUS), i) == 1);
options.disable_full_screen = (ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_LST_STATUS), i) == 1);
diff --git a/plugins/YAPP/popwin.cpp b/plugins/YAPP/popwin.cpp
index 64ed48c347..85fcc6c92a 100644
--- a/plugins/YAPP/popwin.cpp
+++ b/plugins/YAPP/popwin.cpp
@@ -340,7 +340,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
InvalidateRect(hwnd, 0, TRUE);
*/
- if(!IsWindowVisible(hwnd)) {
+ if (!IsWindowVisible(hwnd)) {
ShowWindow(hwnd, SW_SHOWNOACTIVATE);
UpdateWindow(hwnd);
}
@@ -506,7 +506,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
// second line(s)
if(pd->pwzText[0]) {
if(hFontSecondLine) SelectObject(ps.hdc, (HGDIOBJ)hFontSecondLine);
- if(!pwd->custom_col)
+ if (!pwd->custom_col)
SetTextColor(ps.hdc, colSecondLine);
// expand text if no avatar and the time isn't too large
@@ -574,7 +574,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
SetTimer(hwnd, ID_MOVETIMER, 10, 0);
} else {
SetWindowPos(hwnd, 0, (int)wParam, (int)lParam, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
- if(!IsWindowVisible(hwnd)) {
+ if (!IsWindowVisible(hwnd)) {
ShowWindow(hwnd, SW_SHOWNOACTIVATE);
UpdateWindow(hwnd);
}
@@ -669,7 +669,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
else
*pHeight = max(pwd->tb_height + pwd->text_height + 3 * options.padding, pwd->av_height + 2 * options.av_padding);
- if(*pHeight > options.win_max_height) *pHeight = options.win_max_height;
+ if (*pHeight > options.win_max_height) *pHeight = options.win_max_height;
RECT r;
GetWindowRect(hwnd, &r);
diff --git a/plugins/YAPP/services.cpp b/plugins/YAPP/services.cpp
index 857b814790..751b82387e 100644
--- a/plugins/YAPP/services.cpp
+++ b/plugins/YAPP/services.cpp
@@ -69,7 +69,7 @@ INT_PTR OldCreatePopupA(WPARAM wParam, LPARAM lParam) {
lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0));
- if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) {
+ if (!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) {
mir_free(pd_out->pwzTitle);
mir_free(pd_out->pwzText);
mir_free(pd_out);
@@ -106,7 +106,7 @@ INT_PTR OldCreatePopupExA(WPARAM wParam, LPARAM lParam) {
pd_out->timeout = pd_in->iSeconds;
lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0));
- if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) {
+ if (!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) {
mir_free(pd_out->pwzTitle);
mir_free(pd_out->pwzText);
mir_free(pd_out);
@@ -143,7 +143,7 @@ INT_PTR OldCreatePopupW(WPARAM wParam, LPARAM lParam) {
pd_out->timeout = pd_in->iSeconds;
lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0));
- if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) {
+ if (!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) {
mir_free(pd_out->pwzTitle);
mir_free(pd_out->pwzText);
mir_free(pd_out);
@@ -197,7 +197,7 @@ void ShowPopup(PopupData &pd_in)
lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0));
- if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1))
+ if (!DBGetContactSettingByte(0, MODULE, "Enabled", 1))
{
mir_free(pd_out->pwzTitle);
mir_free(pd_out->pwzText);
@@ -352,7 +352,7 @@ INT_PTR PopupChangeW(WPARAM wParam, LPARAM lParam) {
}
INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam) {
- if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) return 0;
+ if (!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) return 0;
POPUPDATAT pd = {0};
_tcscpy(pd.lptzContactName, lParam == SM_WARNING ? _T("Warning") : _T("Notification"));
@@ -367,7 +367,7 @@ INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam) {
}
INT_PTR ShowMessageW(WPARAM wParam, LPARAM lParam) {
- if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) return 0;
+ if (!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) return 0;
POPUPDATAW pd = {0};
wcscpy(pd.lpwzContactName, lParam == SM_WARNING ? L"Warning" : L"Notification");
diff --git a/plugins/ZeroNotification/main.c b/plugins/ZeroNotification/main.c
index 556f8ae282..bcbe63159e 100644
--- a/plugins/ZeroNotification/main.c
+++ b/plugins/ZeroNotification/main.c
@@ -107,14 +107,14 @@ static DWORD MakeCheckBoxTreeFlags(HWND hwndTree)
tvi.hItem=TreeView_GetRoot(hwndTree);
while(tvi.hItem) {
TreeView_GetItem(hwndTree,&tvi);
- if(((tvi.state&TVIS_STATEIMAGEMASK)>>12==2)) flags|=tvi.lParam;
+ if (((tvi.state&TVIS_STATEIMAGEMASK)>>12==2)) flags|=tvi.lParam;
tvi.hItem=TreeView_GetNextSibling(hwndTree,tvi.hItem);
}
return flags;
}
//Update the name on the menu
-static void UpdateMenuItem(){
+static void UpdateMenuItem() {
if (DBGetContactSettingByte(NULL,"Skin","UseSound",1))
mi.pszName= Translate(DISABLE_SOUND);
else
@@ -196,12 +196,12 @@ static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam
case IDC_NOSOUND:
case IDC_NOBLINK:
case IDC_NOCLCBLINK:
- if(((LPNMHDR)lParam)->code==NM_CLICK) {
+ if (((LPNMHDR)lParam)->code==NM_CLICK) {
TVHITTESTINFO hti;
hti.pt.x=(short)LOWORD(GetMessagePos());
hti.pt.y=(short)HIWORD(GetMessagePos());
ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if(TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti)){
+ if(TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti)) {
if(hti.flags&TVHT_ONITEMSTATEICON) {
TVITEM tvi;
tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
diff --git a/plugins/Zlib/zutil.h b/plugins/Zlib/zutil.h
index 4e3dcc6ae9..67771583ac 100644
--- a/plugins/Zlib/zutil.h
+++ b/plugins/Zlib/zutil.h
@@ -219,7 +219,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# include <stdio.h>
extern int ZLIB_INTERNAL z_verbose;
extern void ZLIB_INTERNAL z_error OF((char *m));
-# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
+# define Assert(cond,msg) {if (!(cond)) z_error(msg);}
# define Trace(x) {if (z_verbose>=0) fprintf x ;}
# define Tracev(x) {if (z_verbose>0) fprintf x ;}
# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
diff --git a/plugins/mTextControl/src/FormattedTextDraw.cpp b/plugins/mTextControl/src/FormattedTextDraw.cpp
index 0762e779e9..be42fade65 100644
--- a/plugins/mTextControl/src/FormattedTextDraw.cpp
+++ b/plugins/mTextControl/src/FormattedTextDraw.cpp
@@ -35,7 +35,7 @@ DWORD CALLBACK EditStreamInCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb,
PCOOKIE pCookie = (PCOOKIE) dwCookie;
if (pCookie->isUnicode)
{
- if((pCookie->dwSize - pCookie->dwCount)*sizeof(WCHAR) < (DWORD)cb)
+ if ((pCookie->dwSize - pCookie->dwCount)*sizeof(WCHAR) < (DWORD)cb)
*pcb = (pCookie->dwSize - pCookie->dwCount)*sizeof(WCHAR);
else
*pcb = cb&~1UL;
@@ -497,13 +497,13 @@ HRESULT CFormattedTextDraw::CharFormatFromHFONT(CHARFORMAT2W* pCF, HFONT hFont)
if(lf.lfWeight < FW_BOLD)
pCF->dwEffects &= ~CFE_BOLD;
- if(!lf.lfItalic)
+ if (!lf.lfItalic)
pCF->dwEffects &= ~CFE_ITALIC;
- if(!lf.lfUnderline)
+ if (!lf.lfUnderline)
pCF->dwEffects &= ~CFE_UNDERLINE;
- if(!lf.lfStrikeOut)
+ if (!lf.lfStrikeOut)
pCF->dwEffects &= ~CFE_STRIKEOUT;
pCF->dwMask = CFM_ALL | CFM_BACKCOLOR | CFM_STYLE;
diff --git a/plugins/mTextControl/src/dataobject.cpp b/plugins/mTextControl/src/dataobject.cpp
index 44165fe279..99e0348bc6 100644
--- a/plugins/mTextControl/src/dataobject.cpp
+++ b/plugins/mTextControl/src/dataobject.cpp
@@ -144,7 +144,7 @@ int CDataObject::LookupFormatEtc(FORMATETC *pFormatEtc)
{
for (int i = 0; i < m_nNumFormats; i++)
{
- if((pFormatEtc->tymed & m_pFormatEtc[i].tymed) &&
+ if ((pFormatEtc->tymed & m_pFormatEtc[i].tymed) &&
pFormatEtc->cfFormat == m_pFormatEtc[i].cfFormat &&
pFormatEtc->dwAspect == m_pFormatEtc[i].dwAspect)
{
@@ -165,7 +165,7 @@ HRESULT __stdcall CDataObject::GetData (FORMATETC *pFormatEtc, STGMEDIUM *pMediu
//
// try to match the requested FORMATETC with one of our supported formats
//
- if((idx = LookupFormatEtc(pFormatEtc)) == -1)
+ if ((idx = LookupFormatEtc(pFormatEtc)) == -1)
{
return DV_E_FORMATETC;
}
diff --git a/protocols/AimOscar/connection.cpp b/protocols/AimOscar/connection.cpp
index 79c1e7c41d..81548f875b 100644
--- a/protocols/AimOscar/connection.cpp
+++ b/protocols/AimOscar/connection.cpp
@@ -102,7 +102,7 @@ void CAimProto::aim_connection_authorization(void)
hServerPacketRecver = (HANDLE)CallService(MS_NETLIB_CREATEPACKETRECVER, (WPARAM)hServerConn, 2048 * 4);
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = 5000;
- for(;;)
+ for (;;)
{
int recvResult = CallService(MS_NETLIB_GETMOREPACKETS, (WPARAM) hServerPacketRecver, (LPARAM) & packetRecv);
if (recvResult == 0)
@@ -118,12 +118,12 @@ void CAimProto::aim_connection_authorization(void)
else
{
unsigned short flap_length=0;
- for(;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
+ for (;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
{
- if(!packetRecv.buffer)
+ if (!packetRecv.buffer)
break;
FLAP flap((char*)&packetRecv.buffer[packetRecv.bytesUsed],(unsigned short)(packetRecv.bytesAvailable-packetRecv.bytesUsed));
- if(!flap.len())
+ if (!flap.len())
break;
flap_length+=FLAP_SIZE+flap.len();
if (flap.cmp(0x01))
@@ -180,7 +180,7 @@ void __cdecl CAimProto::aim_protocol_negotiation( void* )
NETLIBPACKETRECVER packetRecv = {0};
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = DEFAULT_KEEPALIVE_TIMER*1000;
- for(;;)
+ for (;;)
{
int recvResult = CallService(MS_NETLIB_GETMOREPACKETS, (WPARAM)hServerPacketRecver, (LPARAM)&packetRecv);
if (recvResult == 0)
@@ -204,12 +204,12 @@ void __cdecl CAimProto::aim_protocol_negotiation( void* )
else if(recvResult>0)
{
unsigned short flap_length=0;
- for(;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
+ for (;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
{
- if(!packetRecv.buffer)
+ if (!packetRecv.buffer)
break;
FLAP flap((char*)&packetRecv.buffer[packetRecv.bytesUsed],packetRecv.bytesAvailable-packetRecv.bytesUsed);
- if(!flap.len())
+ if (!flap.len())
break;
flap_length+=FLAP_SIZE+flap.len();
if(flap.cmp(0x01))
@@ -314,12 +314,12 @@ void __cdecl CAimProto::aim_mail_negotiation( void* )
if(recvResult>0)
{
unsigned short flap_length=0;
- for(;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
+ for (;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
{
- if(!packetRecv.buffer)
+ if (!packetRecv.buffer)
break;
FLAP flap((char*)&packetRecv.buffer[packetRecv.bytesUsed],packetRecv.bytesAvailable-packetRecv.bytesUsed);
- if(!flap.len())
+ if (!flap.len())
break;
flap_length+=FLAP_SIZE+flap.len();
if(flap.cmp(0x01))
@@ -364,7 +364,7 @@ void __cdecl CAimProto::aim_avatar_negotiation( void* )
NETLIBPACKETRECVER packetRecv = {0};
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = 300000;//5 minutes connected
- for(;;)
+ for (;;)
{
int recvResult = CallService(MS_NETLIB_GETMOREPACKETS, (WPARAM) hServerPacketRecver, (LPARAM) & packetRecv);
if (recvResult == 0)
@@ -376,7 +376,7 @@ void __cdecl CAimProto::aim_avatar_negotiation( void* )
if (recvResult > 0)
{
unsigned short flap_length=0;
- for(; packetRecv.bytesUsed < packetRecv.bytesAvailable; packetRecv.bytesUsed = flap_length)
+ for (; packetRecv.bytesUsed < packetRecv.bytesAvailable; packetRecv.bytesUsed = flap_length)
{
if (!packetRecv.buffer)
break;
@@ -429,7 +429,7 @@ void __cdecl CAimProto::aim_chatnav_negotiation( void* )
NETLIBPACKETRECVER packetRecv = {0};
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = DEFAULT_KEEPALIVE_TIMER*1000;
- for(;;)
+ for (;;)
{
int recvResult = CallService(MS_NETLIB_GETMOREPACKETS, (WPARAM) hServerPacketRecver, (LPARAM)&packetRecv);
if (recvResult == 0)
@@ -454,12 +454,12 @@ void __cdecl CAimProto::aim_chatnav_negotiation( void* )
if(recvResult>0)
{
unsigned short flap_length=0;
- for(;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
+ for (;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
{
- if(!packetRecv.buffer)
+ if (!packetRecv.buffer)
break;
FLAP flap((char*)&packetRecv.buffer[packetRecv.bytesUsed],packetRecv.bytesAvailable-packetRecv.bytesUsed);
- if(!flap.len())
+ if (!flap.len())
break;
flap_length+=FLAP_SIZE+flap.len();
if(flap.cmp(0x01))
@@ -507,7 +507,7 @@ void __cdecl CAimProto::aim_chat_negotiation( void* param )
NETLIBPACKETRECVER packetRecv = {0};
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = DEFAULT_KEEPALIVE_TIMER*1000;
- for(;;)
+ for (;;)
{
int recvResult = CallService(MS_NETLIB_GETMOREPACKETS, (WPARAM)hServerPacketRecver, (LPARAM)&packetRecv);
if (recvResult == 0)
@@ -527,12 +527,12 @@ void __cdecl CAimProto::aim_chat_negotiation( void* param )
if(recvResult>0)
{
unsigned short flap_length=0;
- for(;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
+ for (;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
{
- if(!packetRecv.buffer)
+ if (!packetRecv.buffer)
break;
FLAP flap((char*)&packetRecv.buffer[packetRecv.bytesUsed],packetRecv.bytesAvailable-packetRecv.bytesUsed);
- if(!flap.len())
+ if (!flap.len())
break;
flap_length+=FLAP_SIZE+flap.len();
if(flap.cmp(0x01))
@@ -581,7 +581,7 @@ void __cdecl CAimProto::aim_admin_negotiation( void* )
NETLIBPACKETRECVER packetRecv = {0};
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = 300000;//5 minutes connected
- for(;;)
+ for (;;)
{
int recvResult = CallService(MS_NETLIB_GETMOREPACKETS, (WPARAM) hServerPacketRecver, (LPARAM) & packetRecv);
if (recvResult == 0)
@@ -593,12 +593,12 @@ void __cdecl CAimProto::aim_admin_negotiation( void* )
if(recvResult>0)
{
unsigned short flap_length=0;
- for(;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
+ for (;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
{
- if(!packetRecv.buffer)
+ if (!packetRecv.buffer)
break;
FLAP flap((char*)&packetRecv.buffer[packetRecv.bytesUsed],packetRecv.bytesAvailable-packetRecv.bytesUsed);
- if(!flap.len())
+ if (!flap.len())
break;
flap_length+=FLAP_SIZE+flap.len();
if(flap.cmp(0x01))
diff --git a/protocols/AimOscar/conv.cpp b/protocols/AimOscar/conv.cpp
index 416363c096..ebe531876f 100644
--- a/protocols/AimOscar/conv.cpp
+++ b/protocols/AimOscar/conv.cpp
@@ -202,7 +202,7 @@ char* html_to_bbcodes(char *src)
*ptr = '[';
*(ptr+1) = 'b';
*(ptr+2) = ']';
- if((ptr = strstr(dest, "</B>")) != NULL || (ptr = strstr(dest, "</b>")) != NULL)
+ if ((ptr = strstr(dest, "</B>")) != NULL || (ptr = strstr(dest, "</b>")) != NULL)
{
*ptr = '[';
*(ptr+2) = 'b';
@@ -219,7 +219,7 @@ char* html_to_bbcodes(char *src)
*ptr = '[';
*(ptr+1) = 'i';
*(ptr+2) = ']';
- if((ptr = strstr(dest, "</I>")) != NULL || (ptr = strstr(dest, "</i>")) != NULL)
+ if ((ptr = strstr(dest, "</I>")) != NULL || (ptr = strstr(dest, "</i>")) != NULL)
{
*ptr = '[';
*(ptr+2) = 'i';
@@ -236,7 +236,7 @@ char* html_to_bbcodes(char *src)
*ptr = '[';
*(ptr+1) = 'u';
*(ptr+2) = ']';
- if((ptr = strstr(dest, "</U>")) != NULL || (ptr = strstr(dest, "</u>")) != NULL)
+ if ((ptr = strstr(dest, "</U>")) != NULL || (ptr = strstr(dest, "</u>")) != NULL)
{
*ptr = '[';
*(ptr+2) = 'u';
@@ -253,7 +253,7 @@ char* html_to_bbcodes(char *src)
*ptr = '[';
*(ptr+1) = 's';
*(ptr+2) = ']';
- if((ptr = strstr(dest, "</S>")) != NULL || (ptr = strstr(dest, "</s>")) != NULL)
+ if ((ptr = strstr(dest, "</S>")) != NULL || (ptr = strstr(dest, "</s>")) != NULL)
{
*ptr = '[';
*(ptr+2) = 's';
@@ -718,7 +718,7 @@ char* rtf_to_html(HWND hwndDlg,int DlgItem)
pos+=strlen(Face);
strcpy(&buf[pos],"\"");
pos++;
- if(!(cfOld.dwEffects & CFE_AUTOBACKCOLOR))
+ if (!(cfOld.dwEffects & CFE_AUTOBACKCOLOR))
{
strcpy(&buf[pos]," back=#");
pos+=6;
@@ -734,7 +734,7 @@ char* rtf_to_html(HWND hwndDlg,int DlgItem)
strcpy(&buf[pos],chBackColor);
pos+=6;
}
- if(!(cfOld.dwEffects & CFE_AUTOCOLOR))
+ if (!(cfOld.dwEffects & CFE_AUTOCOLOR))
{
strcpy(&buf[pos]," color=#");
pos+=8;
diff --git a/protocols/AimOscar/links.cpp b/protocols/AimOscar/links.cpp
index 42cbc25cf1..c4eec4ae69 100644
--- a/protocols/AimOscar/links.cpp
+++ b/protocols/AimOscar/links.cpp
@@ -147,7 +147,7 @@ static INT_PTR ServiceParseAimLink(WPARAM /*wParam*/,LPARAM lParam)
return 0;
}
/* open a chatroom */
- else if(!_tcsnicmp(arg, _T("gochat?"), 7))
+ else if (!_tcsnicmp(arg, _T("gochat?"), 7))
{
TCHAR *tok, *tok2;
char *rm = NULL;
diff --git a/protocols/AimOscar/server.cpp b/protocols/AimOscar/server.cpp
index 3ff1ecff89..490444303b 100644
--- a/protocols/AimOscar/server.cpp
+++ b/protocols/AimOscar/server.cpp
@@ -467,7 +467,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003
}
if(f002&&f003&&f004&&f005)
strcpy(client,CLIENT_TRILLIAN_PRO);
- else if((f004&&f005&&f007&&f008) || (f004&&f005&&O104&&O105))
+ else if ((f004&&f005&&f007&&f008) || (f004&&f005&&O104&&O105))
strcpy(client,CLIENT_ICHAT);
else if(f003&f004&f005)
strcpy(client,CLIENT_TRILLIAN);
@@ -1647,7 +1647,7 @@ void CAimProto::snac_received_info(SNAC &snac)//family 0x0002
write_away_message(sn,Translate("No information has been provided by the server."),false);
request_away_message = 0;
}
- if(!profile_received&&request_HTML_profile)
+ if (!profile_received&&request_HTML_profile)
write_profile(sn,"No Profile",false);
request_HTML_profile=0;
}
@@ -2387,11 +2387,11 @@ void CAimProto::snac_admin_account_confirm(SNAC &snac)//family 0x0007
{
unsigned short* type=(unsigned short*)&buf[SNAC_SIZE*2+1+sn_length];
*type=htons(*type);
- if(*type==0x0000)//typing finished
+ if (*type==0x0000)//typing finished
CallService(MS_PROTO_CONTACTISTYPING,(WPARAM)hContact,(WPARAM)PROTOTYPE_CONTACTTYPING_OFF);
- else if(*type==0x0001)//typed
+ else if (*type==0x0001)//typed
CallService(MS_PROTO_CONTACTISTYPING,(WPARAM)hContact,PROTOTYPE_CONTACTTYPING_INFINITE);
- else if(*type==0x0002)//typing
+ else if (*type==0x0002)//typing
CallService(MS_PROTO_CONTACTISTYPING,(WPARAM)hContact,(LPARAM)60);
}
}
diff --git a/protocols/AimOscar/services.cpp b/protocols/AimOscar/services.cpp
index d50c455013..caf2209560 100644
--- a/protocols/AimOscar/services.cpp
+++ b/protocols/AimOscar/services.cpp
@@ -127,7 +127,7 @@ int CAimProto::OnDbSettingChanged(WPARAM wParam,LPARAM lParam)
if (cws->value.type == DBVT_DELETED)
{
DBVARIANT dbv;
- if(!DBGetContactSettingStringUtf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0])
+ if (!DBGetContactSettingStringUtf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0])
{
add_contact_to_group(hContact, dbv.pszVal);
DBFreeVariant(&dbv);
diff --git a/protocols/AimOscar/theme.cpp b/protocols/AimOscar/theme.cpp
index 04a928887a..315fd1d0e4 100644
--- a/protocols/AimOscar/theme.cpp
+++ b/protocols/AimOscar/theme.cpp
@@ -282,7 +282,7 @@ static int OnExtraIconsApply(WPARAM wParam, LPARAM /*lParam*/)
void remove_AT_icons(CAimProto* ppro)
{
- if(!ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) return;
+ if (!ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) return;
HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact)
@@ -296,7 +296,7 @@ void remove_AT_icons(CAimProto* ppro)
void remove_ES_icons(CAimProto* ppro)
{
- if(!ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) return;
+ if (!ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) return;
HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact)
diff --git a/protocols/AimOscar/ui.cpp b/protocols/AimOscar/ui.cpp
index 2bfee72319..d365d910ae 100644
--- a/protocols/AimOscar/ui.cpp
+++ b/protocols/AimOscar/ui.cpp
@@ -254,7 +254,7 @@ static INT_PTR CALLBACK userinfo_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, L
SendDlgItemMessage(hwndDlg, IDC_PROFILE, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cfOld);
BOOL isSub = (cfOld.dwEffects & CFE_SUBSCRIPT) && (cfOld.dwMask & CFM_SUBSCRIPT);
BOOL isSuper = (cfOld.dwEffects & CFE_SUPERSCRIPT) && (cfOld.dwMask & CFM_SUPERSCRIPT);
- if(!isSub&&!isSuper)
+ if (!isSub&&!isSuper)
{
DrawMyControl(lpDIS->hDC,GetDlgItem(hwndDlg, IDC_BOLD),hThemeButton,lpDIS->itemState|ODS_SELECTED, lpDIS->rcItem);
DrawIconEx(lpDIS->hDC, 4, 5, LoadIconEx("norm_scrpt"), 16, 16, 0, 0, DI_NORMAL);
@@ -314,7 +314,7 @@ static INT_PTR CALLBACK userinfo_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, L
cfOld.dwMask = CFM_ITALIC;
SendDlgItemMessage(hwndDlg, IDC_PROFILE, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cfOld);
BOOL isItalic = (cfOld.dwEffects & CFE_ITALIC) && (cfOld.dwMask & CFM_ITALIC);
- if(!isItalic)
+ if (!isItalic)
{
DrawMyControl(lpDIS->hDC,GetDlgItem(hwndDlg, IDC_ITALIC),hThemeButton,lpDIS->itemState, lpDIS->rcItem);
DrawIconEx(lpDIS->hDC, 4, 5, LoadIconEx("nitalic"), 16, 16, 0, 0, DI_NORMAL);
@@ -334,7 +334,7 @@ static INT_PTR CALLBACK userinfo_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, L
cfOld.dwMask = CFM_UNDERLINE;
SendDlgItemMessage(hwndDlg, IDC_PROFILE, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cfOld);
BOOL isUnderline = (cfOld.dwEffects & CFE_UNDERLINE) && (cfOld.dwMask & CFM_UNDERLINE);
- if(!isUnderline)
+ if (!isUnderline)
{
DrawMyControl(lpDIS->hDC,GetDlgItem(hwndDlg, IDC_UNDERLINE),hThemeButton,lpDIS->itemState, lpDIS->rcItem);
DrawIconEx(lpDIS->hDC, 4, 5, LoadIconEx("nundrln"), 16, 16, 0, 0, DI_NORMAL);
@@ -945,7 +945,7 @@ static INT_PTR CALLBACK options_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (IsDlgButtonChecked(hwndDlg, IDC_AT))
{
int acc_disabled = ppro->getByte(AIM_KEY_AT, 0);
- if(!acc_disabled)
+ if (!acc_disabled)
remove_AT_icons(ppro);
ppro->setByte(AIM_KEY_AT, 1);
}
@@ -962,7 +962,7 @@ static INT_PTR CALLBACK options_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
int es_disabled = ppro->getByte(AIM_KEY_ES, 0);
ppro->setByte(AIM_KEY_ES, 1);
- if(!es_disabled)
+ if (!es_disabled)
remove_ES_icons(ppro);
}
else
@@ -978,7 +978,7 @@ static INT_PTR CALLBACK options_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (IsDlgButtonChecked(hwndDlg, IDC_HF))
{
int hf = ppro->getByte(AIM_KEY_HF, 0);
- if(!hf)
+ if (!hf)
ShowWindow(GetDlgItem(hwndDlg, IDC_MASQ), SW_SHOW);
ppro->setByte(AIM_KEY_HF, 1);
}
diff --git a/protocols/AimOscar/utility.cpp b/protocols/AimOscar/utility.cpp
index 4867ec0678..dfa18843ad 100644
--- a/protocols/AimOscar/utility.cpp
+++ b/protocols/AimOscar/utility.cpp
@@ -108,7 +108,7 @@ void CAimProto::start_connection(void *arg)
broadcast_status(ID_STATUS_OFFLINE);
return;
}
- if(!getString(AIM_KEY_PW, &dbv))
+ if (!getString(AIM_KEY_PW, &dbv))
DBFreeVariant(&dbv);
else
{
diff --git a/protocols/FacebookRM/chat.cpp b/protocols/FacebookRM/chat.cpp
index 5fc0c8ac6e..2b66e730a1 100644
--- a/protocols/FacebookRM/chat.cpp
+++ b/protocols/FacebookRM/chat.cpp
@@ -266,7 +266,7 @@ int FacebookProto::OnJoinChat(WPARAM,LPARAM suppress)
SetTopic("Omegle is a great way of meeting new friends!");
// Note: Initialization will finish up in SetChatStatus, called separately
- if(!suppress)
+ if (!suppress)
SetChatStatus(m_iStatus);
*/
return 0;
diff --git a/protocols/FacebookRM/contacts.cpp b/protocols/FacebookRM/contacts.cpp
index 23a6ca4455..d9acefa076 100644
--- a/protocols/FacebookRM/contacts.cpp
+++ b/protocols/FacebookRM/contacts.cpp
@@ -27,9 +27,9 @@ bool FacebookProto::IsMyContact(HANDLE hContact, bool include_chat)
const char *proto = reinterpret_cast<char*>( CallService(MS_PROTO_GETCONTACTBASEPROTO,
reinterpret_cast<WPARAM>(hContact),0) );
- if( proto && strcmp(m_szModuleName,proto) == 0 )
+ if ( proto && strcmp(m_szModuleName,proto) == 0 )
{
- if( include_chat )
+ if ( include_chat )
return true;
else
return DBGetContactSettingByte(hContact,m_szModuleName,"ChatRoom",0) == 0;
@@ -44,13 +44,13 @@ HANDLE FacebookProto::ContactIDToHContact(std::string user_id)
hContact;
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0) )
{
- if(!IsMyContact(hContact))
+ if (!IsMyContact(hContact))
continue;
DBVARIANT dbv;
- if( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
+ if ( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
{
- if( strcmp(user_id.c_str(),dbv.pszVal) == 0 )
+ if ( strcmp(user_id.c_str(),dbv.pszVal) == 0 )
{
DBFreeVariant(&dbv);
return hContact;
@@ -70,15 +70,15 @@ HANDLE FacebookProto::AddToContactList(facebook_user* fbu, BYTE type, bool dont_
if (!dont_check) {
// First, check if this contact exists
hContact = ContactIDToHContact(fbu->user_id);
- if( hContact )
+ if ( hContact )
return hContact;
}
// If not, make a new contact!
hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
- if( hContact )
+ if ( hContact )
{
- if( CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)m_szModuleName) == 0 )
+ if ( CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)m_szModuleName) == 0 )
{
DBWriteContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,fbu->user_id.c_str());
@@ -90,7 +90,7 @@ HANDLE FacebookProto::AddToContactList(facebook_user* fbu, BYTE type, bool dont_
DBDeleteContactSetting(hContact, "CList", "MyHandle");
DBVARIANT dbv;
- if( !DBGetContactSettingTString(NULL,m_szModuleName,FACEBOOK_KEY_DEF_GROUP,&dbv) )
+ if ( !DBGetContactSettingTString(NULL,m_szModuleName,FACEBOOK_KEY_DEF_GROUP,&dbv) )
{
DBWriteContactSettingTString(hContact,"CList","Group",dbv.ptszVal);
DBFreeVariant(&dbv);
diff --git a/protocols/FacebookRM/dialogs.cpp b/protocols/FacebookRM/dialogs.cpp
index 721ef35905..da897e0073 100644
--- a/protocols/FacebookRM/dialogs.cpp
+++ b/protocols/FacebookRM/dialogs.cpp
@@ -50,7 +50,7 @@ INT_PTR CALLBACK FBAccountProc( HWND hwnd, UINT message, WPARAM wparam, LPARAM l
SetWindowLong(hwnd,GWLP_USERDATA,lparam);
DBVARIANT dbv;
- if( !DBGetContactSettingString(0,proto->ModuleName(),FACEBOOK_KEY_LOGIN,&dbv) )
+ if ( !DBGetContactSettingString(0,proto->ModuleName(),FACEBOOK_KEY_LOGIN,&dbv) )
{
SetDlgItemTextA(hwnd,IDC_UN,dbv.pszVal);
DBFreeVariant(&dbv);
@@ -195,7 +195,7 @@ INT_PTR CALLBACK FBOptionsProc( HWND hwnd, UINT message, WPARAM wparam, LPARAM l
SetWindowLong(hwnd,GWLP_USERDATA,lparam);
DBVARIANT dbv;
- if( !DBGetContactSettingString(0,proto->ModuleName(),FACEBOOK_KEY_LOGIN,&dbv) )
+ if ( !DBGetContactSettingString(0,proto->ModuleName(),FACEBOOK_KEY_LOGIN,&dbv) )
{
SetDlgItemTextA(hwnd,IDC_UN,dbv.pszVal);
DBFreeVariant(&dbv);
@@ -216,7 +216,7 @@ INT_PTR CALLBACK FBOptionsProc( HWND hwnd, UINT message, WPARAM wparam, LPARAM l
SendDlgItemMessage(hwnd, IDC_GROUP, EM_LIMITTEXT, FACEBOOK_GROUP_NAME_LIMIT, 0);
- if( !DBGetContactSettingTString(0,proto->ModuleName(),FACEBOOK_KEY_DEF_GROUP,&dbv) )
+ if ( !DBGetContactSettingTString(0,proto->ModuleName(),FACEBOOK_KEY_DEF_GROUP,&dbv) )
{
SetDlgItemText(hwnd,IDC_GROUP,dbv.ptszVal);
DBFreeVariant(&dbv);
diff --git a/protocols/FacebookRM/messages.cpp b/protocols/FacebookRM/messages.cpp
index 072ae88b4f..9725ec40c9 100644
--- a/protocols/FacebookRM/messages.cpp
+++ b/protocols/FacebookRM/messages.cpp
@@ -26,7 +26,7 @@ int FacebookProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
{
DBVARIANT dbv;
- if( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
+ if ( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
{
ForkThread( &FacebookProto::MessagingWorker, this, new send_messaging(dbv.pszVal, FACEBOOK_RECV_MESSAGE ) );
DBFreeVariant(&dbv);
@@ -53,7 +53,7 @@ void FacebookProto::SendMsgWorker(void *p)
{
ProtoBroadcastAck(m_szModuleName, data->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, data->msgid, (LPARAM)Translate("You cannot send messages when you are offline."));
}
- else if( !DBGetContactSettingString(data->hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
+ else if ( !DBGetContactSettingString(data->hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
{
int retries = 5;
std::string error_text = "";
@@ -130,7 +130,7 @@ void FacebookProto::SendTypingWorker(void *p)
}
DBVARIANT dbv;
- if( !DBGetContactSettingString(typing->hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
+ if ( !DBGetContactSettingString(typing->hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
{
std::string data = "typ=";
data += ( typing->status == PROTOTYPE_SELFTYPING_ON ) ? "1" : "0"; // PROTOTYPE_SELFTYPING_OFF
diff --git a/protocols/FacebookRM/process.cpp b/protocols/FacebookRM/process.cpp
index 056b8115dc..e63d186fb3 100644
--- a/protocols/FacebookRM/process.cpp
+++ b/protocols/FacebookRM/process.cpp
@@ -133,12 +133,12 @@ void FacebookProto::ProcessFriendList( void* data )
hContact;
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0) )
{
- if(!IsMyContact(hContact))
+ if (!IsMyContact(hContact))
continue;
DBVARIANT dbv;
facebook_user *fbu;
- if( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) ) {
+ if ( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) ) {
std::string id = dbv.pszVal;
DBFreeVariant(&dbv);
diff --git a/protocols/FacebookRM/proto.cpp b/protocols/FacebookRM/proto.cpp
index 820a1c3fb6..992977b372 100644
--- a/protocols/FacebookRM/proto.cpp
+++ b/protocols/FacebookRM/proto.cpp
@@ -456,7 +456,7 @@ int FacebookProto::VisitProfile(WPARAM wParam,LPARAM lParam)
HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
DBVARIANT dbv;
- if( wParam != 0 && !DBGetContactSettingString(hContact,m_szModuleName,"Homepage",&dbv) )
+ if ( wParam != 0 && !DBGetContactSettingString(hContact,m_szModuleName,"Homepage",&dbv) )
{
CallService(MS_UTILS_OPENURL,1,reinterpret_cast<LPARAM>(dbv.pszVal));
DBFreeVariant(&dbv);
@@ -497,7 +497,7 @@ int FacebookProto::CancelFriendship(WPARAM wParam,LPARAM lParam)
if ( !DBGetContactSettingUTF8String(hContact, m_szModuleName, FACEBOOK_KEY_NAME, &dbv) ) {
mir_snprintf(str,SIZEOF(str),Translate("Do you want to cancel your friendship with '%s'?"), dbv.pszVal);
DBFreeVariant(&dbv);
- } else if( !DBGetContactSettingUTF8String(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) ) {
+ } else if ( !DBGetContactSettingUTF8String(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) ) {
mir_snprintf(str,SIZEOF(str),Translate("Do you want to cancel your friendship with '%s'?"), dbv.pszVal);
DBFreeVariant(&dbv);
}
@@ -505,7 +505,7 @@ int FacebookProto::CancelFriendship(WPARAM wParam,LPARAM lParam)
TCHAR *text = mir_a2t_cp(str, CP_UTF8);
if (MessageBox( 0, text, m_tszUserName, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2 ) == IDYES) {
- if( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
+ if ( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
{
std::string* id = new std::string(dbv.pszVal);
@@ -534,7 +534,7 @@ int FacebookProto::RequestFriendship(WPARAM wParam,LPARAM lParam)
HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
DBVARIANT dbv;
- if( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
+ if ( !DBGetContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv) )
{
std::string* id = new std::string(dbv.pszVal);
ForkThread( &FacebookProto::AddContactToServer, this, ( void* )id );
diff --git a/protocols/FacebookRM/theme.cpp b/protocols/FacebookRM/theme.cpp
index fd8d0be032..88e0ab5498 100644
--- a/protocols/FacebookRM/theme.cpp
+++ b/protocols/FacebookRM/theme.cpp
@@ -118,11 +118,11 @@ static FacebookProto * GetInstanceByHContact(HANDLE hContact)
{
char *proto = reinterpret_cast<char*>( CallService(MS_PROTO_GETCONTACTBASEPROTO,
reinterpret_cast<WPARAM>(hContact),0) );
- if(!proto)
+ if (!proto)
return 0;
for(int i=0; i<g_Instances.getCount(); i++)
- if(!strcmp(proto,g_Instances[i].m_szModuleName))
+ if (!strcmp(proto,g_Instances[i].m_szModuleName))
return &g_Instances[i];
return 0;
diff --git a/protocols/GTalkExt/db.cpp b/protocols/GTalkExt/db.cpp
index a99101f719..ac716ed768 100644
--- a/protocols/GTalkExt/db.cpp
+++ b/protocols/GTalkExt/db.cpp
@@ -36,7 +36,7 @@ char *WtoA(LPCTSTR W)
__except(
free(result),
EXCEPTION_CONTINUE_SEARCH
- ){}
+ ) {}
return result;
}
diff --git a/protocols/GTalkExt/notifications.cpp b/protocols/GTalkExt/notifications.cpp
index 70c15cee1b..59bb956308 100644
--- a/protocols/GTalkExt/notifications.cpp
+++ b/protocols/GTalkExt/notifications.cpp
@@ -369,7 +369,7 @@ void ClearNotificationContactHistory(LPCSTR acc)
HANDLE hContact = (HANDLE)DBGetContactSettingDword(0, acc, PSEUDOCONTACT_LINK, 0);
if (hContact && DBGetContactSettingByte(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0))
while ((hEvent = (HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)hContact, 0)) &&
- !CallService(MS_DB_EVENT_DELETE, (WPARAM)hContact, (LPARAM)hEvent)){};
+ !CallService(MS_DB_EVENT_DELETE, (WPARAM)hContact, (LPARAM)hEvent)) {};
}
DWORD ReadNotificationSettings(LPCSTR acc)
diff --git a/protocols/Gadu-Gadu/core.c b/protocols/Gadu-Gadu/core.c
index ea739c6dce..4f1ac840bd 100644
--- a/protocols/Gadu-Gadu/core.c
+++ b/protocols/Gadu-Gadu/core.c
@@ -207,10 +207,10 @@ int gg_decodehosts(char *var, GGHOST *hosts, int max)
*(var - 1) = 0;
portname = var;
while(var && *var && isdigit(*var)) var++;
- if(*var) { *var = 0; var ++; }
+ if (*var) { *var = 0; var ++; }
}
else
- if(*var) { *var = 0; var ++; }
+ if (*var) { *var = 0; var ++; }
// Insert new item
hosts[hp].hostname[127] = 0;
@@ -315,7 +315,7 @@ void __cdecl gg_mainthread(GGPROTO *gg, void *empty)
// Check out manual host setting
if(DBGetContactSettingByte(NULL, GG_PROTO, GG_KEY_MANUALHOST, GG_KEYDEF_MANUALHOST))
{
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_SERVERHOSTS, &dbv))
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_SERVERHOSTS, &dbv))
{
hostcount = gg_decodehosts(dbv.pszVal, hosts, 64);
DBFreeVariant(&dbv);
@@ -323,7 +323,7 @@ void __cdecl gg_mainthread(GGPROTO *gg, void *empty)
}
// Readup password
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_PASSWORD, &dbv))
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_PASSWORD, &dbv))
{
CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM) dbv.pszVal);
p.password = mir_strdup(dbv.pszVal);
@@ -337,7 +337,7 @@ void __cdecl gg_mainthread(GGPROTO *gg, void *empty)
}
// Readup number
- if(!(p.uin = DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, 0)))
+ if (!(p.uin = DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, 0)))
{
gg_netlog(gg, "gg_mainthread(%x): No Gadu-Gadu number specified. Exiting.", gg);
gg_broadcastnewstatus(gg, ID_STATUS_OFFLINE);
@@ -354,7 +354,7 @@ void __cdecl gg_mainthread(GGPROTO *gg, void *empty)
////////////////////////////// DCC STARTUP /////////////////////////////
// Uin is ok so startup dcc if not started already
- if(!gg->dcc)
+ if (!gg->dcc)
{
gg->event = CreateEvent(NULL, TRUE, FALSE, NULL);
gg_dccstart(gg);
@@ -369,9 +369,9 @@ void __cdecl gg_mainthread(GGPROTO *gg, void *empty)
// Check if dcc is running and setup forwarding port
if(gg->dcc && DBGetContactSettingByte(NULL, GG_PROTO, GG_KEY_FORWARDING, GG_KEYDEF_FORWARDING))
{
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_FORWARDHOST, &dbv))
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_FORWARDHOST, &dbv))
{
- if(!(p.external_addr = gg_dnslookup(gg, dbv.pszVal)))
+ if (!(p.external_addr = gg_dnslookup(gg, dbv.pszVal)))
{
char error[128];
mir_snprintf(error, sizeof(error), Translate("External direct connections hostname %s is invalid. Disabling external host forwarding."), dbv.pszVal);
@@ -399,7 +399,7 @@ retry:
// Check manual hosts
if(hostnum < hostcount)
{
- if(!(p.server_addr = gg_dnslookup(gg, hosts[hostnum].hostname)))
+ if (!(p.server_addr = gg_dnslookup(gg, hosts[hostnum].hostname)))
{
char error[128];
mir_snprintf(error, sizeof(error), Translate("Server hostname %s is invalid. Using default hostname provided by the network."), hosts[hostnum].hostname);
@@ -510,7 +510,7 @@ retry:
while(gg_isonline(gg))
{
// Connection broken/closed
- if(!(e = gg_watch_fd(gg->sess)))
+ if (!(e = gg_watch_fd(gg->sess)))
{
gg_netlog(gg, "gg_mainthread(%x): Connection closed.", gg);
EnterCriticalSection(&gg->sess_mutex);
@@ -814,12 +814,12 @@ retry:
// Received message
case GG_EVENT_MSG:
// This is CTCP request
- if((e->event.msg.msgclass & GG_CLASS_CTCP))
+ if ((e->event.msg.msgclass & GG_CLASS_CTCP))
{
gg_dccconnect(gg, e->event.msg.sender);
}
// Check if not conference and block
- else if(!e->event.msg.recipients_count || gg->gc_enabled)
+ else if (!e->event.msg.recipients_count || gg->gc_enabled)
{
// Check if groupchat
if(e->event.msg.recipients_count && gg->gc_enabled && !DBGetContactSettingByte(NULL, GG_PROTO, GG_KEY_IGNORECONF, GG_KEYDEF_IGNORECONF))
@@ -844,7 +844,7 @@ retry:
}
}
// Check if not empty message ( who needs it? )
- else if(!e->event.msg.recipients_count && e->event.msg.message && *e->event.msg.message && strcmp(e->event.msg.message, "\xA0\0"))
+ else if (!e->event.msg.recipients_count && e->event.msg.message && *e->event.msg.message && strcmp(e->event.msg.message, "\xA0\0"))
{
CCSDATA ccs = {0};
PROTORECVEVENT pre = {0};
@@ -994,7 +994,7 @@ retry:
HANDLE hContact = gg_getcontact(gg, e->event.image_reply.sender, 1, 0, NULL);
void *img = (void *)gg_img_loadpicture(gg, e, 0);
- if(!img)
+ if (!img)
break;
if(DBGetContactSettingByte(NULL, GG_PROTO, GG_KEY_IMGMETHOD, GG_KEYDEF_IMGMETHOD) == 1 || gg_img_opened(gg, e->event.image_reply.sender))
@@ -1038,7 +1038,7 @@ retry:
dcc7->contact = gg_getcontact(gg, dcc7->peer_uin, 0, 0, NULL);
// Check if user is on the list and if it is my uin
- if(!dcc7->contact || DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, -1) != dcc7->uin) {
+ if (!dcc7->contact || DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, -1) != dcc7->uin) {
gg_dcc7_free(dcc7);
e->event.dcc7_new = NULL;
break;
@@ -1327,11 +1327,11 @@ int gg_dbsettingchanged(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
char *szProto = NULL;
// Check if the contact is NULL or we are not online
- if(!gg_isonline(gg))
+ if (!gg_isonline(gg))
return 0;
// If contact has been blocked
- if(!strcmp(cws->szModule, GG_PROTO) && !strcmp(cws->szSetting, GG_KEY_BLOCK))
+ if (!strcmp(cws->szModule, GG_PROTO) && !strcmp(cws->szSetting, GG_KEY_BLOCK))
{
gg_notifyuser(gg, hContact, 1);
return 0;
@@ -1348,7 +1348,7 @@ int gg_dbsettingchanged(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
{
// Most important... check redundancy (fucking cascading)
static int cascade = 0;
- if(!cascade && dbv.pszVal)
+ if (!cascade && dbv.pszVal)
{
GCDEST gcdest = {GG_PROTO, dbv.pszVal, GC_EVENT_CHANGESESSIONAME};
GCEVENT gcevent = {sizeof(GCEVENT), &gcdest};
@@ -1367,14 +1367,14 @@ int gg_dbsettingchanged(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
}
// Contact list changes
- if(!strcmp(cws->szModule, "CList"))
+ if (!strcmp(cws->szModule, "CList"))
{
// If name changed... change nick
- if(!strcmp(cws->szSetting, "MyHandle") && cws->value.type == DBVT_ASCIIZ && cws->value.pszVal)
+ if (!strcmp(cws->szSetting, "MyHandle") && cws->value.type == DBVT_ASCIIZ && cws->value.pszVal)
DBWriteContactSettingString(hContact, GG_PROTO, GG_KEY_NICK, cws->value.pszVal);
// If not on list changed
- if(!strcmp(cws->szSetting, "NotOnList"))
+ if (!strcmp(cws->szSetting, "NotOnList"))
{
if(DBGetContactSettingByte(hContact, "CList", "Hidden", 0))
return 0;
@@ -1540,7 +1540,7 @@ HANDLE gg_getcontact(GGPROTO *gg, uin_t uin, int create, int inlist, char *szNic
szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if(szProto != NULL && !strcmp(szProto, GG_PROTO))
{
- if((uin_t)DBGetContactSettingDword(hContact, GG_PROTO, GG_KEY_UIN, 0) == uin
+ if ((uin_t)DBGetContactSettingDword(hContact, GG_PROTO, GG_KEY_UIN, 0) == uin
&& DBGetContactSettingByte(hContact, GG_PROTO, "ChatRoom", 0) == 0)
{
if(inlist)
@@ -1553,11 +1553,11 @@ HANDLE gg_getcontact(GGPROTO *gg, uin_t uin, int create, int inlist, char *szNic
}
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
}
- if(!create) return NULL;
+ if (!create) return NULL;
hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
- if(!hContact)
+ if (!hContact)
{
gg_netlog(gg, "gg_getcontact(): Failed to create Gadu-Gadu contact %s", szNick);
return NULL;
@@ -1572,7 +1572,7 @@ HANDLE gg_getcontact(GGPROTO *gg, uin_t uin, int create, int inlist, char *szNic
}
gg_netlog(gg, "gg_getcontact(): Added buddy: %d", uin);
- if(!inlist)
+ if (!inlist)
{
DBWriteContactSettingByte(hContact, "CList", "NotOnList", 1);
//DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
@@ -1743,7 +1743,7 @@ void gg_changecontactstatus(GGPROTO *gg, uin_t uin, int status, const char *ides
HANDLE hContact = gg_getcontact(gg, uin, 0, 0, NULL);
// Check if contact is on list
- if(!hContact) return;
+ if (!hContact) return;
// Write contact status
DBWriteContactSettingWord(hContact, GG_PROTO, GG_KEY_STATUS, (WORD)status_gg2m(gg, status));
diff --git a/protocols/Gadu-Gadu/dialogs.c b/protocols/Gadu-Gadu/dialogs.c
index 63a87570e6..b6bfc8f5c0 100644
--- a/protocols/Gadu-Gadu/dialogs.c
+++ b/protocols/Gadu-Gadu/dialogs.c
@@ -320,7 +320,7 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
GetDlgItemText(hwndDlg, IDC_UIN, email, sizeof(email));
uin = atoi(email);
GetDlgItemText(hwndDlg, IDC_EMAIL, email, sizeof(email));
- if(!strlen(email))
+ if (!strlen(email))
MessageBox(
NULL,
Translate("You need to specify your registration e-mail first."),
@@ -724,7 +724,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
dat->updating = FALSE;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
// Add genders
- if(!dat->hContact)
+ if (!dat->hContact)
{
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)_T("")); // 0
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)Translate("Female")); // 1
@@ -920,7 +920,7 @@ int gg_details_init(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
}
// Start search for user data
- if((HANDLE)lParam == NULL)
+ if ((HANDLE)lParam == NULL)
gg_getinfo((PROTO_INTERFACE *)gg, NULL, 0);
return 0;
diff --git a/protocols/Gadu-Gadu/filetransfer.c b/protocols/Gadu-Gadu/filetransfer.c
index f738dfa774..cc55b993b8 100644
--- a/protocols/Gadu-Gadu/filetransfer.c
+++ b/protocols/Gadu-Gadu/filetransfer.c
@@ -45,7 +45,7 @@ void gg_dccstart(GGPROTO *gg)
}
// Check if we wan't direct connections
- if(!DBGetContactSettingByte(NULL, GG_PROTO, GG_KEY_DIRECTCONNS, GG_KEYDEF_DIRECTCONNS))
+ if (!DBGetContactSettingByte(NULL, GG_PROTO, GG_KEY_DIRECTCONNS, GG_KEYDEF_DIRECTCONNS))
{
gg_netlog(gg, "gg_dccstart(): No direct connections setup.");
if(gg->event) SetEvent(gg->event);
@@ -65,7 +65,7 @@ void gg_dccconnect(GGPROTO *gg, uin_t uin)
gg_netlog(gg, "gg_dccconnect(): Connecting to uin %d.", uin);
// If unknown user or not on list ignore
- if(!hContact) return;
+ if (!hContact) return;
// Read user IP and port
ip = swap32(DBGetContactSettingDword(hContact, GG_PROTO, GG_KEY_CLIENTIP, 0));
@@ -73,9 +73,9 @@ void gg_dccconnect(GGPROTO *gg, uin_t uin)
myuin = DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, 0);
// If not port nor ip nor my uin (?) specified
- if(!ip || !port || !uin) return;
+ if (!ip || !port || !uin) return;
- if(!(dcc = gg_dcc_get_file(ip, port, myuin, uin)))
+ if (!(dcc = gg_dcc_get_file(ip, port, myuin, uin)))
return;
// Add client dcc to watches
@@ -144,7 +144,7 @@ void __cdecl gg_dccmainthread(GGPROTO *gg, void *empty)
}
// Create listen socket on config direct port
- if(!(gg->dcc = gg_dcc_socket_create(uin, (uint16_t)DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_DIRECTPORT, GG_KEYDEF_DIRECTPORT))))
+ if (!(gg->dcc = gg_dcc_socket_create(uin, (uint16_t)DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_DIRECTPORT, GG_KEYDEF_DIRECTPORT))))
{
gg_netlog(gg, "gg_dccmainthread(): Cannot create DCC listen socket. Exiting.");
// Signalize mainthread we haven't start
@@ -652,7 +652,7 @@ HANDLE gg_sendfile(PROTO_INTERFACE *proto, HANDLE hContact, const PROTOCHAR* szD
uin_t myuin, uin;
// Check if main dcc thread is on
- if(!gg_isonline(gg)) return ftfail(gg, hContact);
+ if (!gg_isonline(gg)) return ftfail(gg, hContact);
filename = gg_t2a(ppszFiles[0]);
@@ -696,7 +696,7 @@ HANDLE gg_sendfile(PROTO_INTERFACE *proto, HANDLE hContact, const PROTOCHAR* szD
}
// Return if bad connection info
- if(!port || !uin || !myuin)
+ if (!port || !uin || !myuin)
{
gg_netlog(gg, "gg_sendfile(): Bad contact uin or my uin. Exit.");
mir_free(filename);
@@ -704,7 +704,7 @@ HANDLE gg_sendfile(PROTO_INTERFACE *proto, HANDLE hContact, const PROTOCHAR* szD
}
// Try to connect if not ask user to connect me
- if((ip && port >= 10 && !(dcc = gg_dcc_send_file(ip, port, myuin, uin))) || (port < 10 && port > 0))
+ if ((ip && port >= 10 && !(dcc = gg_dcc_send_file(ip, port, myuin, uin))) || (port < 10 && port > 0))
{
// Make fake dcc structure
dcc = malloc(sizeof(struct gg_dcc));
@@ -766,7 +766,7 @@ HANDLE gg_dccfileallow(GGPROTO *gg, HANDLE hTransfer, const PROTOCHAR* szPath)
LeaveCriticalSection(&gg->ft_mutex);
// Open file for appending and check if ok
- if((dcc->file_fd = _open(fileName, _O_WRONLY | _O_APPEND | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE)) == -1)
+ if ((dcc->file_fd = _open(fileName, _O_WRONLY | _O_APPEND | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE)) == -1)
{
gg_netlog(gg, "gg_dccfileallow(): Failed to create file \"%s\".", fileName);
ProtoBroadcastAck(GG_PROTO, dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
@@ -814,7 +814,7 @@ HANDLE gg_dcc7fileallow(GGPROTO *gg, HANDLE hTransfer, const PROTOCHAR* szPath)
}
// Open file for appending and check if ok
- if((dcc7->file_fd = _open(fileName, _O_WRONLY | _O_APPEND | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE)) == -1)
+ if ((dcc7->file_fd = _open(fileName, _O_WRONLY | _O_APPEND | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE)) == -1)
{
gg_netlog(gg, "gg_dcc7fileallow(): Failed to create file \"%s\".", fileName);
gg_dcc7_reject(dcc7, GG_DCC7_REJECT_USER);
@@ -973,7 +973,7 @@ int gg_filecancel(PROTO_INTERFACE *proto, HANDLE hContact, HANDLE hTransfer)
struct gg_common *c = (struct gg_common *) hTransfer;
// Check if its proper dcc
- if(!c) return 0;
+ if (!c) return 0;
if (c->type == GG_SESSION_DCC7_SEND || c->type == GG_SESSION_DCC7_GET)
return gg_dcc7filecancel((GGPROTO *) proto, hTransfer);
diff --git a/protocols/Gadu-Gadu/groupchat.c b/protocols/Gadu-Gadu/groupchat.c
index 26a797f163..9ead102cf8 100644
--- a/protocols/Gadu-Gadu/groupchat.c
+++ b/protocols/Gadu-Gadu/groupchat.c
@@ -131,7 +131,7 @@ int gg_gc_event(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
uin_t uin;
// Check if we got our protocol, and fields are set
- if(!gch
+ if (!gch
|| !gch->pDest
|| !gch->pDest->pszID
|| !gch->pDest->pszModule
@@ -153,7 +153,7 @@ int gg_gc_event(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
while (hContact)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, GG_PROTO, "ChatRoomID", &dbv))
+ if (!DBGetContactSettingString(hContact, GG_PROTO, "ChatRoomID", &dbv))
{
if(dbv.pszVal && !strcmp(gch->pDest->pszID, dbv.pszVal))
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
@@ -177,7 +177,7 @@ int gg_gc_event(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
gcevent.pszUID = id;
gcevent.pszText = gch->pszText;
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_NICK, &dbv))
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_NICK, &dbv))
gcevent.pszNick = dbv.pszVal;
else
gcevent.pszNick = Translate("Me");
@@ -201,7 +201,7 @@ int gg_gc_event(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
if(gch->pDest->iType == GC_USER_PRIVMESS)
{
HANDLE hContact = NULL;
- if((uin = atoi(gch->pszUID)) && (hContact = gg_getcontact(gg, uin, 1, 0, NULL)))
+ if ((uin = atoi(gch->pszUID)) && (hContact = gg_getcontact(gg, uin, 1, 0, NULL)))
CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, (LPARAM)0);
}
gg_netlog(gg, "gg_gc_event(): Unhandled event %d, chat %x, uin %d, text \"%s\".", gch->pDest->iType, chat, uin, gch->pszText);
@@ -230,18 +230,18 @@ char *gg_gc_getchat(GGPROTO *gg, uin_t sender, uin_t *recipients, int recipients
GCEVENT gcevent = {sizeof(GCEVENT), &gcdest};
gg_netlog(gg, "gg_gc_getchat(): Count %d.", recipients_count);
- if(!recipients) return NULL;
+ if (!recipients) return NULL;
// Look for existing chat
for(l = gg->chats; l; l = l->next)
{
GGGC *chat = (GGGC *)l->data;
- if(!chat) continue;
+ if (!chat) continue;
if(chat->recipients_count == recipients_count + (sender ? 1 : 0))
{
int i, j, found = 0, sok = (sender == 0);
- if(!sok) for(i = 0; i < chat->recipients_count; i++)
+ if (!sok) for(i = 0; i < chat->recipients_count; i++)
if(sender == chat->recipients[i])
{
sok = 1;
@@ -273,15 +273,15 @@ char *gg_gc_getchat(GGPROTO *gg, uin_t sender, uin_t *recipients, int recipients
int unknown = (gg_getcontact(gg, sender, 0, 0, NULL) == NULL),
unknownSender = unknown;
for(i = 0; i < recipients_count; i++)
- if(!gg_getcontact(gg, recipients[i], 0, 0, NULL))
+ if (!gg_getcontact(gg, recipients[i], 0, 0, NULL))
unknown ++;
- if((DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_DEFAULT, GG_KEYDEF_GC_POLICY_DEFAULT) == 2) ||
+ if ((DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_DEFAULT, GG_KEYDEF_GC_POLICY_DEFAULT) == 2) ||
(DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_TOTAL, GG_KEYDEF_GC_POLICY_TOTAL) == 2 &&
recipients_count >= DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_COUNT_TOTAL, GG_KEYDEF_GC_COUNT_TOTAL)) ||
(DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_UNKNOWN, GG_KEYDEF_GC_POLICY_UNKNOWN) == 2 &&
unknown >= DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_COUNT_UNKNOWN, GG_KEYDEF_GC_COUNT_UNKNOWN)))
chat->ignore = TRUE;
- if(!chat->ignore && ((DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_DEFAULT, GG_KEYDEF_GC_POLICY_DEFAULT) == 1) ||
+ if (!chat->ignore && ((DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_DEFAULT, GG_KEYDEF_GC_POLICY_DEFAULT) == 1) ||
(DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_TOTAL, GG_KEYDEF_GC_POLICY_TOTAL) == 1 &&
recipients_count >= DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_COUNT_TOTAL, GG_KEYDEF_GC_COUNT_TOTAL)) ||
(DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_UNKNOWN, GG_KEYDEF_GC_POLICY_UNKNOWN) == 1 &&
@@ -353,7 +353,7 @@ char *gg_gc_getchat(GGPROTO *gg, uin_t sender, uin_t *recipients, int recipients
if(uin = DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, 0))
{
UIN2ID(uin, id);
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_NICK, &dbv))
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_NICK, &dbv))
gcevent.pszNick = dbv.pszVal;
else
gcevent.pszNick = Translate("Me");
@@ -646,7 +646,7 @@ int gg_gc_changenick(GGPROTO *gg, HANDLE hContact, char *pszNick)
{
list_t l;
uin_t uin = DBGetContactSettingDword(hContact, GG_PROTO, GG_KEY_UIN, 0);
- if(!uin || !pszNick) return 0;
+ if (!uin || !pszNick) return 0;
gg_netlog(gg, "gg_gc_changenick(): Nickname for uin %d changed to %s.", uin, pszNick);
// Lookup for chats having this nick
diff --git a/protocols/Gadu-Gadu/import.c b/protocols/Gadu-Gadu/import.c
index a933135baf..43a0367402 100644
--- a/protocols/Gadu-Gadu/import.c
+++ b/protocols/Gadu-Gadu/import.c
@@ -276,7 +276,7 @@ void gg_parsecontacts(GGPROTO *gg, char *contacts)
n = strchr(p, '\n');
p = (n + 1);
}
- if(!n) p = NULL;
+ if (!n) p = NULL;
// Loadup contact
if(uin && strNick)
@@ -447,7 +447,7 @@ static INT_PTR gg_import_text(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
#ifdef DEBUGMODE
gg_netlog(gg, "gg_import_text()");
#endif
- if(!GetOpenFileName(&ofn)) return 0;
+ if (!GetOpenFileName(&ofn)) return 0;
f = fopen(str, "r");
_stat(str, &st);
@@ -519,7 +519,7 @@ static INT_PTR gg_export_text(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
#ifdef DEBUGMODE
gg_netlog(gg, "gg_export_text(%s).", str);
#endif
- if(!GetSaveFileName(&ofn)) return 0;
+ if (!GetSaveFileName(&ofn)) return 0;
if(f = fopen(str, "w"))
{
diff --git a/protocols/Gadu-Gadu/oauth.c b/protocols/Gadu-Gadu/oauth.c
index 849852d32b..2c0631d655 100644
--- a/protocols/Gadu-Gadu/oauth.c
+++ b/protocols/Gadu-Gadu/oauth.c
@@ -366,16 +366,16 @@ char *gg_oauth_header(GGPROTO *gg, const char *httpmethod, const char *url)
DBVARIANT dbv;
UIN2ID(DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, 0), uin);
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_PASSWORD, &dbv)) {
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_PASSWORD, &dbv)) {
CallService(MS_DB_CRYPT_DECODESTRING, (WPARAM)(int)strlen(dbv.pszVal) + 1, (LPARAM)dbv.pszVal);
password = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
}
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKEN, &dbv)) {
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKEN, &dbv)) {
token = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
}
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKENSECRET, &dbv)) {
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKENSECRET, &dbv)) {
CallService(MS_DB_CRYPT_DECODESTRING, (WPARAM)(int)strlen(dbv.pszVal) + 1, (LPARAM)dbv.pszVal);
token_secret = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
@@ -400,7 +400,7 @@ int gg_oauth_receivetoken(GGPROTO *gg)
HANDLE nlc = NULL;
UIN2ID(DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, 0), uin);
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_PASSWORD, &dbv)) {
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_PASSWORD, &dbv)) {
CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM)dbv.pszVal);
password = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
@@ -564,11 +564,11 @@ int gg_oauth_checktoken(GGPROTO *gg, int force)
DBVARIANT dbv;
int res = 1;
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKEN, &dbv)) {
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKEN, &dbv)) {
token = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
}
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKENSECRET, &dbv)) {
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKENSECRET, &dbv)) {
CallService(MS_DB_CRYPT_DECODESTRING, (WPARAM)(int)strlen(dbv.pszVal) + 1, (LPARAM)dbv.pszVal);
token_secret = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
diff --git a/protocols/Gadu-Gadu/ownerinfo.c b/protocols/Gadu-Gadu/ownerinfo.c
index aeeb7f1a9b..28cfb4df75 100644
--- a/protocols/Gadu-Gadu/ownerinfo.c
+++ b/protocols/Gadu-Gadu/ownerinfo.c
@@ -39,14 +39,14 @@ void __cdecl gg_remindpasswordthread(GGPROTO *gg, void *param)
#ifdef DEBUGMODE
gg_netlog(gg, "gg_remindpasswordthread(): Starting.");
#endif
- if(!rp || !rp->email || !rp->uin || !strlen(rp->email))
+ if (!rp || !rp->email || !rp->uin || !strlen(rp->email))
{
if(rp) free(rp);
return;
}
// Get token
- if(!gg_gettoken(gg, &token)) return;
+ if (!gg_gettoken(gg, &token)) return;
if (!(h = gg_remind_passwd3(rp->uin, rp->email, token.id, token.val, 0)))
{
diff --git a/protocols/Gadu-Gadu/services.c b/protocols/Gadu-Gadu/services.c
index bbb7434f6b..7591356f81 100644
--- a/protocols/Gadu-Gadu/services.c
+++ b/protocols/Gadu-Gadu/services.c
@@ -132,7 +132,7 @@ int gg_refreshstatus(GGPROTO *gg, int status)
return TRUE;
}
- if(!gg_isonline(gg))
+ if (!gg_isonline(gg))
{
DWORD exitCode = 0;
GetExitCodeThread(gg->pth_sess.hThread, &exitCode);
@@ -279,7 +279,7 @@ HANDLE gg_basicsearch(PROTO_INTERFACE *proto, const PROTOCHAR *id)
gg_pubdir50_t req;
char *ida;
- if(!gg_isonline(gg))
+ if (!gg_isonline(gg))
return (HANDLE)0;
if (!(req = gg_pubdir50_new(GG_PUBDIR50_SEARCH)))
@@ -297,7 +297,7 @@ HANDLE gg_basicsearch(PROTO_INTERFACE *proto, const PROTOCHAR *id)
mir_free(ida);
EnterCriticalSection(&gg->sess_mutex);
- if(!gg_pubdir50(gg->sess, req))
+ if (!gg_pubdir50(gg->sess, req))
{
LeaveCriticalSection(&gg->sess_mutex);
gg_forkthread(gg, gg_searchthread, NULL);
@@ -317,10 +317,10 @@ static HANDLE gg_searchbydetails(PROTO_INTERFACE *proto, const PROTOCHAR *nick,
char data[512] = "\0";
// Check if connected and if there's a search data
- if(!gg_isonline(gg))
+ if (!gg_isonline(gg))
return 0;
- if(!nick && !firstName && !lastName)
+ if (!nick && !firstName && !lastName)
return 0;
if (!(req = gg_pubdir50_new(GG_PUBDIR50_SEARCH)))
@@ -368,7 +368,7 @@ static HANDLE gg_searchbydetails(PROTO_INTERFACE *proto, const PROTOCHAR *nick,
gg_pubdir50_seq_set(req, GG_SEQ_SEARCH);
EnterCriticalSection(&gg->sess_mutex);
- if(!gg_pubdir50(gg->sess, req))
+ if (!gg_pubdir50(gg->sess, req))
{
LeaveCriticalSection(&gg->sess_mutex);
gg_forkthread(gg, gg_searchthread, NULL);
@@ -432,7 +432,7 @@ int gg_getinfo(PROTO_INTERFACE *proto, HANDLE hContact, int infoType)
if(gg_isonline(gg))
{
EnterCriticalSection(&gg->sess_mutex);
- if(!gg_pubdir50(gg->sess, req))
+ if (!gg_pubdir50(gg->sess, req))
{
LeaveCriticalSection(&gg->sess_mutex);
gg_forkthread(gg, gg_cmdgetinfothread, hContact);
@@ -457,7 +457,7 @@ int gg_getinfo(PROTO_INTERFACE *proto, HANDLE hContact, int infoType)
if(gg_isonline(gg))
{
EnterCriticalSection(&gg->sess_mutex);
- if(!gg_pubdir50(gg->sess, req))
+ if (!gg_pubdir50(gg->sess, req))
{
LeaveCriticalSection(&gg->sess_mutex);
gg_forkthread(gg, gg_cmdgetinfothread, hContact);
@@ -617,7 +617,7 @@ HWND gg_searchbyadvanced(PROTO_INTERFACE *proto, HWND hwndDlg)
unsigned long crc;
// Check if connected
- if(!gg_isonline(gg)) return (HWND)0;
+ if (!gg_isonline(gg)) return (HWND)0;
if (!(req = gg_pubdir50_new(GG_PUBDIR50_SEARCH)))
{
@@ -672,11 +672,11 @@ HWND gg_searchbyadvanced(PROTO_INTERFACE *proto, HWND hwndDlg)
yearFrom = atoi(age);
// Count & fix ranges
- if(!yearTo)
+ if (!yearTo)
yearTo = ay;
else
yearTo = ay - yearTo;
- if(!yearFrom)
+ if (!yearFrom)
yearFrom = 0;
else
yearFrom = ay - yearFrom;
@@ -723,7 +723,7 @@ HWND gg_searchbyadvanced(PROTO_INTERFACE *proto, HWND hwndDlg)
if(gg_isonline(gg))
{
EnterCriticalSection(&gg->sess_mutex);
- if(!gg_pubdir50(gg->sess, req))
+ if (!gg_pubdir50(gg->sess, req))
{
LeaveCriticalSection(&gg->sess_mutex);
gg_forkthread(gg, gg_searchthread, NULL);
diff --git a/protocols/Gadu-Gadu/token.c b/protocols/Gadu-Gadu/token.c
index 44bfb1f794..378766ef4a 100644
--- a/protocols/Gadu-Gadu/token.c
+++ b/protocols/Gadu-Gadu/token.c
@@ -115,7 +115,7 @@ int gg_gettoken(GGPROTO *gg, GGTOKEN *token)
strcpy(token->id, "");
strcpy(token->val, "");
- if(!(h = gg_token(0)) || gg_token_watch_fd(h) || h->state == GG_STATE_ERROR || h->state != GG_STATE_DONE)
+ if (!(h = gg_token(0)) || gg_token_watch_fd(h) || h->state == GG_STATE_ERROR || h->state != GG_STATE_DONE)
{
char error[128];
mir_snprintf(error, sizeof(error), Translate("Token retrieval failed because of error:\n\t%s"), http_error_string(h ? h->error : 0));
diff --git a/protocols/Gadu-Gadu/userutils.c b/protocols/Gadu-Gadu/userutils.c
index 1217488c93..721e4d32cf 100644
--- a/protocols/Gadu-Gadu/userutils.c
+++ b/protocols/Gadu-Gadu/userutils.c
@@ -32,10 +32,10 @@ void *gg_doregister(GGPROTO *gg, char *newPass, char *newEmail)
#ifdef DEBUGMODE
gg_netlog(gg, "gg_doregister(): Starting.");
#endif
- if(!newPass || !newEmail) return NULL;
+ if (!newPass || !newEmail) return NULL;
// Load token
- if(!gg_gettoken(gg, &token)) return NULL;
+ if (!gg_gettoken(gg, &token)) return NULL;
if (!(h = gg_register3(newEmail, newPass, token.id, token.val, 0)) || !(s = h->data) || !s->success || !s->uin)
{
@@ -87,10 +87,10 @@ void *gg_dounregister(GGPROTO *gg, uin_t uin, char *password)
#ifdef DEBUGMODE
gg_netlog(gg, "gg_dounregister(): Starting.");
#endif
- if(!uin || !password) return NULL;
+ if (!uin || !password) return NULL;
// Load token
- if(!gg_gettoken(gg, &token)) return NULL;
+ if (!gg_gettoken(gg, &token)) return NULL;
if (!(h = gg_unregister3(uin, password, token.id, token.val, 0)) || !(s = h->data) || !s->success || s->uin != uin)
{
@@ -141,7 +141,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass)
#ifdef DEBUGMODE
gg_netlog(gg, "gg_dochpass(): Starting.");
#endif
- if(!uin || !password || !newPass) return NULL;
+ if (!uin || !password || !newPass) return NULL;
if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_EMAIL, &dbv_email))
{
@@ -150,7 +150,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass)
}
// Load token
- if(!gg_gettoken(gg, &token)) return NULL;
+ if (!gg_gettoken(gg, &token)) return NULL;
if (!(h = gg_change_passwd4(uin, email, password, newPass, token.id, token.val, 0)) || !(s = h->data) || !s->success)
{
@@ -199,10 +199,10 @@ void *gg_dochemail(GGPROTO *gg, uin_t uin, char *password, char *email, char *ne
#ifdef DEBUGMODE
gg_netlog(gg, "gg_doemail(): Starting.");
#endif
- if(!uin || !email || !newEmail) return NULL;
+ if (!uin || !email || !newEmail) return NULL;
// Load token
- if(!gg_gettoken(gg, &token)) return NULL;
+ if (!gg_gettoken(gg, &token)) return NULL;
if (!(h = gg_change_passwd4(uin, newEmail, password, password, token.id, token.val, 0)) || !(s = h->data) || !s->success)
{
diff --git a/protocols/IRCG/MString.cpp b/protocols/IRCG/MString.cpp
index 45da9e4965..70016e427e 100644
--- a/protocols/IRCG/MString.cpp
+++ b/protocols/IRCG/MString.cpp
@@ -75,7 +75,7 @@ bool CMStringData::IsShared() const
void CMStringData::Lock()
{
nRefs--; // Locked buffers can't be shared, so no interlocked operation necessary
- if( nRefs == 0 )
+ if ( nRefs == 0 )
nRefs = -1;
}
diff --git a/protocols/IRCG/MString.h b/protocols/IRCG/MString.h
index fbef22ddf5..6f90b7741b 100644
--- a/protocols/IRCG/MString.h
+++ b/protocols/IRCG/MString.h
@@ -126,7 +126,7 @@ public:
CMSimpleStringT(const XCHAR* pchSrc, int nLength)
{
CMStringData* pData = Allocate( nLength, sizeof( XCHAR ) );
- if( pData != NULL )
+ if ( pData != NULL )
{
Attach( pData );
SetLength( nLength );
@@ -148,9 +148,9 @@ public:
{
CMStringData* pSrcData = strSrc.GetData();
CMStringData* pOldData = GetData();
- if( pSrcData != pOldData)
+ if ( pSrcData != pOldData)
{
- if( pOldData->IsLocked() )
+ if ( pOldData->IsLocked() )
SetString( strSrc.GetString(), strSrc.GetLength() );
else
{
@@ -238,7 +238,7 @@ public:
int nNewLength = nOldLength+nLength;
PXSTR pszBuffer = GetBuffer( nNewLength );
- if( nOffset <= nOldLength )
+ if ( nOffset <= nOldLength )
{
pszSrc = pszBuffer+nOffset;
// No need to call CopyCharsOverlapped, since the destination is
@@ -262,10 +262,10 @@ public:
void Empty()
{
CMStringData* pOldData = GetData();
- if( pOldData->nDataLength == 0 )
+ if ( pOldData->nDataLength == 0 )
return;
- if( pOldData->IsLocked() )
+ if ( pOldData->IsLocked() )
{
// Don't reallocate a locked buffer that's shrinking
SetLength( 0 );
@@ -281,13 +281,13 @@ public:
{
CMStringData* pOldData = GetData();
int nLength = pOldData->nDataLength;
- if( pOldData->nAllocLength == nLength )
+ if ( pOldData->nAllocLength == nLength )
return;
- if( !pOldData->IsLocked() ) // Don't reallocate a locked buffer that's shrinking
+ if ( !pOldData->IsLocked() ) // Don't reallocate a locked buffer that's shrinking
{
CMStringData* pNewData = Allocate( nLength, sizeof( XCHAR ) );
- if( pNewData == NULL ) {
+ if ( pNewData == NULL ) {
SetLength( nLength );
return;
}
@@ -311,7 +311,7 @@ public:
PXSTR GetBuffer()
{
CMStringData* pData = GetData();
- if( pData->IsShared() )
+ if ( pData->IsShared() )
Fork( pData->nDataLength );
return m_pszData;
@@ -343,7 +343,7 @@ public:
PXSTR LockBuffer()
{
CMStringData* pData = GetData();
- if( pData->IsShared() )
+ if ( pData->IsShared() )
{
Fork( pData->nDataLength );
pData = GetData(); // Do it again, because the fork might have changed it
@@ -363,7 +363,7 @@ public:
}
void ReleaseBuffer( int nNewLength = -1 )
{
- if( nNewLength == -1 )
+ if ( nNewLength == -1 )
{
int nAlloc = GetData()->nAllocLength;
nNewLength = StringLengthN( m_pszData, nAlloc);
@@ -393,7 +393,7 @@ public:
}
void SetString( PCXSTR pszSrc, int nLength )
{
- if( nLength == 0 )
+ if ( nLength == 0 )
{
Empty();
}
@@ -404,7 +404,7 @@ public:
UINT_PTR nOffset = pszSrc - GetString();
PXSTR pszBuffer = GetBuffer( nLength );
- if( nOffset <= nOldLength )
+ if ( nOffset <= nOldLength )
{
CopyCharsOverlapped( pszBuffer, GetAllocLength(),
pszBuffer+nOffset, nLength );
@@ -492,14 +492,14 @@ public:
}
static int __stdcall StringLengthN(const char* psz, size_t sizeInXChar )
{
- if( psz == NULL )
+ if ( psz == NULL )
return 0;
return int( strnlen( psz, sizeInXChar ));
}
static int __stdcall StringLengthN(const wchar_t* psz, size_t sizeInXChar )
{
- if( psz == NULL )
+ if ( psz == NULL )
return 0;
return int( wcsnlen( psz, sizeInXChar ));
@@ -561,12 +561,12 @@ private:
{
// Grow exponentially, until we hit 1K.
int nNewLength = pOldData->nAllocLength;
- if( nNewLength > 1024 )
+ if ( nNewLength > 1024 )
nNewLength += 1024;
else
nNewLength *= 2;
- if( nNewLength < nLength )
+ if ( nNewLength < nLength )
nNewLength = nLength;
Reallocate( nNewLength );
@@ -579,7 +579,7 @@ private:
return;
CMStringData* pNewData = Realloc( pOldData, nLength, sizeof( XCHAR ) );
- if( pNewData != NULL )
+ if ( pNewData != NULL )
Attach( pNewData );
}
@@ -816,7 +816,7 @@ public:
{
int nLen = ::MultiByteToWideChar( _AtlGetConversionACP(), 0, pchData, nDataLength, NULL, NULL );
BSTR bstr = ::SysAllocStringLen( NULL, nLen );
- if( bstr != NULL )
+ if ( bstr != NULL )
::MultiByteToWideChar( _AtlGetConversionACP(), 0, pchData, nDataLength, bstr, nLen );
return bstr;
@@ -826,7 +826,7 @@ public:
{
int nLen = ::MultiByteToWideChar( _AtlGetConversionACP(), 0, pchData, nDataLength, NULL, NULL );
BOOL bSuccess = ::SysReAllocStringLen( pbstr, NULL, nLen );
- if( bSuccess )
+ if ( bSuccess )
::MultiByteToWideChar( _AtlGetConversionACP(), 0, pchData, nDataLength, *pbstr, nLen );
return bSuccess;
@@ -1030,7 +1030,7 @@ public:
static void __stdcall FloodCharacters( wchar_t ch, int nLength, LPWSTR psz )
{
// nLength is in XCHARs
- for( int i = 0; i < nLength; i++ )
+ for ( int i = 0; i < nLength; i++ )
{
psz[i] = ch;
}
@@ -1144,7 +1144,7 @@ public:
CMStringT( char ch, int nLength = 1 ) :
CThisSimpleString()
{
- if( nLength > 0 )
+ if ( nLength > 0 )
{
PXSTR pszBuffer = this->GetBuffer( nLength );
StringTraits::FloodCharacters( XCHAR( ch ), nLength, pszBuffer );
@@ -1155,7 +1155,7 @@ public:
CMStringT( wchar_t ch, int nLength = 1 ) :
CThisSimpleString()
{
- if( nLength > 0 )
+ if ( nLength > 0 )
{
//Convert ch to the BaseType
wchar_t pszCh[2] = { ch , 0 };
@@ -1198,7 +1198,7 @@ public:
CMStringT( const YCHAR* pch, int nLength ) :
CThisSimpleString()
{
- if( nLength > 0 )
+ if ( nLength > 0 )
{
int nDestLength = StringTraits::GetBaseTypeLength( pch, nLength );
PXSTR pszBuffer = this->GetBuffer( nDestLength );
@@ -1231,7 +1231,7 @@ public:
{
// nDestLength is in XCHARs
int nDestLength = (pszSrc != NULL) ? StringTraits::GetBaseTypeLength( pszSrc ) : 0;
- if( nDestLength > 0 )
+ if ( nDestLength > 0 )
{
PXSTR pszBuffer = this->GetBuffer( nDestLength );
StringTraits::ConvertToBaseType( pszBuffer, nDestLength, pszSrc);
@@ -1345,18 +1345,18 @@ public:
// Delete 'nCount' characters, starting at index 'iIndex'
int Delete( int iIndex, int nCount = 1 )
{
- if( iIndex < 0 )
+ if ( iIndex < 0 )
iIndex = 0;
- if( nCount < 0 )
+ if ( nCount < 0 )
nCount = 0;
int nLength = this->GetLength();
- if( nCount + iIndex > nLength )
+ if ( nCount + iIndex > nLength )
{
nCount = nLength-iIndex;
}
- if( nCount > 0 )
+ if ( nCount > 0 )
{
int nNewLength = nLength-nCount;
int nXCHARsToCopy = nLength-(iIndex+nCount)+1;
@@ -1375,10 +1375,10 @@ public:
// Insert character 'ch' before index 'iIndex'
int Insert( int iIndex, XCHAR ch )
{
- if( iIndex < 0 )
+ if ( iIndex < 0 )
iIndex = 0;
- if( iIndex > this->GetLength() )
+ if ( iIndex > this->GetLength() )
iIndex = this->GetLength();
int nNewLength = this->GetLength()+1;
@@ -1400,10 +1400,10 @@ public:
// Insert string 'psz' before index 'iIndex'
int Insert( int iIndex, PCXSTR psz )
{
- if( iIndex < 0 )
+ if ( iIndex < 0 )
iIndex = 0;
- if( iIndex > this->GetLength() )
+ if ( iIndex > this->GetLength() )
{
iIndex = this->GetLength();
}
@@ -1411,7 +1411,7 @@ public:
// nInsertLength and nNewLength are in XCHARs
int nInsertLength = StringTraits::SafeStringLen( psz );
int nNewLength = this->GetLength();
- if( nInsertLength > 0 )
+ if ( nInsertLength > 0 )
{
nNewLength += nInsertLength;
@@ -1436,7 +1436,7 @@ public:
int nCount = 0;
// short-circuit the nop case
- if( chOld != chNew )
+ if ( chOld != chNew )
{
// otherwise modify each character that matches in the string
bool bCopied = false;
@@ -1447,9 +1447,9 @@ public:
while( iChar < nLength )
{
// replace instances of the specified character only
- if( pszBuffer[iChar] == chOld )
+ if ( pszBuffer[iChar] == chOld )
{
- if( !bCopied )
+ if ( !bCopied )
{
bCopied = true;
pszBuffer = this->GetBuffer( nLength );
@@ -1459,7 +1459,7 @@ public:
}
iChar = int( StringTraits::CharNext( pszBuffer+iChar )-pszBuffer );
}
- if( bCopied )
+ if ( bCopied )
{
this->ReleaseBufferSetLength( nLength );
}
@@ -1475,7 +1475,7 @@ public:
// nSourceLen is in XCHARs
int nSourceLen = StringTraits::SafeStringLen( pszOld );
- if( nSourceLen == 0 )
+ if ( nSourceLen == 0 )
return 0;
// nReplacementLen is in XCHARs
int nReplacementLen = StringTraits::SafeStringLen( pszNew );
@@ -1498,7 +1498,7 @@ public:
}
// if any changes were made, make them
- if( nCount > 0 )
+ if ( nCount > 0 )
{
// if the buffer is too small, just
// allocate a new buffer (slow but sure)
@@ -1546,7 +1546,7 @@ public:
while( pszSource < pszEnd )
{
PXSTR pszNewSource = StringTraits::CharNext( pszSource );
- if( *pszSource != chRemove )
+ if ( *pszSource != chRemove )
{
// Copy the source to the destination. Remember to copy all bytes of an MBCS character
// Copy the source to the destination. Remember to copy all bytes of an MBCS character
@@ -1571,7 +1571,7 @@ public:
CMStringT Tokenize( PCXSTR pszTokens, int& iStart ) const
{
- if( (pszTokens == NULL) || (*pszTokens == (XCHAR)0) )
+ if ( (pszTokens == NULL) || (*pszTokens == (XCHAR)0) )
{
if (iStart < this->GetLength())
return CMStringT( this->GetString()+iStart );
@@ -1580,11 +1580,11 @@ public:
{
PCXSTR pszPlace = this->GetString()+iStart;
PCXSTR pszEnd = this->GetString()+this->GetLength();
- if( pszPlace < pszEnd )
+ if ( pszPlace < pszEnd )
{
int nIncluding = StringTraits::StringSpanIncluding( pszPlace, pszTokens );
- if( (pszPlace+nIncluding) < pszEnd )
+ if ( (pszPlace+nIncluding) < pszEnd )
{
pszPlace += nIncluding;
int nExcluding = StringTraits::StringSpanExcluding( pszPlace, pszTokens );
@@ -1611,7 +1611,7 @@ public:
{
// nLength is in XCHARs
int nLength = this->GetLength();
- if( iStart < 0 || iStart >= nLength)
+ if ( iStart < 0 || iStart >= nLength)
return -1;
// find first single character
@@ -1632,7 +1632,7 @@ public:
// nLength is in XCHARs
int nLength = this->GetLength();
- if( iStart < 0 || iStart > nLength )
+ if ( iStart < 0 || iStart > nLength )
return -1;
// find first matching substring
@@ -1707,9 +1707,9 @@ public:
while( *psz != 0 )
{
- if( StringTraits::IsSpace( *psz ) )
+ if ( StringTraits::IsSpace( *psz ) )
{
- if( pszLast == NULL )
+ if ( pszLast == NULL )
pszLast = psz;
}
else
@@ -1719,7 +1719,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( pszLast != NULL )
+ if ( pszLast != NULL )
{
// truncate at trailing space start
int iLast = int( pszLast-this->GetString() );
@@ -1742,7 +1742,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( psz != this->GetString() )
+ if ( psz != this->GetString() )
{
// fix up data and length
int iFirst = int( psz-this->GetString() );
@@ -1788,9 +1788,9 @@ public:
while( *psz != 0 )
{
- if( *psz == chTarget )
+ if ( *psz == chTarget )
{
- if( pszLast == NULL )
+ if ( pszLast == NULL )
{
pszLast = psz;
}
@@ -1802,7 +1802,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( pszLast != NULL )
+ if ( pszLast != NULL )
{
// truncate at left-most matching character
int iLast = int( pszLast-this->GetString() );
@@ -1816,7 +1816,7 @@ public:
CMStringT& TrimRight( PCXSTR pszTargets )
{
// if we're not trimming anything, we're not doing any work
- if( (pszTargets == NULL) || (*pszTargets == 0) )
+ if ( (pszTargets == NULL) || (*pszTargets == 0) )
{
return *this;
}
@@ -1829,9 +1829,9 @@ public:
while( *psz != 0 )
{
- if( StringTraits::StringFindChar( pszTargets, *psz ) != NULL )
+ if ( StringTraits::StringFindChar( pszTargets, *psz ) != NULL )
{
- if( pszLast == NULL )
+ if ( pszLast == NULL )
{
pszLast = psz;
}
@@ -1843,7 +1843,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( pszLast != NULL )
+ if ( pszLast != NULL )
{
// truncate at left-most matching character
int iLast = int( pszLast-this->GetString() );
@@ -1864,7 +1864,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( psz != this->GetString() )
+ if ( psz != this->GetString() )
{
// fix up data and length
int iFirst = int( psz-this->GetString() );
@@ -1883,7 +1883,7 @@ public:
CMStringT& TrimLeft( PCXSTR pszTargets )
{
// if we're not trimming anything, we're not doing any work
- if( (pszTargets == NULL) || (*pszTargets == 0) )
+ if ( (pszTargets == NULL) || (*pszTargets == 0) )
{
return *this;
}
@@ -1894,7 +1894,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( psz != this->GetString() )
+ if ( psz != this->GetString() )
{
// fix up data and length
int iFirst = int( psz-this->GetString() );
@@ -1946,14 +1946,14 @@ public:
if (nCount < 0)
nCount = 0;
- if( (iFirst + nCount) > this->GetLength() )
+ if ( (iFirst + nCount) > this->GetLength() )
nCount = this->GetLength()-iFirst;
- if( iFirst > this->GetLength() )
+ if ( iFirst > this->GetLength() )
nCount = 0;
// optimize case of returning entire string
- if( (iFirst == 0) && ((iFirst+nCount) == this->GetLength()) )
+ if ( (iFirst == 0) && ((iFirst+nCount) == this->GetLength()) )
return *this;
return CMStringT( this->GetString()+iFirst, nCount );
@@ -1967,7 +1967,7 @@ public:
nCount = 0;
int nLength = this->GetLength();
- if( nCount >= nLength )
+ if ( nCount >= nLength )
{
return *this;
}
@@ -1983,7 +1983,7 @@ public:
nCount = 0;
int nLength = this->GetLength();
- if( nCount >= nLength )
+ if ( nCount >= nLength )
return *this;
return CMStringT( this->GetString(), nCount );
@@ -2046,7 +2046,7 @@ public:
ULONG nLength = StringTraits::GetEnvironmentVariable( pszVar, NULL, 0 );
BOOL bRetVal = FALSE;
- if( nLength == 0 )
+ if ( nLength == 0 )
{
this->Empty();
}
@@ -2065,7 +2065,7 @@ public:
BOOL LoadString( UINT nID )
{
HINSTANCE hInst = StringTraits::FindStringResourceInstance( nID );
- if( hInst == NULL )
+ if ( hInst == NULL )
return FALSE;
return LoadString( hInst, nID );
diff --git a/protocols/IRCG/commandmonitor.cpp b/protocols/IRCG/commandmonitor.cpp
index 25f07a79ed..0f39828891 100644
--- a/protocols/IRCG/commandmonitor.cpp
+++ b/protocols/IRCG/commandmonitor.cpp
@@ -172,7 +172,7 @@ VOID CALLBACK OnlineNotifTimerProc( HWND, UINT, UINT_PTR idEvent, DWORD )
if ( DBNick && ( !DBWildcard || !WCCmp(CharLower(DBWildcard), CharLower(DBNick))))
ppro->m_namesToWho += CMString(DBNick) + _T(" ");
- else if( DBWildcard )
+ else if ( DBWildcard )
ppro->m_namesToWho += CMString(DBWildcard) + _T(" ");
if ( DBNick ) DBFreeVariant(&dbv);
@@ -545,7 +545,7 @@ bool CIrcProto::OnIrc_MODE( const CIrcMessage* pmsg )
}
else if (*p1 != 'b' && *p1 != ' ' && *p1 != '+' && *p1 != '-' ) {
bContainsValidModes = true;
- if(*p1 != 'l' && *p1 != 'k')
+ if (*p1 != 'l' && *p1 != 'k')
sModes += *p1;
flag = true;
}
@@ -669,7 +669,7 @@ bool CIrcProto::OnIrc_YOURHOST( const CIrcMessage* pmsg )
if ( pmsg->m_bIncoming ) {
static const TCHAR* lpszFmt = _T("Your host is %99[^ \x5b,], running version %99s");
TCHAR szHostName[100], szVersion[100];
- if( _stscanf(pmsg->parameters[1].c_str(), lpszFmt, &szHostName, &szVersion) > 0 )
+ if ( _stscanf(pmsg->parameters[1].c_str(), lpszFmt, &szHostName, &szVersion) > 0 )
m_info.sServerName = szHostName;
if ( pmsg->parameters[0] != m_info.sNick)
m_info.sNick = pmsg->parameters[0];
@@ -940,7 +940,7 @@ bool CIrcProto::IsCTCP( const CIrcMessage* pmsg )
// if all characters are number it indicates we have found the adress, port and size parameters
int ind = 0;
while ( sTemp[ind] != '\0' ) {
- if( !_istdigit( sTemp[ind] ))
+ if ( !_istdigit( sTemp[ind] ))
break;
ind++;
}
@@ -1005,7 +1005,7 @@ bool CIrcProto::IsCTCP( const CIrcMessage* pmsg )
int ind = 0;
while ( sTemp[ind] != '\0' ) {
- if( !_istdigit( sTemp[ind] ))
+ if ( !_istdigit( sTemp[ind] ))
break;
ind++;
}
@@ -1183,7 +1183,7 @@ bool CIrcProto::IsCTCP( const CIrcMessage* pmsg )
di->bTurbo = bTurbo;
di->bSSL = false;
di->bReverse = (iPort == 0 && !sToken.IsEmpty() ) ? true : false;
- if( di->bReverse )
+ if ( di->bReverse )
di->sToken = sTokenBackup;
setTString(hContact, "User", pmsg->prefix.sUser.c_str());
diff --git a/protocols/IRCG/input.cpp b/protocols/IRCG/input.cpp
index d655107b80..a6724359e0 100644
--- a/protocols/IRCG/input.cpp
+++ b/protocols/IRCG/input.cpp
@@ -826,7 +826,7 @@ bool CIrcProto::PostIrcMessageWnd( TCHAR* window, HANDLE hContact, const TCHAR*
lstrcpyn( windowname, dbv.ptszVal, 255);
DBFreeVariant(&dbv);
}
- else if( window )
+ else if ( window )
lstrcpyn( windowname, window, 255 );
else
lstrcpyn( windowname, SERVERWINDOW, 255 );
@@ -921,7 +921,7 @@ bool CIrcProto::PostIrcMessageWnd( TCHAR* window, HANDLE hContact, const TCHAR*
dcc->SendStuff( mess.c_str());
}
}
- else if( IsConnected() ) {
+ else if ( IsConnected() ) {
FormatMsg( DoThis );
SendIrcMessage( DoThis.c_str(), false, codepage );
}
diff --git a/protocols/IRCG/irclib.cpp b/protocols/IRCG/irclib.cpp
index 1dffefff28..a5d3ad1537 100644
--- a/protocols/IRCG/irclib.cpp
+++ b/protocols/IRCG/irclib.cpp
@@ -102,19 +102,19 @@ void CIrcMessage::ParseIrcCommand(const TCHAR* lpszCmdLine)
const TCHAR* p2 = lpszCmdLine;
// prefix exists ?
- if( *p1 == ':' ) {
+ if ( *p1 == ':' ) {
// break prefix into its components (nick!user@host)
p2 = ++p1;
while( *p2 && !_tcschr( _T(" !"), *p2 ))
++p2;
prefix.sNick.SetString(p1, p2 - p1);
- if( *p2 != '!' )
+ if ( *p2 != '!' )
goto end_of_prefix;
p1 = ++p2;
while( *p2 && !_tcschr( _T(" @"), *p2 ))
++p2;
prefix.sUser.SetString(p1, p2 - p1);
- if( *p2 != '@' )
+ if ( *p2 != '@' )
goto end_of_prefix;
p1 = ++p2;
while( *p2 && *p2 != ' ' )
@@ -245,7 +245,7 @@ void CIrcProto::Disconnect(void)
{
static const DWORD dwServerTimeout = 5 * 1000;
- if( con == NULL )
+ if ( con == NULL )
return;
KillIdent();
@@ -392,7 +392,7 @@ void CIrcProto::DoReceive()
int nLinesProcessed = 0;
int cbRead = NLReceive((unsigned char*)chBuf+cbInBuf, sizeof(chBuf)-cbInBuf-1);
- if( cbRead <= 0 )
+ if ( cbRead <= 0 )
break;
cbInBuf += cbRead;
@@ -405,7 +405,7 @@ void CIrcProto::DoReceive()
// seek end-of-line
for(pEnd=pStart; *pEnd && *pEnd != '\r' && *pEnd != '\n'; ++pEnd)
;
- if( *pEnd == '\0' )
+ if ( *pEnd == '\0' )
break; // uncomplete message. stop parsing.
++nLinesProcessed;
@@ -423,7 +423,7 @@ void CIrcProto::DoReceive()
char* p1 = pszTemp;
// replace end-of-line with NULLs
while( *p1 != '\0' ) {
- if( *p1 == '\r' || *p1 == '\n')
+ if ( *p1 == '\r' || *p1 == '\n')
*p1 = '\0';
p1++;
}
@@ -750,7 +750,7 @@ unsigned long ConvertIPToInteger( char* IP )
IN_ADDR in;
IN_ADDR intemp;
- if( IP == 0 || lstrlenA(IP) == 0)
+ if ( IP == 0 || lstrlenA(IP) == 0)
return 0;
intemp.S_un.S_addr = inet_addr(IP);
@@ -1098,7 +1098,7 @@ void __cdecl CDccSession::ThreadProc(void *pparam)
if ( pThis->di->iType == DCC_CHAT )
pThis->DoChatReceive(); // dcc chat
- else if( !pThis->di->bSender )
+ else if ( !pThis->di->bSender )
pThis->DoReceiveFile(); // receive a file
else if ( pThis->di->bSender )
@@ -1178,7 +1178,7 @@ void CDccSession::DoSendFile()
dwRead = CallService( MS_NETLIB_GETMOREPACKETS, (WPARAM)hPackrcver, (LPARAM)&npr);
npr.bytesUsed = sizeof(DWORD);
- if( dwRead <= 0)
+ if ( dwRead <= 0)
break; // connection closed, or a timeout occurred.
dwPacket = *(DWORD*)npr.buffer;
@@ -1245,7 +1245,7 @@ DCC_STOP:
else // file was not possible to open for reading
{
ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, (void *)di, 0);
- if( con ) {
+ if ( con ) {
Netlib_CloseHandle(con);
con = NULL;
} } }
@@ -1353,7 +1353,7 @@ void CDccSession::DoChatReceive()
int nLinesProcessed = 0;
cbRead = NLReceive((unsigned char*)chBuf+cbInBuf, sizeof(chBuf)-cbInBuf-1);
- if( cbRead <= 0 )
+ if ( cbRead <= 0 )
break;
cbInBuf += cbRead;
@@ -1366,7 +1366,7 @@ void CDccSession::DoChatReceive()
// seek end-of-line
for(pEnd=pStart; *pEnd && *pEnd != '\r' && *pEnd != '\n'; ++pEnd)
;
- if( *pEnd == '\0' )
+ if ( *pEnd == '\0' )
break; // uncomplete message. stop parsing.
++nLinesProcessed;
@@ -1375,7 +1375,7 @@ void CDccSession::DoChatReceive()
while( *pEnd == '\r' || *pEnd == '\n' )
*pEnd++ = '\0';
- if( *pStart ) {
+ if ( *pStart ) {
// send it off to some messaging module
PROTORECVEVENT pre = {0};
@@ -1459,7 +1459,7 @@ void DoIdent(HANDLE hConnection, DWORD, void* extra )
for (;;) {
int cbRead = Netlib_Recv(hConnection, szBuf+cbTotal, sizeof(szBuf)-1-cbTotal, 0);
- if( cbRead == SOCKET_ERROR || cbRead == 0)
+ if ( cbRead == SOCKET_ERROR || cbRead == 0)
break;
cbTotal += cbRead;
diff --git a/protocols/IRCG/options.cpp b/protocols/IRCG/options.cpp
index 68b86520c7..76f6a97afe 100644
--- a/protocols/IRCG/options.cpp
+++ b/protocols/IRCG/options.cpp
@@ -817,7 +817,7 @@ void CConnectPrefsDlg::OnApply()
m_proto->m_autoOnlineNotification = m_onlineNotif.GetState();
if ( m_proto->m_autoOnlineNotification ) {
- if( !m_proto->bTempDisableCheck ) {
+ if ( !m_proto->bTempDisableCheck ) {
m_proto->SetChatTimer(m_proto->OnlineNotifTimer, 500, OnlineNotifTimerProc );
if ( m_proto->m_channelAwayNotification )
m_proto->SetChatTimer( m_proto->OnlineNotifTimer3, 1500, OnlineNotifTimerProc3 );
@@ -1591,17 +1591,17 @@ void CIgnorePrefsDlg::OnEdit( CCtrlButton* )
HWND hWnd = dlg->GetHwnd();
SetWindowText(hWnd, TranslateT("Edit ignore"));
if ( szFlags[0] ) {
- if( _tcschr(szFlags, 'q'))
+ if ( _tcschr(szFlags, 'q'))
CheckDlgButton(hWnd, IDC_Q, BST_CHECKED);
- if( _tcschr(szFlags, 'n'))
+ if ( _tcschr(szFlags, 'n'))
CheckDlgButton(hWnd, IDC_N, BST_CHECKED);
- if( _tcschr(szFlags, 'i'))
+ if ( _tcschr(szFlags, 'i'))
CheckDlgButton(hWnd, IDC_I, BST_CHECKED);
- if( _tcschr(szFlags, 'd'))
+ if ( _tcschr(szFlags, 'd'))
CheckDlgButton(hWnd, IDC_D, BST_CHECKED);
- if( _tcschr(szFlags, 'c'))
+ if ( _tcschr(szFlags, 'c'))
CheckDlgButton(hWnd, IDC_C, BST_CHECKED);
- if( _tcschr(szFlags, 'm'))
+ if ( _tcschr(szFlags, 'm'))
CheckDlgButton(hWnd, IDC_M, BST_CHECKED);
}
SetWindowText(GetDlgItem(hWnd, IDC_MASK), szMask);
@@ -1710,7 +1710,7 @@ void CIgnorePrefsDlg::UpdateList()
LVITEM lvm;
lvm.mask= LVIF_PARAM;
lvm.iSubItem = 0;
- for( int i =0; i < j; i++) {
+ for ( int i =0; i < j; i++) {
lvm.iItem = i;
lvm.lParam = i;
m_list.SetItem( &lvm );
diff --git a/protocols/IRCG/output.cpp b/protocols/IRCG/output.cpp
index 72ded9c4be..3f64810a68 100644
--- a/protocols/IRCG/output.cpp
+++ b/protocols/IRCG/output.cpp
@@ -42,7 +42,7 @@ static CMString FormatOutput (const CIrcMessage* pmsg)
TCHAR temp[256]; *temp = '\0';
mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s invites you to %s"), pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
sMessage = temp;
- for( int i=2; i < (int)pmsg->parameters.getCount(); i++ ) {
+ for ( int i=2; i < (int)pmsg->parameters.getCount(); i++ ) {
sMessage += _T(": ") + pmsg->parameters[i];
if ( i != pmsg->parameters.getCount()-1 )
sMessage += _T(" ");
diff --git a/protocols/IRCG/tools.cpp b/protocols/IRCG/tools.cpp
index ae1ae9e061..f2424c5689 100644
--- a/protocols/IRCG/tools.cpp
+++ b/protocols/IRCG/tools.cpp
@@ -183,7 +183,7 @@ CMString __stdcall GetWord(const TCHAR* text, int index)
}
p2 = _tcschr(p1, ' ');
- if( !p2 )
+ if ( !p2 )
p2 = _tcschr(p1, '\0');
if (p1 != p2)
@@ -195,7 +195,7 @@ CMString __stdcall GetWord(const TCHAR* text, int index)
const TCHAR* __stdcall GetWordAddress(const TCHAR* text, int index)
{
- if( !text || !lstrlen(text))
+ if ( !text || !lstrlen(text))
return text;
const TCHAR* temp = text;
@@ -344,7 +344,7 @@ String __stdcall GetWord(const char* text, int index)
}
p2 = strchr(p1, ' ');
- if(!p2)
+ if (!p2)
p2 = strchr(p1, '\0');
if (p1 != p2)
@@ -365,7 +365,7 @@ TCHAR* __stdcall my_strstri(const TCHAR* s1, const TCHAR* s2)
int i,j,k;
for(i=0;s1[i];i++)
for(j=i,k=0; _totlower(s1[j]) == _totlower(s2[k]);j++,k++)
- if(!s2[k+1])
+ if (!s2[k+1])
return ( TCHAR* )(s1+i);
return NULL;
diff --git a/protocols/IRCG/userinfo.cpp b/protocols/IRCG/userinfo.cpp
index cecc61cf2f..d7e8f071b4 100644
--- a/protocols/IRCG/userinfo.cpp
+++ b/protocols/IRCG/userinfo.cpp
@@ -97,7 +97,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem( m_hwnd, IDC_BUTTON), true);
EnableWindow(GetDlgItem( m_hwnd, IDC_BUTTON2), true);
- if( HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_BUTTON ) {
+ if ( HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_BUTTON ) {
TCHAR temp[500];
GetDlgItemText( m_hwnd, IDC_WILDCARD, temp, SIZEOF(temp));
DBVARIANT dbv;
diff --git a/protocols/IRCG/windows.cpp b/protocols/IRCG/windows.cpp
index 37b9356500..79a1b8011f 100644
--- a/protocols/IRCG/windows.cpp
+++ b/protocols/IRCG/windows.cpp
@@ -1097,7 +1097,7 @@ void CManagerDlg::OnApplyModes( CCtrlButton* )
lstrcat( toadd, _T("t"));
if ( wi->pszMode && _tcschr( wi->pszMode, 'n' )) {
- if( !m_check2.GetState())
+ if ( !m_check2.GetState())
lstrcat( toremove, _T("n"));
}
else if ( m_check2.GetState())
@@ -1111,7 +1111,7 @@ void CManagerDlg::OnApplyModes( CCtrlButton* )
lstrcat( toadd, _T("i"));
if ( wi->pszMode && _tcschr( wi->pszMode, 'm' )) {
- if( !m_check4.GetState())
+ if ( !m_check4.GetState())
lstrcat( toremove, _T("m"));
}
else if ( m_check4.GetState())
@@ -1145,7 +1145,7 @@ void CManagerDlg::OnApplyModes( CCtrlButton* )
lstrcat( toremove, _T("k"));
appendixremove += _T(" ") + CMString(wi->pszPassword);
}
- else if( GetWindowTextLength( m_key.GetHwnd())) {
+ else if ( GetWindowTextLength( m_key.GetHwnd())) {
TCHAR temp[400];
m_key.GetText( temp, 14);
diff --git a/protocols/IcqOscarJ/chan_05ping.cpp b/protocols/IcqOscarJ/chan_05ping.cpp
index ac0dc1d87f..d245bd65bf 100644
--- a/protocols/IcqOscarJ/chan_05ping.cpp
+++ b/protocols/IcqOscarJ/chan_05ping.cpp
@@ -53,7 +53,7 @@ void __cdecl CIcqProto::KeepAliveThread(void *arg)
info->hKeepAliveEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
- for(;;)
+ for (;;)
{
DWORD dwWait = ICQWaitForSingleObject(info->hKeepAliveEvent, dwInterval);
if (serverThreadHandle == NULL) // connection lost, end
diff --git a/protocols/IcqOscarJ/changeinfo/dlgproc.cpp b/protocols/IcqOscarJ/changeinfo/dlgproc.cpp
index dd9b9800a8..8d80430f0e 100644
--- a/protocols/IcqOscarJ/changeinfo/dlgproc.cpp
+++ b/protocols/IcqOscarJ/changeinfo/dlgproc.cpp
@@ -427,8 +427,8 @@ INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
return TRUE;
}
case NM_KILLFOCUS:
- if(!IsStringEditWindow(GetFocus())) dat->EndStringEdit(1);
- if(!IsListEditWindow(GetFocus())) dat->EndListEdit(1);
+ if (!IsStringEditWindow(GetFocus())) dat->EndStringEdit(1);
+ if (!IsListEditWindow(GetFocus())) dat->EndListEdit(1);
break;
}
break;
diff --git a/protocols/IcqOscarJ/changeinfo/editstring.cpp b/protocols/IcqOscarJ/changeinfo/editstring.cpp
index 1a4d7138c6..f105ac914a 100644
--- a/protocols/IcqOscarJ/changeinfo/editstring.cpp
+++ b/protocols/IcqOscarJ/changeinfo/editstring.cpp
@@ -76,15 +76,15 @@ static void EscapesToMultiline(WCHAR *str,PDWORD selStart,PDWORD selEnd)
static void EscapesToBinary(char *str)
{
- for(;*str;str++)
+ for (;*str;str++)
{
- if(*str!='\\') continue;
+ if (*str!='\\') continue;
if(str[1]=='n') {*str++='\r'; *str='\n'; continue;}
if(str[1]=='0')
{
char *codeend;
*str=(char)strtol(str+1,&codeend,8);
- if(*str==0) {*str='\\'; continue;}
+ if (*str==0) {*str='\\'; continue;}
memmove(str+1,codeend,strlennull(codeend)+1);
continue;
}
@@ -106,9 +106,9 @@ char *BinaryToEscapes(char *str)
char *out,*pout;
out=pout=(char*)SAFE_MALLOC(len);
- for(;*str;str++)
+ for (;*str;str++)
{
- if((unsigned char)*str>=' ')
+ if ((unsigned char)*str>=' ')
{
*pout++=*str;
continue;
@@ -127,7 +127,7 @@ char *BinaryToEscapes(char *str)
}
*pout++='\\';
for(i = 0; i < SIZEOF(escapes); i += 2)
- if(*str==escapes[i+1])
+ if (*str==escapes[i+1])
{
*pout++=escapes[i];
extra--;
@@ -135,7 +135,7 @@ char *BinaryToEscapes(char *str)
}
if(i < SIZEOF(escapes)) continue;
*pout++='0'; extra--;
- if(*str>=8)
+ if (*str>=8)
{
*pout++=(*str>>3)+'0';
extra--;
@@ -218,7 +218,7 @@ static LRESULT CALLBACK ExpandButtonSubclassProc(HWND hwnd,UINT msg,WPARAM wPara
{
DWORD startTime,timeNow;
startTime=GetTickCount();
- for(;;)
+ for (;;)
{
UpdateWindow(hwndEdit);
timeNow=GetTickCount();
@@ -285,7 +285,7 @@ void ChangeInfoData::BeginStringEdit(int iItem, RECT *rc, int i, WORD wVKey)
hwndUpDown=CreateWindow(UPDOWN_CLASS,_T(""),WS_VISIBLE|WS_CHILD|UDS_AUTOBUDDY|UDS_ALIGNRIGHT|UDS_HOTTRACK|UDS_NOTHOUSANDS|UDS_SETBUDDYINT,0,0,0,0,hwndList,NULL,hInst,NULL);
SendMessage(hwndUpDown, UDM_SETRANGE32, range[0], range[1]);
SendMessage(hwndUpDown, UDM_SETPOS32, 0, settingData[i].value);
- if(!(setting[i].displayType & LIF_ZEROISVALID) && settingData[i].value==0)
+ if (!(setting[i].displayType & LIF_ZEROISVALID) && settingData[i].value==0)
SetWindowTextA(hwndEdit, "");
GetClientRect(hwndUpDown, &rcUpDown);
rc->right -= rcUpDown.right;
@@ -306,7 +306,7 @@ void ChangeInfoData::EndStringEdit(int save)
GetWindowTextA(hwndEdit,(char*)text,GetWindowTextLength(hwndEdit)+1);
EscapesToBinary(text);
- if((setting[iEditItem].displayType&LIM_TYPE)==LI_NUMBER)
+ if ((setting[iEditItem].displayType&LIM_TYPE)==LI_NUMBER)
{
LPARAM newValue;
int *range=(int*)setting[iEditItem].pList;
diff --git a/protocols/IcqOscarJ/changeinfo/upload.cpp b/protocols/IcqOscarJ/changeinfo/upload.cpp
index 0f82a87b99..05193e467b 100644
--- a/protocols/IcqOscarJ/changeinfo/upload.cpp
+++ b/protocols/IcqOscarJ/changeinfo/upload.cpp
@@ -40,7 +40,7 @@ int CIcqProto::StringToListItemId(const char *szSetting,int def)
int i;
for(i=0;i<settingCount;i++)
- if(!strcmpnull(szSetting,setting[i].szDbSetting))
+ if (!strcmpnull(szSetting,setting[i].szDbSetting))
break;
if (i==settingCount) return def;
diff --git a/protocols/IcqOscarJ/i18n.cpp b/protocols/IcqOscarJ/i18n.cpp
index afd61d2583..5ebfded9ce 100644
--- a/protocols/IcqOscarJ/i18n.cpp
+++ b/protocols/IcqOscarJ/i18n.cpp
@@ -228,11 +228,11 @@ WCHAR* __stdcall make_unicode_string_static(const char *utf8, WCHAR *unicode, si
while (c)
{
if (out_index + 1 >= unicode_size) break;
- if((c & 0x80) == 0)
+ if ((c & 0x80) == 0)
{
unicode[out_index++] = c;
}
- else if((c & 0xe0) == 0xe0)
+ else if ((c & 0xe0) == 0xe0)
{
unicode[out_index] = (c & 0x1F) << 12;
c = utf8[index++];
diff --git a/protocols/IcqOscarJ/icq_direct.cpp b/protocols/IcqOscarJ/icq_direct.cpp
index 6a81a9b253..55e860adea 100644
--- a/protocols/IcqOscarJ/icq_direct.cpp
+++ b/protocols/IcqOscarJ/icq_direct.cpp
@@ -964,7 +964,7 @@ int DecryptDirectPacket(directconnect* dc, PBYTE buf, WORD wLen)
}
X1 = buf[M1] ^ 0xFF;
- if(((B1 >> 16) & 0xFF) != X1)
+ if (((B1 >> 16) & 0xFF) != X1)
{
return 0;
}
diff --git a/protocols/IcqOscarJ/icq_popups.cpp b/protocols/IcqOscarJ/icq_popups.cpp
index e1cdadada6..3bc1382ef2 100644
--- a/protocols/IcqOscarJ/icq_popups.cpp
+++ b/protocols/IcqOscarJ/icq_popups.cpp
@@ -124,7 +124,7 @@ INT_PTR CALLBACK DlgProcIcqPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case IDC_POPUP_LOG2_TIMEOUT:
case IDC_POPUP_LOG3_TIMEOUT:
case IDC_POPUP_SPAM_TIMEOUT:
- if((HIWORD(wParam) == EN_CHANGE) && bInitDone)
+ if ((HIWORD(wParam) == EN_CHANGE) && bInitDone)
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
default:
diff --git a/protocols/JabberG/MString.cpp b/protocols/JabberG/MString.cpp
index 524231fde2..773871d1a5 100644
--- a/protocols/JabberG/MString.cpp
+++ b/protocols/JabberG/MString.cpp
@@ -75,7 +75,7 @@ bool CMStringData::IsShared() const
void CMStringData::Lock()
{
nRefs--; // Locked buffers can't be shared, so no interlocked operation necessary
- if( nRefs == 0 )
+ if ( nRefs == 0 )
nRefs = -1;
}
diff --git a/protocols/JabberG/MString.h b/protocols/JabberG/MString.h
index fbef22ddf5..6f90b7741b 100644
--- a/protocols/JabberG/MString.h
+++ b/protocols/JabberG/MString.h
@@ -126,7 +126,7 @@ public:
CMSimpleStringT(const XCHAR* pchSrc, int nLength)
{
CMStringData* pData = Allocate( nLength, sizeof( XCHAR ) );
- if( pData != NULL )
+ if ( pData != NULL )
{
Attach( pData );
SetLength( nLength );
@@ -148,9 +148,9 @@ public:
{
CMStringData* pSrcData = strSrc.GetData();
CMStringData* pOldData = GetData();
- if( pSrcData != pOldData)
+ if ( pSrcData != pOldData)
{
- if( pOldData->IsLocked() )
+ if ( pOldData->IsLocked() )
SetString( strSrc.GetString(), strSrc.GetLength() );
else
{
@@ -238,7 +238,7 @@ public:
int nNewLength = nOldLength+nLength;
PXSTR pszBuffer = GetBuffer( nNewLength );
- if( nOffset <= nOldLength )
+ if ( nOffset <= nOldLength )
{
pszSrc = pszBuffer+nOffset;
// No need to call CopyCharsOverlapped, since the destination is
@@ -262,10 +262,10 @@ public:
void Empty()
{
CMStringData* pOldData = GetData();
- if( pOldData->nDataLength == 0 )
+ if ( pOldData->nDataLength == 0 )
return;
- if( pOldData->IsLocked() )
+ if ( pOldData->IsLocked() )
{
// Don't reallocate a locked buffer that's shrinking
SetLength( 0 );
@@ -281,13 +281,13 @@ public:
{
CMStringData* pOldData = GetData();
int nLength = pOldData->nDataLength;
- if( pOldData->nAllocLength == nLength )
+ if ( pOldData->nAllocLength == nLength )
return;
- if( !pOldData->IsLocked() ) // Don't reallocate a locked buffer that's shrinking
+ if ( !pOldData->IsLocked() ) // Don't reallocate a locked buffer that's shrinking
{
CMStringData* pNewData = Allocate( nLength, sizeof( XCHAR ) );
- if( pNewData == NULL ) {
+ if ( pNewData == NULL ) {
SetLength( nLength );
return;
}
@@ -311,7 +311,7 @@ public:
PXSTR GetBuffer()
{
CMStringData* pData = GetData();
- if( pData->IsShared() )
+ if ( pData->IsShared() )
Fork( pData->nDataLength );
return m_pszData;
@@ -343,7 +343,7 @@ public:
PXSTR LockBuffer()
{
CMStringData* pData = GetData();
- if( pData->IsShared() )
+ if ( pData->IsShared() )
{
Fork( pData->nDataLength );
pData = GetData(); // Do it again, because the fork might have changed it
@@ -363,7 +363,7 @@ public:
}
void ReleaseBuffer( int nNewLength = -1 )
{
- if( nNewLength == -1 )
+ if ( nNewLength == -1 )
{
int nAlloc = GetData()->nAllocLength;
nNewLength = StringLengthN( m_pszData, nAlloc);
@@ -393,7 +393,7 @@ public:
}
void SetString( PCXSTR pszSrc, int nLength )
{
- if( nLength == 0 )
+ if ( nLength == 0 )
{
Empty();
}
@@ -404,7 +404,7 @@ public:
UINT_PTR nOffset = pszSrc - GetString();
PXSTR pszBuffer = GetBuffer( nLength );
- if( nOffset <= nOldLength )
+ if ( nOffset <= nOldLength )
{
CopyCharsOverlapped( pszBuffer, GetAllocLength(),
pszBuffer+nOffset, nLength );
@@ -492,14 +492,14 @@ public:
}
static int __stdcall StringLengthN(const char* psz, size_t sizeInXChar )
{
- if( psz == NULL )
+ if ( psz == NULL )
return 0;
return int( strnlen( psz, sizeInXChar ));
}
static int __stdcall StringLengthN(const wchar_t* psz, size_t sizeInXChar )
{
- if( psz == NULL )
+ if ( psz == NULL )
return 0;
return int( wcsnlen( psz, sizeInXChar ));
@@ -561,12 +561,12 @@ private:
{
// Grow exponentially, until we hit 1K.
int nNewLength = pOldData->nAllocLength;
- if( nNewLength > 1024 )
+ if ( nNewLength > 1024 )
nNewLength += 1024;
else
nNewLength *= 2;
- if( nNewLength < nLength )
+ if ( nNewLength < nLength )
nNewLength = nLength;
Reallocate( nNewLength );
@@ -579,7 +579,7 @@ private:
return;
CMStringData* pNewData = Realloc( pOldData, nLength, sizeof( XCHAR ) );
- if( pNewData != NULL )
+ if ( pNewData != NULL )
Attach( pNewData );
}
@@ -816,7 +816,7 @@ public:
{
int nLen = ::MultiByteToWideChar( _AtlGetConversionACP(), 0, pchData, nDataLength, NULL, NULL );
BSTR bstr = ::SysAllocStringLen( NULL, nLen );
- if( bstr != NULL )
+ if ( bstr != NULL )
::MultiByteToWideChar( _AtlGetConversionACP(), 0, pchData, nDataLength, bstr, nLen );
return bstr;
@@ -826,7 +826,7 @@ public:
{
int nLen = ::MultiByteToWideChar( _AtlGetConversionACP(), 0, pchData, nDataLength, NULL, NULL );
BOOL bSuccess = ::SysReAllocStringLen( pbstr, NULL, nLen );
- if( bSuccess )
+ if ( bSuccess )
::MultiByteToWideChar( _AtlGetConversionACP(), 0, pchData, nDataLength, *pbstr, nLen );
return bSuccess;
@@ -1030,7 +1030,7 @@ public:
static void __stdcall FloodCharacters( wchar_t ch, int nLength, LPWSTR psz )
{
// nLength is in XCHARs
- for( int i = 0; i < nLength; i++ )
+ for ( int i = 0; i < nLength; i++ )
{
psz[i] = ch;
}
@@ -1144,7 +1144,7 @@ public:
CMStringT( char ch, int nLength = 1 ) :
CThisSimpleString()
{
- if( nLength > 0 )
+ if ( nLength > 0 )
{
PXSTR pszBuffer = this->GetBuffer( nLength );
StringTraits::FloodCharacters( XCHAR( ch ), nLength, pszBuffer );
@@ -1155,7 +1155,7 @@ public:
CMStringT( wchar_t ch, int nLength = 1 ) :
CThisSimpleString()
{
- if( nLength > 0 )
+ if ( nLength > 0 )
{
//Convert ch to the BaseType
wchar_t pszCh[2] = { ch , 0 };
@@ -1198,7 +1198,7 @@ public:
CMStringT( const YCHAR* pch, int nLength ) :
CThisSimpleString()
{
- if( nLength > 0 )
+ if ( nLength > 0 )
{
int nDestLength = StringTraits::GetBaseTypeLength( pch, nLength );
PXSTR pszBuffer = this->GetBuffer( nDestLength );
@@ -1231,7 +1231,7 @@ public:
{
// nDestLength is in XCHARs
int nDestLength = (pszSrc != NULL) ? StringTraits::GetBaseTypeLength( pszSrc ) : 0;
- if( nDestLength > 0 )
+ if ( nDestLength > 0 )
{
PXSTR pszBuffer = this->GetBuffer( nDestLength );
StringTraits::ConvertToBaseType( pszBuffer, nDestLength, pszSrc);
@@ -1345,18 +1345,18 @@ public:
// Delete 'nCount' characters, starting at index 'iIndex'
int Delete( int iIndex, int nCount = 1 )
{
- if( iIndex < 0 )
+ if ( iIndex < 0 )
iIndex = 0;
- if( nCount < 0 )
+ if ( nCount < 0 )
nCount = 0;
int nLength = this->GetLength();
- if( nCount + iIndex > nLength )
+ if ( nCount + iIndex > nLength )
{
nCount = nLength-iIndex;
}
- if( nCount > 0 )
+ if ( nCount > 0 )
{
int nNewLength = nLength-nCount;
int nXCHARsToCopy = nLength-(iIndex+nCount)+1;
@@ -1375,10 +1375,10 @@ public:
// Insert character 'ch' before index 'iIndex'
int Insert( int iIndex, XCHAR ch )
{
- if( iIndex < 0 )
+ if ( iIndex < 0 )
iIndex = 0;
- if( iIndex > this->GetLength() )
+ if ( iIndex > this->GetLength() )
iIndex = this->GetLength();
int nNewLength = this->GetLength()+1;
@@ -1400,10 +1400,10 @@ public:
// Insert string 'psz' before index 'iIndex'
int Insert( int iIndex, PCXSTR psz )
{
- if( iIndex < 0 )
+ if ( iIndex < 0 )
iIndex = 0;
- if( iIndex > this->GetLength() )
+ if ( iIndex > this->GetLength() )
{
iIndex = this->GetLength();
}
@@ -1411,7 +1411,7 @@ public:
// nInsertLength and nNewLength are in XCHARs
int nInsertLength = StringTraits::SafeStringLen( psz );
int nNewLength = this->GetLength();
- if( nInsertLength > 0 )
+ if ( nInsertLength > 0 )
{
nNewLength += nInsertLength;
@@ -1436,7 +1436,7 @@ public:
int nCount = 0;
// short-circuit the nop case
- if( chOld != chNew )
+ if ( chOld != chNew )
{
// otherwise modify each character that matches in the string
bool bCopied = false;
@@ -1447,9 +1447,9 @@ public:
while( iChar < nLength )
{
// replace instances of the specified character only
- if( pszBuffer[iChar] == chOld )
+ if ( pszBuffer[iChar] == chOld )
{
- if( !bCopied )
+ if ( !bCopied )
{
bCopied = true;
pszBuffer = this->GetBuffer( nLength );
@@ -1459,7 +1459,7 @@ public:
}
iChar = int( StringTraits::CharNext( pszBuffer+iChar )-pszBuffer );
}
- if( bCopied )
+ if ( bCopied )
{
this->ReleaseBufferSetLength( nLength );
}
@@ -1475,7 +1475,7 @@ public:
// nSourceLen is in XCHARs
int nSourceLen = StringTraits::SafeStringLen( pszOld );
- if( nSourceLen == 0 )
+ if ( nSourceLen == 0 )
return 0;
// nReplacementLen is in XCHARs
int nReplacementLen = StringTraits::SafeStringLen( pszNew );
@@ -1498,7 +1498,7 @@ public:
}
// if any changes were made, make them
- if( nCount > 0 )
+ if ( nCount > 0 )
{
// if the buffer is too small, just
// allocate a new buffer (slow but sure)
@@ -1546,7 +1546,7 @@ public:
while( pszSource < pszEnd )
{
PXSTR pszNewSource = StringTraits::CharNext( pszSource );
- if( *pszSource != chRemove )
+ if ( *pszSource != chRemove )
{
// Copy the source to the destination. Remember to copy all bytes of an MBCS character
// Copy the source to the destination. Remember to copy all bytes of an MBCS character
@@ -1571,7 +1571,7 @@ public:
CMStringT Tokenize( PCXSTR pszTokens, int& iStart ) const
{
- if( (pszTokens == NULL) || (*pszTokens == (XCHAR)0) )
+ if ( (pszTokens == NULL) || (*pszTokens == (XCHAR)0) )
{
if (iStart < this->GetLength())
return CMStringT( this->GetString()+iStart );
@@ -1580,11 +1580,11 @@ public:
{
PCXSTR pszPlace = this->GetString()+iStart;
PCXSTR pszEnd = this->GetString()+this->GetLength();
- if( pszPlace < pszEnd )
+ if ( pszPlace < pszEnd )
{
int nIncluding = StringTraits::StringSpanIncluding( pszPlace, pszTokens );
- if( (pszPlace+nIncluding) < pszEnd )
+ if ( (pszPlace+nIncluding) < pszEnd )
{
pszPlace += nIncluding;
int nExcluding = StringTraits::StringSpanExcluding( pszPlace, pszTokens );
@@ -1611,7 +1611,7 @@ public:
{
// nLength is in XCHARs
int nLength = this->GetLength();
- if( iStart < 0 || iStart >= nLength)
+ if ( iStart < 0 || iStart >= nLength)
return -1;
// find first single character
@@ -1632,7 +1632,7 @@ public:
// nLength is in XCHARs
int nLength = this->GetLength();
- if( iStart < 0 || iStart > nLength )
+ if ( iStart < 0 || iStart > nLength )
return -1;
// find first matching substring
@@ -1707,9 +1707,9 @@ public:
while( *psz != 0 )
{
- if( StringTraits::IsSpace( *psz ) )
+ if ( StringTraits::IsSpace( *psz ) )
{
- if( pszLast == NULL )
+ if ( pszLast == NULL )
pszLast = psz;
}
else
@@ -1719,7 +1719,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( pszLast != NULL )
+ if ( pszLast != NULL )
{
// truncate at trailing space start
int iLast = int( pszLast-this->GetString() );
@@ -1742,7 +1742,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( psz != this->GetString() )
+ if ( psz != this->GetString() )
{
// fix up data and length
int iFirst = int( psz-this->GetString() );
@@ -1788,9 +1788,9 @@ public:
while( *psz != 0 )
{
- if( *psz == chTarget )
+ if ( *psz == chTarget )
{
- if( pszLast == NULL )
+ if ( pszLast == NULL )
{
pszLast = psz;
}
@@ -1802,7 +1802,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( pszLast != NULL )
+ if ( pszLast != NULL )
{
// truncate at left-most matching character
int iLast = int( pszLast-this->GetString() );
@@ -1816,7 +1816,7 @@ public:
CMStringT& TrimRight( PCXSTR pszTargets )
{
// if we're not trimming anything, we're not doing any work
- if( (pszTargets == NULL) || (*pszTargets == 0) )
+ if ( (pszTargets == NULL) || (*pszTargets == 0) )
{
return *this;
}
@@ -1829,9 +1829,9 @@ public:
while( *psz != 0 )
{
- if( StringTraits::StringFindChar( pszTargets, *psz ) != NULL )
+ if ( StringTraits::StringFindChar( pszTargets, *psz ) != NULL )
{
- if( pszLast == NULL )
+ if ( pszLast == NULL )
{
pszLast = psz;
}
@@ -1843,7 +1843,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( pszLast != NULL )
+ if ( pszLast != NULL )
{
// truncate at left-most matching character
int iLast = int( pszLast-this->GetString() );
@@ -1864,7 +1864,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( psz != this->GetString() )
+ if ( psz != this->GetString() )
{
// fix up data and length
int iFirst = int( psz-this->GetString() );
@@ -1883,7 +1883,7 @@ public:
CMStringT& TrimLeft( PCXSTR pszTargets )
{
// if we're not trimming anything, we're not doing any work
- if( (pszTargets == NULL) || (*pszTargets == 0) )
+ if ( (pszTargets == NULL) || (*pszTargets == 0) )
{
return *this;
}
@@ -1894,7 +1894,7 @@ public:
psz = StringTraits::CharNext( psz );
}
- if( psz != this->GetString() )
+ if ( psz != this->GetString() )
{
// fix up data and length
int iFirst = int( psz-this->GetString() );
@@ -1946,14 +1946,14 @@ public:
if (nCount < 0)
nCount = 0;
- if( (iFirst + nCount) > this->GetLength() )
+ if ( (iFirst + nCount) > this->GetLength() )
nCount = this->GetLength()-iFirst;
- if( iFirst > this->GetLength() )
+ if ( iFirst > this->GetLength() )
nCount = 0;
// optimize case of returning entire string
- if( (iFirst == 0) && ((iFirst+nCount) == this->GetLength()) )
+ if ( (iFirst == 0) && ((iFirst+nCount) == this->GetLength()) )
return *this;
return CMStringT( this->GetString()+iFirst, nCount );
@@ -1967,7 +1967,7 @@ public:
nCount = 0;
int nLength = this->GetLength();
- if( nCount >= nLength )
+ if ( nCount >= nLength )
{
return *this;
}
@@ -1983,7 +1983,7 @@ public:
nCount = 0;
int nLength = this->GetLength();
- if( nCount >= nLength )
+ if ( nCount >= nLength )
return *this;
return CMStringT( this->GetString(), nCount );
@@ -2046,7 +2046,7 @@ public:
ULONG nLength = StringTraits::GetEnvironmentVariable( pszVar, NULL, 0 );
BOOL bRetVal = FALSE;
- if( nLength == 0 )
+ if ( nLength == 0 )
{
this->Empty();
}
@@ -2065,7 +2065,7 @@ public:
BOOL LoadString( UINT nID )
{
HINSTANCE hInst = StringTraits::FindStringResourceInstance( nID );
- if( hInst == NULL )
+ if ( hInst == NULL )
return FALSE;
return LoadString( hInst, nID );
diff --git a/protocols/JabberG/jabber_adhoc.cpp b/protocols/JabberG/jabber_adhoc.cpp
index f83fc88c3a..29cee4cd8e 100644
--- a/protocols/JabberG/jabber_adhoc.cpp
+++ b/protocols/JabberG/jabber_adhoc.cpp
@@ -608,6 +608,6 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM wParam, LPARAM lParam )
void CJabberProto::ContactMenuAdhocCommands( CJabberAdhocStartupParams* param )
{
- if( param )
+ if ( param )
CreateDialogParam( hInst, MAKEINTRESOURCE( IDD_FORM ), NULL, JabberAdHoc_CommandDlgProc, (LPARAM)param );
}
diff --git a/protocols/JabberG/jabber_captcha.cpp b/protocols/JabberG/jabber_captcha.cpp
index 046edc3863..c090499cd2 100644
--- a/protocols/JabberG/jabber_captcha.cpp
+++ b/protocols/JabberG/jabber_captcha.cpp
@@ -51,7 +51,7 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam
params = (CAPTCHA_FORM_PARAMS*)lParam;
LPCTSTR hint = params->hint;
- if( hint == NULL )
+ if ( hint == NULL )
hint = TranslateT("Enter the text you see");
SetDlgItemText( hwndDlg, IDC_INSTRUCTION, TranslateTS( hint ) );
SetWindowLongPtr( hwndDlg, GWLP_USERDATA, ( LONG )params );
@@ -112,7 +112,7 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam
return FALSE;
}
-bool CJabberProto::ProcessCaptcha (HXML node, HXML parentNode, ThreadData* info ){
+bool CJabberProto::ProcessCaptcha (HXML node, HXML parentNode, ThreadData* info ) {
CAPTCHA_FORM_PARAMS param;
char *ImageBuf = 0;
const TCHAR *PicType = 0;
@@ -165,7 +165,7 @@ bool CJabberProto::ProcessCaptcha (HXML node, HXML parentNode, ThreadData* info
return true;
}
-void CJabberProto::GetCaptchaImage ( HXML node, char *ImageBuf, const TCHAR *PicType, TCHAR*& CaptchaPath ){
+void CJabberProto::GetCaptchaImage ( HXML node, char *ImageBuf, const TCHAR *PicType, TCHAR*& CaptchaPath ) {
HXML o = xmlGetChild( node , "data" );
int bufferLen;
char* buffer = JabberBase64DecodeT(xmlGetText( o ), &bufferLen );
@@ -227,7 +227,7 @@ void CJabberProto::sendCaptchaResult(TCHAR* buf, ThreadData* info, LPCTSTR from,
info -> send (iq);
}
-void CJabberProto::sendCaptchaError(ThreadData* info, LPCTSTR from, LPCTSTR to, LPCTSTR challenge ){
+void CJabberProto::sendCaptchaError(ThreadData* info, LPCTSTR from, LPCTSTR to, LPCTSTR challenge ) {
XmlNode message( _T("message"));
HXML query= message << XATTR(_T("type"), _T("error")) << XATTR(_T("to"), from) << XATTR(_T("id"), challenge) << XATTR(_T("from"), to)
<< XCHILD(_T("error")) << XATTR(_T("type"), _T("modify"))
diff --git a/protocols/JabberG/jabber_events.cpp b/protocols/JabberG/jabber_events.cpp
index 7e26de73d9..722f55f6b4 100644
--- a/protocols/JabberG/jabber_events.cpp
+++ b/protocols/JabberG/jabber_events.cpp
@@ -45,7 +45,7 @@ Last change by : $Author: borkra $
int CJabberProto::OnContactDeleted( WPARAM wParam, LPARAM )
{
- if( !m_bJabberOnline ) // should never happen
+ if ( !m_bJabberOnline ) // should never happen
return 0;
DBVARIANT dbv;
diff --git a/protocols/JabberG/jabber_iq_handlers.cpp b/protocols/JabberG/jabber_iq_handlers.cpp
index 31a843f7bf..bcb7192c5b 100644
--- a/protocols/JabberG/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/jabber_iq_handlers.cpp
@@ -90,7 +90,7 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) )
+ if ( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) )
return FALSE;
// Call GetNativeSystemInfo if supported or GetSystemInfo otherwise.
@@ -111,14 +111,14 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
if ( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1 )
{
- if( osvi.wProductType == VER_NT_WORKSTATION )
+ if ( osvi.wProductType == VER_NT_WORKSTATION )
StringCchCat(pszOS, BUFSIZE, TEXT("Windows 7 "));
else StringCchCat(pszOS, BUFSIZE, TEXT("Windows Server 2008 R2 " ));
}
if ( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0 )
{
- if( osvi.wProductType == VER_NT_WORKSTATION )
+ if ( osvi.wProductType == VER_NT_WORKSTATION )
StringCchCat(pszOS, BUFSIZE, TEXT("Windows Vista "));
else StringCchCat(pszOS, BUFSIZE, TEXT("Windows Server 2008 " ));
@@ -190,13 +190,13 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )
{
- if( GetSystemMetrics(SM_SERVERR2) )
+ if ( GetSystemMetrics(SM_SERVERR2) )
StringCchCat(pszOS, BUFSIZE, TEXT( "Windows Server 2003 R2, "));
else if ( osvi.wSuiteMask==VER_SUITE_STORAGE_SERVER )
StringCchCat(pszOS, BUFSIZE, TEXT( "Windows Storage Server 2003"));
else if ( osvi.wSuiteMask==VER_SUITE_WH_SERVER )
StringCchCat(pszOS, BUFSIZE, TEXT( "Windows Home Server"));
- else if( osvi.wProductType == VER_NT_WORKSTATION &&
+ else if ( osvi.wProductType == VER_NT_WORKSTATION &&
si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64)
{
StringCchCat(pszOS, BUFSIZE, TEXT( "Windows XP Professional x64 Edition"));
@@ -208,17 +208,17 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
{
if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA64 )
{
- if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
+ if ( osvi.wSuiteMask & VER_SUITE_DATACENTER )
StringCchCat(pszOS, BUFSIZE, TEXT( "Datacenter Edition for Itanium-based Systems" ));
- else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
+ else if ( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
StringCchCat(pszOS, BUFSIZE, TEXT( "Enterprise Edition for Itanium-based Systems" ));
}
else if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64 )
{
- if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
+ if ( osvi.wSuiteMask & VER_SUITE_DATACENTER )
StringCchCat(pszOS, BUFSIZE, TEXT( "Datacenter x64 Edition" ));
- else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
+ else if ( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
StringCchCat(pszOS, BUFSIZE, TEXT( "Enterprise x64 Edition" ));
else StringCchCat(pszOS, BUFSIZE, TEXT( "Standard x64 Edition" ));
}
@@ -227,9 +227,9 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
{
if ( osvi.wSuiteMask & VER_SUITE_COMPUTE_SERVER )
StringCchCat(pszOS, BUFSIZE, TEXT( "Compute Cluster Edition" ));
- else if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
+ else if ( osvi.wSuiteMask & VER_SUITE_DATACENTER )
StringCchCat(pszOS, BUFSIZE, TEXT( "Datacenter Edition" ));
- else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
+ else if ( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
StringCchCat(pszOS, BUFSIZE, TEXT( "Enterprise Edition" ));
else if ( osvi.wSuiteMask & VER_SUITE_BLADE )
StringCchCat(pszOS, BUFSIZE, TEXT( "Web Edition" ));
@@ -241,7 +241,7 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 )
{
StringCchCat(pszOS, BUFSIZE, TEXT("Windows XP "));
- if( osvi.wSuiteMask & VER_SUITE_PERSONAL )
+ if ( osvi.wSuiteMask & VER_SUITE_PERSONAL )
StringCchCat(pszOS, BUFSIZE, TEXT( "Home Edition" ));
else StringCchCat(pszOS, BUFSIZE, TEXT( "Professional" ));
}
@@ -256,9 +256,9 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
}
else
{
- if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
+ if ( osvi.wSuiteMask & VER_SUITE_DATACENTER )
StringCchCat(pszOS, BUFSIZE, TEXT( "Datacenter Server" ));
- else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
+ else if ( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
StringCchCat(pszOS, BUFSIZE, TEXT( "Advanced Server" ));
else StringCchCat(pszOS, BUFSIZE, TEXT( "Server" ));
}
@@ -266,7 +266,7 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
// Include service pack (if any) and build number.
- if( _tcslen(osvi.szCSDVersion) > 0 )
+ if ( _tcslen(osvi.szCSDVersion) > 0 )
{
StringCchCat(pszOS, BUFSIZE, TEXT(" ") );
StringCchCat(pszOS, BUFSIZE, osvi.szCSDVersion);
diff --git a/protocols/JabberG/jabber_iqid.cpp b/protocols/JabberG/jabber_iqid.cpp
index db15079953..72ddcf6d4c 100644
--- a/protocols/JabberG/jabber_iqid.cpp
+++ b/protocols/JabberG/jabber_iqid.cpp
@@ -345,7 +345,7 @@ void CJabberProto::GroupchatJoinByHContact( HANDLE hContact, bool autojoin )
TCHAR *nick = JGetStringT( hContact, "MyNick" );
if ( !nick ) {
nick = JabberNickFromJID( m_szJabberJID );
- if( !nick ) {
+ if ( !nick ) {
mir_free( roomjid );
return;
}
diff --git a/protocols/JabberG/jabber_iqid_muc.cpp b/protocols/JabberG/jabber_iqid_muc.cpp
index c088c265de..9cd4cdb51c 100644
--- a/protocols/JabberG/jabber_iqid_muc.cpp
+++ b/protocols/JabberG/jabber_iqid_muc.cpp
@@ -288,7 +288,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc( HWND hwndDlg, UINT msg, WPARAM
ListView_GetSubItemRect( nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, LVIR_LABEL, &rc );
if ( nm->iSubItem == 1 ) {
- if( nm->nmcd.lItemlParam == ( LPARAM )( -1 ))
+ if ( nm->nmcd.lItemlParam == ( LPARAM )( -1 ))
hIcon = ( HICON )LoadImage( hInst, MAKEINTRESOURCE( IDI_ADDCONTACT ), IMAGE_ICON, GetSystemMetrics( SM_CXSMICON ), GetSystemMetrics( SM_CYSMICON ), 0 );
else
hIcon = ( HICON )LoadImage( hInst, MAKEINTRESOURCE( IDI_DELETE ), IMAGE_ICON, GetSystemMetrics( SM_CXSMICON ), GetSystemMetrics( SM_CYSMICON ), 0 );
diff --git a/protocols/JabberG/jabber_list.cpp b/protocols/JabberG/jabber_list.cpp
index 47f336187f..2397e0bd73 100644
--- a/protocols/JabberG/jabber_list.cpp
+++ b/protocols/JabberG/jabber_list.cpp
@@ -82,7 +82,7 @@ void CJabberProto::ListWipe( void )
int i;
EnterCriticalSection( &m_csLists );
- for( i=0; i < m_lstRoster.getCount(); i++ )
+ for ( i=0; i < m_lstRoster.getCount(); i++ )
JabberListFreeItemInternal( m_lstRoster[i] );
m_lstRoster.destroy();
@@ -432,7 +432,7 @@ int CJabberProto::ListFindNext( JABBER_LIST list, int fromOffset )
{
EnterCriticalSection( &m_csLists );
int i = ( fromOffset >= 0 ) ? fromOffset : 0;
- for( ; i<m_lstRoster.getCount(); i++ )
+ for ( ; i<m_lstRoster.getCount(); i++ )
if ( m_lstRoster[i]->list == list ) {
LeaveCriticalSection( &m_csLists );
return i;
diff --git a/protocols/JabberG/jabber_opt.cpp b/protocols/JabberG/jabber_opt.cpp
index 574cf4b50c..5baae257e7 100644
--- a/protocols/JabberG/jabber_opt.cpp
+++ b/protocols/JabberG/jabber_opt.cpp
@@ -1292,7 +1292,7 @@ void CJabberProto::_RosterExportToFile(HWND hwndDlg)
ofn.nMaxFile = SIZEOF(filename);
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = _T("xml");
- if(!GetSaveFileName(&ofn)) return;
+ if (!GetSaveFileName(&ofn)) return;
FILE * fp = fopent(filename,_T("w"));
if (!fp) return;
diff --git a/protocols/JabberG/jabber_privacy.cpp b/protocols/JabberG/jabber_privacy.cpp
index f6c1514c29..67c8504d76 100644
--- a/protocols/JabberG/jabber_privacy.cpp
+++ b/protocols/JabberG/jabber_privacy.cpp
@@ -2153,7 +2153,7 @@ void CJabberDlgPrivacyLists::clcClist_OnClick(CCtrlClc::TEventInfo *evt)
if(evt->info->iColumn==-1) return;
hItem = m_clcClist.HitTest(evt->info->pt.x, evt->info->pt.y, &hitFlags);
if(hItem==NULL) return;
- if(!(hitFlags&CLCHT_ONITEMEXTRA)) return;
+ if (!(hitFlags&CLCHT_ONITEMEXTRA)) return;
iImage = m_clcClist.GetExtraImage(hItem, evt->info->iColumn);
if (iImage != 0xFF)
diff --git a/protocols/JabberG/jabber_proto.cpp b/protocols/JabberG/jabber_proto.cpp
index 21f067e12e..2457eab7a2 100644
--- a/protocols/JabberG/jabber_proto.cpp
+++ b/protocols/JabberG/jabber_proto.cpp
@@ -1130,7 +1130,7 @@ HANDLE __cdecl CJabberProto::SendFile( HANDLE hContact, const TCHAR* szDescripti
ft->std.ptszFiles = ( TCHAR** ) mir_calloc( sizeof( TCHAR* )* ft->std.totalFiles );
ft->fileSize = ( unsigned __int64* ) mir_calloc( sizeof( unsigned __int64 ) * ft->std.totalFiles );
- for( i=j=0; i < ft->std.totalFiles; i++ ) {
+ for ( i=j=0; i < ft->std.totalFiles; i++ ) {
if ( _tstati64( ppszFiles[i], &statbuf ))
Log( "'%s' is an invalid filename", ppszFiles[i] );
else {
@@ -1565,7 +1565,7 @@ int __cdecl CJabberProto::UserIsTyping( HANDLE hContact, int type )
if ( jcb & JABBER_CAPS_CHATSTATES ) {
m << XATTR( _T("type"), _T("chat")) << XATTRID( SerialNext());
- switch ( type ){
+ switch ( type ) {
case PROTOTYPE_SELFTYPING_OFF:
m << XCHILDNS( _T("paused"), _T(JABBER_FEAT_CHATSTATES));
m_ThreadInfo->send( m );
@@ -1581,7 +1581,7 @@ int __cdecl CJabberProto::UserIsTyping( HANDLE hContact, int type )
if ( item->messageEventIdStr != NULL )
x << XCHILD( _T("id"), item->messageEventIdStr );
- switch ( type ){
+ switch ( type ) {
case PROTOTYPE_SELFTYPING_OFF:
m_ThreadInfo->send( m );
break;
diff --git a/protocols/JabberG/jabber_proxy.cpp b/protocols/JabberG/jabber_proxy.cpp
index 9ee30bf03b..e6f7ef2f7b 100644
--- a/protocols/JabberG/jabber_proxy.cpp
+++ b/protocols/JabberG/jabber_proxy.cpp
@@ -37,14 +37,14 @@ int JabberHttpGatewayInit( HANDLE /*hConn*/, NETLIBOPENCONNECTION* /*nloc*/, NET
char szSid[33], szHttpServer[256], szHttpGetUrl[300], szHttpPostUrl[300];
NETLIBHTTPPROXYINFO nlhpi = {0};
- for( responseBytes = 0; ; ) {
+ for ( responseBytes = 0; ; ) {
recvResult = Netlib_Recv( hConn, response + responseBytes, sizeof( response ) - responseBytes, MSG_DUMPPROXY );
- if( recvResult<=0 ) break;
+ if ( recvResult<=0 ) break;
responseBytes += recvResult;
- if( responseBytes == sizeof( response ))
+ if ( responseBytes == sizeof( response ))
break;
}
- if( responseBytes < 31 )
+ if ( responseBytes < 31 )
{
SetLastError( ERROR_INVALID_DATA );
return 0;
@@ -60,7 +60,7 @@ int JabberHttpGatewayInit( HANDLE /*hConn*/, NETLIBOPENCONNECTION* /*nloc*/, NET
unpackDWord( &buf, &dwSid4 );
sprintf( szSid, "%08x%08x%08x%08x", dwSid1, dwSid2, dwSid3, dwSid4 );
unpackWord( &buf, &wIpLen );
- if( responseBytes < 30 + wIpLen || wIpLen == 0 || wIpLen > sizeof( szHttpServer ) - 1 )
+ if ( responseBytes < 30 + wIpLen || wIpLen == 0 || wIpLen > sizeof( szHttpServer ) - 1 )
{
SetLastError( ERROR_INVALID_DATA );
return 0;
@@ -111,9 +111,9 @@ int icq_httpGatewayWrapSend( HANDLE hConn, PBYTE buf, int len, int flags, MIRAND
packString( &packet, buf, ( WORD )len );
sendResult = Netlib_Send( hConn, packet.pData, packet.wLen, flags );
mir_free( packet.pData );
- if( sendResult <= 0 )
+ if ( sendResult <= 0 )
return sendResult;
- if( sendResult < 14 )
+ if ( sendResult < 14 )
return 0;
return sendResult - 14;
}
@@ -125,7 +125,7 @@ PBYTE icq_httpGatewayUnwrapRecv( NETLIBHTTPREQUEST *nlhr, PBYTE buf, int len, in
int i, copyBytes;
tbuf = buf;
- for( i = 0;; )
+ for ( i = 0;; )
{
if ( tbuf - buf + 2 > len ) break;
unpackWord( &tbuf, &wLen );
diff --git a/protocols/JabberG/jabber_search.h b/protocols/JabberG/jabber_search.h
index c978f2ff9c..ca754e4238 100644
--- a/protocols/JabberG/jabber_search.h
+++ b/protocols/JabberG/jabber_search.h
@@ -165,7 +165,7 @@ public:
int index=_Records.getIndex(rec);
if (index<0)
{
- if(!_Records.insert(rec)) delete rec;
+ if (!_Records.insert(rec)) delete rec;
else
{
index=_Records.getIndex(rec);
@@ -186,7 +186,7 @@ public:
if (index<0)
{
_KEYTYPE* newKey=CopyProc(Key);
- if(!_Records.insert(rec))
+ if (!_Records.insert(rec))
{
delete rec;
DestroyProc(newKey);
diff --git a/protocols/JabberG/jabber_svc.cpp b/protocols/JabberG/jabber_svc.cpp
index 31ff002999..ed5bfd7b78 100644
--- a/protocols/JabberG/jabber_svc.cpp
+++ b/protocols/JabberG/jabber_svc.cpp
@@ -480,7 +480,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI( WPARAM wParam, LPARAM l
return 1;
// skip //
- for( ++szJid; *szJid == _T( '/' ); ++szJid );
+ for ( ++szJid; *szJid == _T( '/' ); ++szJid );
// empty jid?
if ( !*szJid )
diff --git a/protocols/JabberG/jabber_thread.cpp b/protocols/JabberG/jabber_thread.cpp
index 3c343600c8..bfb3ba0129 100644
--- a/protocols/JabberG/jabber_thread.cpp
+++ b/protocols/JabberG/jabber_thread.cpp
@@ -1735,7 +1735,7 @@ void CJabberProto::OnProcessPresence( HXML node, ThreadData* info )
Log( "Not hasXAvatar" );
for ( int i = 1; ( xNode=xmlGetNthChild( node, _T("x"), i )) != NULL; i++ ) {
if ( !lstrcmp( xmlGetAttrValue( xNode, _T("xmlns")), _T("vcard-temp:x:update"))) {
- if (( xNode = xmlGetChild( xNode , "photo" )) != NULL ){
+ if (( xNode = xmlGetChild( xNode , "photo" )) != NULL ) {
LPCTSTR txt = xmlGetText( xNode );
if ( txt != NULL && txt[0] != 0) {
JSetByte( hContact, "AvatarXVcard", 1 );
diff --git a/protocols/JabberG/jabber_vcard.cpp b/protocols/JabberG/jabber_vcard.cpp
index ee7b2d4638..2ec8dcf3d7 100644
--- a/protocols/JabberG/jabber_vcard.cpp
+++ b/protocols/JabberG/jabber_vcard.cpp
@@ -817,7 +817,7 @@ static INT_PTR CALLBACK ContactDlgProc( HWND hwndDlg, UINT msg, WPARAM, LPARAM l
HICON hIcon;
ListView_GetSubItemRect( nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, LVIR_LABEL, &rc );
- if( nm->nmcd.lItemlParam==( LPARAM )( -1 ) && nm->iSubItem==3 )
+ if ( nm->nmcd.lItemlParam==( LPARAM )( -1 ) && nm->iSubItem==3 )
hIcon = ( HICON )LoadImage( hInst, MAKEINTRESOURCE( IDI_ADDCONTACT ), IMAGE_ICON, GetSystemMetrics( SM_CXSMICON ), GetSystemMetrics( SM_CYSMICON ), 0 );
else if ( nm->iSubItem==2 && nm->nmcd.lItemlParam!=( LPARAM )( -1 ))
hIcon = ( HICON )LoadImage( hInst, MAKEINTRESOURCE( IDI_EDIT ), IMAGE_ICON, GetSystemMetrics( SM_CXSMICON ), GetSystemMetrics( SM_CYSMICON ), 0 );
@@ -872,7 +872,7 @@ static INT_PTR CALLBACK ContactDlgProc( HWND hwndDlg, UINT msg, WPARAM, LPARAM l
char idstr[33];
DBVARIANT dbv;
- for( i=lvi.lParam;;i++ ) {
+ for ( i=lvi.lParam;;i++ ) {
WORD nFlag;
wsprintfA( idstr, szIdTemplate, i+1 );
diff --git a/protocols/JabberG/jabber_xstatus.cpp b/protocols/JabberG/jabber_xstatus.cpp
index 96bc7fd948..28e1c63096 100644
--- a/protocols/JabberG/jabber_xstatus.cpp
+++ b/protocols/JabberG/jabber_xstatus.cpp
@@ -443,7 +443,7 @@ void CPepService::ResetPublish()
void CPepService::ForceRepublishOnLogin()
{
- if(!m_wasPublished)
+ if (!m_wasPublished)
Publish();
}
@@ -799,7 +799,7 @@ void CPepMood::SetMood(HANDLE hContact, const TCHAR *szMood, const TCHAR *szText
void CPepMood::ShowSetDialog(BYTE bQuiet)
{
- if( !bQuiet ) {
+ if ( !bQuiet ) {
CJabberDlgPepSimple dlg(m_proto, TranslateT("Set Mood"));
for (int i = 1; i < SIZEOF(g_arrMoods); ++i)
dlg.AddStatusMode(i, g_arrMoods[i].szTag, m_icons.GetIcon(g_arrMoods[i].szTag), TranslateTS(g_arrMoods[i].szName));
@@ -1070,7 +1070,7 @@ void CPepActivity::InitGui()
TCHAR szSection[100];
mir_sntprintf(szSection, SIZEOF(szSection), _T("Status Icons/%s/Activities"), m_proto->m_tszUserName);
- for (int i = 0; i < SIZEOF(g_arrActivities); i++){
+ for (int i = 0; i < SIZEOF(g_arrActivities); i++) {
if (g_arrActivities[i].szFirst)
m_icons.RegisterIcon(g_arrActivities[i].szFirst, szFile, g_arrActivities[i].iconid, szSection, TranslateTS(g_arrActivities[i].szTitle));
if (g_arrActivities[i].szSecond)
diff --git a/protocols/MRA/Mra.cpp b/protocols/MRA/Mra.cpp
index e5e5d22e0f..26cdc4ffec 100644
--- a/protocols/MRA/Mra.cpp
+++ b/protocols/MRA/Mra.cpp
@@ -326,7 +326,7 @@ return(0);
void VersionConversions()
{
- /*switch(DB_Mra_GetDword(NULL,"LastPluginVersion",PLUGIN_MAKE_VERSION(0,0,0,0))){
+ /*switch(DB_Mra_GetDword(NULL,"LastPluginVersion",PLUGIN_MAKE_VERSION(0,0,0,0))) {
default:
case PLUGIN_MAKE_VERSION(1,14,0,0):
case PLUGIN_MAKE_VERSION(1,14,0,1):
diff --git a/protocols/MRA/MraAdvancedSearch.cpp b/protocols/MRA/MraAdvancedSearch.cpp
index 86ac51309a..c97ae8aba2 100644
--- a/protocols/MRA/MraAdvancedSearch.cpp
+++ b/protocols/MRA/MraAdvancedSearch.cpp
@@ -196,7 +196,7 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,L
}
break;
case WM_COMMAND:
- switch(LOWORD(wParam)){
+ switch(LOWORD(wParam)) {
case IDOK:
SendMessage(GetParent(hWndDlg),WM_COMMAND,MAKEWPARAM(IDOK,BN_CLICKED),(LPARAM)GetDlgItem(GetParent(hWndDlg),IDOK));
break;
diff --git a/protocols/MRA/MraAntiSpam.cpp b/protocols/MRA/MraAntiSpam.cpp
index 38607c2107..20be25d33a 100644
--- a/protocols/MRA/MraAntiSpam.cpp
+++ b/protocols/MRA/MraAntiSpam.cpp
@@ -224,7 +224,7 @@ INT_PTR CALLBACK MraAntiSpamDlgProcOpts(HWND hWndDlg,UINT msg,WPARAM wParam,LPAR
}
dwCount=((i*2)+1024);
- for(;i<dwCount;i++)
+ for (;i<dwCount;i++)
{
mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
DB_Mra_DeleteValue(NULL,szSettingName);
@@ -271,7 +271,7 @@ void MraAntiSpamResetBadWordsList()
}
dwMax=(i+1024);
- for(;i<dwMax;i++)
+ for (;i<dwMax;i++)
{
mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
DB_Mra_DeleteValue(NULL,szSettingName);
diff --git a/protocols/MRA/MraAvatars.cpp b/protocols/MRA/MraAvatars.cpp
index 1916f5ab16..b1ca17ca29 100644
--- a/protocols/MRA/MraAvatars.cpp
+++ b/protocols/MRA/MraAvatars.cpp
@@ -347,7 +347,7 @@ void MraAvatarsThreadProc(LPVOID lpParameter)
nls.hReadConns[0] = hConnection;
while ( bContinue ) {
- switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)){
+ switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)) {
case SOCKET_ERROR:
case 0:// Time out
dwErrorCode=GetLastError();
diff --git a/protocols/MRA/MraFilesQueue.cpp b/protocols/MRA/MraFilesQueue.cpp
index 3dd2055501..09e052c822 100644
--- a/protocols/MRA/MraFilesQueue.cpp
+++ b/protocols/MRA/MraFilesQueue.cpp
@@ -871,7 +871,7 @@ LPWSTR GetFileNameFromFullPathW(LPWSTR lpwszFullPath,SIZE_T dwFullPathSize)
LPWSTR lpwszFileName=lpwszFullPath,lpwszCurPos;
lpwszCurPos=(lpwszFullPath+dwFullPathSize);
- for(;lpwszCurPos>lpwszFullPath;lpwszCurPos--)
+ for (;lpwszCurPos>lpwszFullPath;lpwszCurPos--)
{
if ((*lpwszCurPos)=='\\')
{
@@ -1129,7 +1129,7 @@ void MraFilesQueueRecvThreadProc(LPVOID lpParameter)
while(bContinue)
{
- switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)){
+ switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)) {
case SOCKET_ERROR:
case 0:// Time out
dwRetErrorCode=GetLastError();
diff --git a/protocols/MRA/MraFilesQueue_mod.cpp b/protocols/MRA/MraFilesQueue_mod.cpp
index 23488c9a91..b315636a69 100644
--- a/protocols/MRA/MraFilesQueue_mod.cpp
+++ b/protocols/MRA/MraFilesQueue_mod.cpp
@@ -104,7 +104,7 @@ BOOL CALLBACK MraFilesQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LP
CheckDlgButton(hWndDlg,IDC_FILE_SEND_IGNORYADDITIONALPORTS,DB_Mra_GetByte(NULL,"FileSendIgnoryAdditionalPorts",MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS));
CheckDlgButton(hWndDlg,IDC_FILE_SEND_HIDE_MY_ADDRESSES,DB_Mra_GetByte(NULL,"FileSendHideMyAddresses",MRA_DEF_FS_HIDE_MY_ADDRESSES));
CheckDlgButton(hWndDlg,IDC_FILE_SEND_ADD_EXTRA_ADDRESS,DB_Mra_GetByte(NULL,"FileSendAddExtraAddresses",MRA_DEF_FS_ADD_EXTRA_ADDRESSES));
- if(!DBGetContactSetting(NULL,PROTOCOL_NAME,"FileSendExtraAddresses",&dbv)) {
+ if (!DBGetContactSetting(NULL,PROTOCOL_NAME,"FileSendExtraAddresses",&dbv)) {
//bit of a security hole here, since it's easy to extract a password from an edit box
SetDlgItemText(hWndDlg,IDC_FILE_SEND_EXTRA_ADDRESS,dbv.pszVal);
DBFreeVariant(&dbv);
@@ -846,7 +846,7 @@ HANDLE MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem)
nloc.flags=NLOCF_V2;
if (DB_Mra_GetByte(NULL,"FileSendIgnoryAdditionalPorts",MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS))
{// ôèëüòðóåì ïîðòû äëÿ îäíîãî IP, âìåñòî 3 áóäåì êîííåêòèòñÿ òîëüêî ê îäíîìó
- switch(DB_Mra_GetWord(NULL,"ServerPort",MRA_DEFAULT_SERVER_PORT)){
+ switch(DB_Mra_GetWord(NULL,"ServerPort",MRA_DEFAULT_SERVER_PORT)) {
case MRA_SERVER_PORT_STANDART_NLB:
dwLocalPort=MRA_SERVER_PORT_STANDART;
break;
diff --git a/protocols/MRA/MraMRIMProxy.cpp b/protocols/MRA/MraMRIMProxy.cpp
index 296cd5f4de..1eb3ac24c9 100644
--- a/protocols/MRA/MraMRIMProxy.cpp
+++ b/protocols/MRA/MraMRIMProxy.cpp
@@ -162,7 +162,7 @@ DWORD MraMrimProxyConnect(HANDLE hMraMrimProxyData,HANDLE *phConnection)
while(bContinue)
{
- switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)){
+ switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)) {
case SOCKET_ERROR:
case 0:// Time out
dwRetErrorCode=GetLastError();
diff --git a/protocols/MRA/MraPopUp.cpp b/protocols/MRA/MraPopUp.cpp
index 9a2fac8fb9..00247bd3a7 100644
--- a/protocols/MRA/MraPopUp.cpp
+++ b/protocols/MRA/MraPopUp.cpp
@@ -64,7 +64,7 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR
}
return(TRUE);
case WM_COMMAND:
- switch(LOWORD(wParam)){
+ switch(LOWORD(wParam)) {
case IDC_COMBO_POPUP_TYPE:
if (HIWORD(wParam) == CBN_SELCHANGE) {
BOOL bEnabled, bUseWinColors;
diff --git a/protocols/MRA/MraSelectEMail.cpp b/protocols/MRA/MraSelectEMail.cpp
index ba9da3d471..cf993ebd7e 100644
--- a/protocols/MRA/MraSelectEMail.cpp
+++ b/protocols/MRA/MraSelectEMail.cpp
@@ -61,7 +61,7 @@ INT_PTR CALLBACK MraSelectEMailDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,L
EndDialog(hWndDlg,NO_ERROR);
break;
case WM_COMMAND:
- switch(LOWORD(wParam)){
+ switch(LOWORD(wParam)) {
case IDC_LIST_EMAILS:
if (HIWORD(wParam)==LBN_DBLCLK)
{
diff --git a/protocols/MRA/Mra_functions.cpp b/protocols/MRA/Mra_functions.cpp
index 222dd85dda..bb88dc3dcd 100644
--- a/protocols/MRA/Mra_functions.cpp
+++ b/protocols/MRA/Mra_functions.cpp
@@ -462,7 +462,7 @@ DWORD GetContactFlags(HANDLE hContact)
if (DBGetContactSettingByte(hContact,"CList","Hidden",0)) dwRet|=CONTACT_FLAG_SHADOW;
- switch(DB_Mra_GetWord(hContact,"ApparentMode",0)){
+ switch(DB_Mra_GetWord(hContact,"ApparentMode",0)) {
case ID_STATUS_OFFLINE:
dwRet|=CONTACT_FLAG_INVISIBLE;
break;
@@ -490,7 +490,7 @@ DWORD SetContactFlags(HANDLE hContact,DWORD dwContactFlag)
}else{
DBDeleteContactSetting(hContact,"CList","Hidden");
}
- switch(dwContactFlag&(CONTACT_FLAG_INVISIBLE|CONTACT_FLAG_VISIBLE)){
+ switch(dwContactFlag&(CONTACT_FLAG_INVISIBLE|CONTACT_FLAG_VISIBLE)) {
case CONTACT_FLAG_INVISIBLE:
DB_Mra_SetWord(hContact,"ApparentMode",ID_STATUS_OFFLINE);
break;
@@ -578,7 +578,7 @@ DWORD SetContactBasicInfoW(HANDLE hContact,DWORD dwSetInfoFlags,DWORD dwFlags,DW
if(dwFlags&SCBIF_NICK)
{
- if((dwFlags&SCBIF_FLAG) && ((dwContactFlag&CONTACT_FLAG_UNICODE_NAME)==0))
+ if ((dwFlags&SCBIF_FLAG) && ((dwContactFlag&CONTACT_FLAG_UNICODE_NAME)==0))
{
if (lpwszNick && dwNickSize) DB_SetStringExA(hContact,"CList","MyHandle",(LPSTR)lpwszNick,dwNickSize);
}else{
@@ -1759,7 +1759,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARA
DestroyWindow(hWndDlg);
break;
case WM_COMMAND:
- switch(LOWORD(wParam)){
+ switch(LOWORD(wParam)) {
case IDOK:
DestroyWindow(hWndDlg);
break;
@@ -1895,7 +1895,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg,UINT message,WPARAM wPa
DestroyWindow(hWndDlg);
break;
case WM_COMMAND:
- switch(LOWORD(wParam)){
+ switch(LOWORD(wParam)) {
case IDOK:
{
DWORD dwFlags;
diff --git a/protocols/MRA/Mra_options.cpp b/protocols/MRA/Mra_options.cpp
index b0f1484843..d478ac5308 100644
--- a/protocols/MRA/Mra_options.cpp
+++ b/protocols/MRA/Mra_options.cpp
@@ -72,7 +72,7 @@ INT_PTR CALLBACK DlgProcOptsAccount(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM l
}
return(TRUE);
case WM_COMMAND:
- switch (LOWORD(wParam)){
+ switch (LOWORD(wParam)) {
case IDC_NEW_ACCOUNT_LINK:
CallService(MS_UTILS_OPENURL,TRUE,(LPARAM)MRA_REGISTER_URL);
return(TRUE);
@@ -152,7 +152,7 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg,UINT msg,WPARAM wParam,LPAR
}
return(TRUE);
case WM_COMMAND:
- switch(LOWORD(wParam)){
+ switch(LOWORD(wParam)) {
case IDC_BUTTON_DEFAULT:
SET_DLG_ITEM_TEXTA(hWndDlg,IDC_SERVER,MRA_DEFAULT_SERVER);
SetDlgItemInt(hWndDlg,IDC_SERVERPORT,MRA_DEFAULT_SERVER_PORT,FALSE);
diff --git a/protocols/MRA/Mra_proto.cpp b/protocols/MRA/Mra_proto.cpp
index 7d1c865d5f..04e6023dd8 100644
--- a/protocols/MRA/Mra_proto.cpp
+++ b/protocols/MRA/Mra_proto.cpp
@@ -230,7 +230,7 @@ DWORD MraGetNLBData(LPSTR lpszHost,SIZE_T dwHostBuffSize,WORD *pwPort)
while(MraGetStatus(0,0)!=ID_STATUS_OFFLINE && bContinue)
{
- switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)){
+ switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)) {
case SOCKET_ERROR:
case 0:// Time out
bContinue=FALSE;
@@ -951,7 +951,7 @@ DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,D
case MRIM_CS_ANKETA_INFO:
if (MraSendQueueFind(masMraSettings.hSendQueueHandle,pmaHeader->seq,NULL,&hContact,&dwAckType,(LPBYTE*)&lpsString.lpszData,&lpsString.dwSize)==NO_ERROR)
{
- switch(GetUL(&lpbDataCurrent)){
+ switch(GetUL(&lpbDataCurrent)) {
case MRIM_ANKETA_INFO_STATUS_OK:// ïîèñê óñïåøíî çàâåðøåí
{
DWORD dwFeildsNum,dwMaxRows,dwServerTime,dwStatus;
@@ -1014,7 +1014,7 @@ DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,D
}else
if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Sex",3)==CSTR_EQUAL)
{
- switch(StrToUNum32(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize)){
+ switch(StrToUNum32(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize)) {
case 1:// ìóæñêîé
DB_Mra_SetByte(hContact,"Gender",'M');
break;
@@ -1400,7 +1400,7 @@ DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,D
dwControlParam=0;
for(j=0;j<dwGroupMaskSize;j++)//enumerating parameters
{
- switch(szGroupMask[j]){
+ switch(szGroupMask[j]) {
case 's'://LPS
GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
break;
@@ -1463,7 +1463,7 @@ DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,D
dwControlParam=0;
for(j=0;j<dwContactMaskSize;j++)//enumerating parameters
{
- switch(szContactMask[j]){
+ switch(szContactMask[j]) {
case 's'://LPS
GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
break;
@@ -1645,7 +1645,7 @@ DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,D
DebugBreak();
}else{
dwTemp=GetMiradaStatusFromMraStatus(dwStatus,GetMraXStatusIDFromMraUriStatus(lpsSpecStatusUri.lpszData,lpsSpecStatusUri.dwSize),&dwXStatus);
- if((dwContactFlag&CONTACT_FLAG_UNICODE_NAME)) mralpsNick.dwSize/=sizeof(WCHAR);
+ if ((dwContactFlag&CONTACT_FLAG_UNICODE_NAME)) mralpsNick.dwSize/=sizeof(WCHAR);
if (bAdded)
{// update user info
diff --git a/protocols/MRA/Sdk/Base64.h b/protocols/MRA/Sdk/Base64.h
index f371399a06..24d7605c47 100644
--- a/protocols/MRA/Sdk/Base64.h
+++ b/protocols/MRA/Sdk/Base64.h
@@ -271,8 +271,8 @@ __inline DWORD BASE64DecodeUnSafe(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID
}
dwDecodedSize=(lpbtDestination-((LPBYTE)lpcDestination));
- if((*((BYTE*)lpcSource+(dwSourceSize-1)))=='=') dwDecodedSize--;
- if((*((BYTE*)lpcSource+(dwSourceSize-2)))=='=') dwDecodedSize--;
+ if ((*((BYTE*)lpcSource+(dwSourceSize-1)))=='=') dwDecodedSize--;
+ if ((*((BYTE*)lpcSource+(dwSourceSize-2)))=='=') dwDecodedSize--;
#else
@@ -329,8 +329,8 @@ __inline DWORD BASE64DecodeUnSafe(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID
pop ebx // âîññòàíàâëèâàåì ñîäåðæèìîå ðåãèñòðà
}
- if((*((BYTE*)lpcSource+(dwSourceSize-1)))=='=') dwDecodedSize--;
- if((*((BYTE*)lpcSource+(dwSourceSize-2)))=='=') dwDecodedSize--;
+ if ((*((BYTE*)lpcSource+(dwSourceSize-1)))=='=') dwDecodedSize--;
+ if ((*((BYTE*)lpcSource+(dwSourceSize-2)))=='=') dwDecodedSize--;
#endif
dwRetErrorCode=NO_ERROR;
}else{// âî âõîäíîì áóôôåðå ñëèøêîì ìàëî äàííûõ
diff --git a/protocols/MSN/des.c b/protocols/MSN/des.c
index 12d59914cd..030fb983cd 100644
--- a/protocols/MSN/des.c
+++ b/protocols/MSN/des.c
@@ -317,9 +317,9 @@ static void des_main_ks( unsigned long SK[32], unsigned char key[8] )
/*
* calculate subkeys
*/
- for( i = 0; i < 16; i++ )
+ for ( i = 0; i < 16; i++ )
{
- if( i < 2 || i == 8 || i == 15 )
+ if ( i < 2 || i == 8 || i == 15 )
{
X = ((X << 1) | (X >> 27)) & 0x0FFFFFFF;
Y = ((Y << 1) | (Y >> 27)) & 0x0FFFFFFF;
@@ -365,7 +365,7 @@ void des_set_key( des_context *ctx, unsigned char key[8] )
des_main_ks( ctx->esk, key );
- for( i = 0; i < 32; i += 2 )
+ for ( i = 0; i < 32; i += 2 )
{
ctx->dsk[i ] = ctx->esk[30 - i];
ctx->dsk[i + 1] = ctx->esk[31 - i];
@@ -431,7 +431,7 @@ void des_cbc_encrypt( des_context *ctx,
while( len > 0 )
{
- for( i = 0; i < 8; i++ )
+ for ( i = 0; i < 8; i++ )
output[i] = input[i] ^ iv[i];
des_crypt( ctx->esk, output, output );
@@ -460,7 +460,7 @@ void des_cbc_decrypt( des_context *ctx,
memcpy( temp, input, 8 );
des_crypt( ctx->dsk, input, output );
- for( i = 0; i < 8; i++ )
+ for ( i = 0; i < 8; i++ )
output[i] = output[i] ^ iv[i];
memcpy( iv, temp, 8 );
@@ -481,7 +481,7 @@ void des3_set_2keys( des3_context *ctx, unsigned char key[16] )
des_main_ks( ctx->esk , key );
des_main_ks( ctx->dsk + 32, key + 8 );
- for( i = 0; i < 32; i += 2 )
+ for ( i = 0; i < 32; i += 2 )
{
ctx->dsk[i ] = ctx->esk[30 - i];
ctx->dsk[i + 1] = ctx->esk[31 - i];
@@ -508,7 +508,7 @@ void des3_set_3keys( des3_context *ctx, unsigned char key[24] )
des_main_ks( ctx->dsk + 32, key + 8 );
des_main_ks( ctx->esk + 64, key + 16 );
- for( i = 0; i < 32; i += 2 )
+ for ( i = 0; i < 32; i += 2 )
{
ctx->dsk[i ] = ctx->esk[94 - i];
ctx->dsk[i + 1] = ctx->esk[95 - i];
@@ -598,7 +598,7 @@ void des3_cbc_encrypt( des3_context *ctx,
while( len > 0 )
{
- for( i = 0; i < 8; i++ )
+ for ( i = 0; i < 8; i++ )
output[i] = input[i] ^ iv[i];
des3_crypt( ctx->esk, output, output );
@@ -627,7 +627,7 @@ void des3_cbc_decrypt( des3_context *ctx,
memcpy( temp, input, 8 );
des3_crypt( ctx->dsk, input, output );
- for( i = 0; i < 8; i++ )
+ for ( i = 0; i < 8; i++ )
output[i] = output[i] ^ iv[i];
memcpy( iv, temp, 8 );
diff --git a/protocols/MSN/msn_commands.cpp b/protocols/MSN/msn_commands.cpp
index a85ff46fe4..af6494f741 100644
--- a/protocols/MSN/msn_commands.cpp
+++ b/protocols/MSN/msn_commands.cpp
@@ -278,7 +278,7 @@ void CMsnProto::sttCustomSmiley(const char* msgBody, char* email, char* nick, in
unsigned iCount = 0;
bool parseSmiley = true;
- for(;;)
+ for (;;)
{
tok2 = strchr(tok1, '\t');
if (tok2 == NULL) break;
diff --git a/protocols/MSN/msn_threads.cpp b/protocols/MSN/msn_threads.cpp
index 4043806b51..f312fcdc01 100644
--- a/protocols/MSN/msn_threads.cpp
+++ b/protocols/MSN/msn_threads.cpp
@@ -200,7 +200,7 @@ void __cdecl CMsnProto::MSNServerThread(void* arg)
}
else
{
- for(;;)
+ for (;;)
{
char* peol = strchr(info->mData, '\r');
if (peol == NULL)
diff --git a/protocols/Omegle/chat.cpp b/protocols/Omegle/chat.cpp
index 169877b9fb..b69a41bf50 100644
--- a/protocols/Omegle/chat.cpp
+++ b/protocols/Omegle/chat.cpp
@@ -307,7 +307,7 @@ int OmegleProto::OnJoinChat(WPARAM,LPARAM suppress)
SetTopic();
// Note: Initialization will finish up in SetChatStatus, called separately
- if(!suppress)
+ if (!suppress)
SetChatStatus(m_iStatus);
return 0;
diff --git a/protocols/Omegle/dialogs.cpp b/protocols/Omegle/dialogs.cpp
index e6a05d688e..21aadb34a8 100644
--- a/protocols/Omegle/dialogs.cpp
+++ b/protocols/Omegle/dialogs.cpp
@@ -39,7 +39,7 @@ static BOOL StoreDBCheckState(OmegleProto* ppro, HWND hwnd, int idCtrl, const ch
static void LoadDBText(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
{
DBVARIANT dbv;
- if( !DBGetContactSettingTString(NULL, ppro->m_szModuleName, szSetting, &dbv) )
+ if ( !DBGetContactSettingTString(NULL, ppro->m_szModuleName, szSetting, &dbv) )
{
SetDlgItemText(hwnd, idCtrl, dbv.ptszVal);
DBFreeVariant(&dbv);
diff --git a/protocols/Omegle/proto.cpp b/protocols/Omegle/proto.cpp
index 7fd27e65c6..e6d2324aa3 100644
--- a/protocols/Omegle/proto.cpp
+++ b/protocols/Omegle/proto.cpp
@@ -243,9 +243,9 @@ int OmegleProto::OnContactDeleted(WPARAM wparam,LPARAM)
const char *proto = reinterpret_cast<char*>( CallService(MS_PROTO_GETCONTACTBASEPROTO,
reinterpret_cast<WPARAM>(hContact),0) );
- if( proto && strcmp(m_szModuleName,proto) == 0 )
+ if ( proto && strcmp(m_szModuleName,proto) == 0 )
{
- if( include_chat )
+ if ( include_chat )
return true;
else
return DBGetContactSettingByte(hContact,m_szModuleName,"ChatRoom",0) == 0;
diff --git a/protocols/Omegle/theme.cpp b/protocols/Omegle/theme.cpp
index ea1cf9cf16..740d16277e 100644
--- a/protocols/Omegle/theme.cpp
+++ b/protocols/Omegle/theme.cpp
@@ -96,11 +96,11 @@ static OmegleProto * GetInstanceByHContact(HANDLE hContact)
{
char *proto = reinterpret_cast<char*>( CallService(MS_PROTO_GETCONTACTBASEPROTO,
reinterpret_cast<WPARAM>(hContact),0) );
- if(!proto)
+ if (!proto)
return 0;
for(int i=0; i<g_Instances.getCount(); i++)
- if(!strcmp(proto,g_Instances[i].m_szModuleName))
+ if (!strcmp(proto,g_Instances[i].m_szModuleName))
return &g_Instances[i];
return 0;
diff --git a/protocols/Weather/weather.h b/protocols/Weather/weather.h
index ecca3deecf..e2b4f268cd 100644
--- a/protocols/Weather/weather.h
+++ b/protocols/Weather/weather.h
@@ -22,6 +22,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//============ THE INCLUDES ===========
+
+#define _CRT_SECURE_NO_WARNINGS
#include <m_stdhdr.h>
#include <stdio.h>
diff --git a/protocols/Weather/weather_conv.cpp b/protocols/Weather/weather_conv.cpp
index 9f466c3772..8cab451181 100644
--- a/protocols/Weather/weather_conv.cpp
+++ b/protocols/Weather/weather_conv.cpp
@@ -453,7 +453,7 @@ void TrimString(WCHAR *str)
void ConvertBackslashes(char *str)
{
char *pstr;
- for( pstr=str; *pstr; pstr = CharNextA(pstr)) {
+ for ( pstr=str; *pstr; pstr = CharNextA(pstr)) {
if (*pstr=='\\') {
switch(pstr[1]) {
case 'n': *pstr='\n'; break;
diff --git a/protocols/Yahoo/avatar.cpp b/protocols/Yahoo/avatar.cpp
index 4ad7233cb9..9b093ccb3d 100644
--- a/protocols/Yahoo/avatar.cpp
+++ b/protocols/Yahoo/avatar.cpp
@@ -37,7 +37,7 @@ int YAHOO_avt_hash(const char *key, DWORD len)
while(i--) {
checksum = (checksum << 4) + *p++;
- if((g = (checksum & 0xf0000000)) != 0)
+ if ((g = (checksum & 0xf0000000)) != 0)
checksum ^= g >> 23;
checksum &= ~g;
@@ -186,7 +186,7 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt)
SetDword(hContact, "PictLoading", 1);
}
- if(!error) {
+ if (!error) {
NETLIBHTTPREQUEST nlhr={0},*nlhrReply;
@@ -406,7 +406,7 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p
LOG(("[ext_yahoo_got_picture] My Checksum: %d", mcksum));
- if (!DBGetContactSettingString(NULL, m_szModuleName, "AvatarURL", &dbv)){
+ if (!DBGetContactSettingString(NULL, m_szModuleName, "AvatarURL", &dbv)) {
if (lstrcmpiA(pic_url, dbv.pszVal) == 0) {
DBVARIANT dbv2;
/*time_t ts;
@@ -562,7 +562,7 @@ void CYahooProto::ext_got_picture_upload(const char *me, const char *url,unsigne
SetString(NULL, "AvatarURL", url);
//YAHOO_SetDword("AvatarExpires", ts);
- if (!DBGetContactSettingString(NULL, m_szModuleName, "AvatarInv", &dbv) ){
+ if (!DBGetContactSettingString(NULL, m_szModuleName, "AvatarInv", &dbv) ) {
LOG(("[ext_yahoo_got_picture_upload] Buddy: %s told us this is bad??", dbv.pszVal));
LOG(("[ext_yahoo_got_picture] Sending url: %s checksum: %d to '%s'!", url, cksum, dbv.pszVal));
@@ -809,8 +809,8 @@ INT_PTR __cdecl CYahooProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
DBVARIANT dbv;
int ret = -3;
- if (GetDword("AvatarHash", 0)){
- if (!DBGetContactSettingTString(NULL, m_szModuleName, "AvatarFile", &dbv)){
+ if (GetDword("AvatarHash", 0)) {
+ if (!DBGetContactSettingTString(NULL, m_szModuleName, "AvatarFile", &dbv)) {
if (_taccess(dbv.ptszVal, 0) == 0){
lstrcpyn(buffer, dbv.ptszVal, size-1);
buffer[size-1] = '\0';
diff --git a/protocols/Yahoo/file_transfer.cpp b/protocols/Yahoo/file_transfer.cpp
index c18ef4c22b..58958c3c4a 100644
--- a/protocols/Yahoo/file_transfer.cpp
+++ b/protocols/Yahoo/file_transfer.cpp
@@ -162,7 +162,7 @@ static void upload_file(int id, int fd, int error, void *data)
error = 1;
}
- if(!error) {
+ if (!error) {
HANDLE myhFile = CreateFile(sf->pfts.tszCurrentFile,
GENERIC_READ,
FILE_SHARE_READ|FILE_SHARE_WRITE,
@@ -304,7 +304,7 @@ static void dl_file(int id, int fd, int error, const char *filename, unsigned lo
error = 1;
}
- if(!error) {
+ if (!error) {
HANDLE myhFile;
TCHAR filefull[MAX_PATH];
@@ -734,7 +734,7 @@ HANDLE __cdecl CYahooProto::SendFile( HANDLE hContact, const PROTOCHAR* szDescri
/*DebugLog("Getting Files");
- if ( ppszFiles[1] != NULL ){
+ if ( ppszFiles[1] != NULL ) {
MessageBoxA(NULL, "YAHOO protocol allows only one file to be sent at a time", "Yahoo", MB_OK | MB_ICONINFORMATION);
return 0;
}
diff --git a/protocols/Yahoo/im.cpp b/protocols/Yahoo/im.cpp
index 455a545b74..03360e2374 100644
--- a/protocols/Yahoo/im.cpp
+++ b/protocols/Yahoo/im.cpp
@@ -50,7 +50,7 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons
return;
}
- if(!msg) {
+ if (!msg) {
LOG(("Empty Incoming Message, exiting."));
return;
}
@@ -80,15 +80,15 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons
// strip the fade tag
!_strnicmp(c, "<FADE ",6) || !_strnicmp(c,"</FADE>",7) ||
// strip the alternate colors tag
- !_strnicmp(c, "<ALT ",5) || !_strnicmp(c, "</ALT>",6)){
+ !_strnicmp(c, "<ALT ",5) || !_strnicmp(c, "</ALT>",6)) {
while ((*c++ != '>') && (*c != '\0'));
} else
// strip ANSI color combination
- if ((*c == 0x1b) && (*(c+1) == '[')){
+ if ((*c == 0x1b) && (*(c+1) == '[')) {
while ((*c++ != 'm') && (*c != '\0'));
} else
- if (*c != '\0'){
+ if (*c != '\0') {
umsg[oidx++] = *c;
/* Adding \r to \r\n conversion */
@@ -104,7 +104,7 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons
/* Need to strip off formatting stuff first. Then do all decoding/converting */
LOG(("%s: %s", who, umsg));
- //if(!strcmp(umsg, "<ding>"))
+ //if (!strcmp(umsg, "<ding>"))
// :P("\a");
ccs.szProtoService = PSR_MESSAGE;
@@ -236,7 +236,7 @@ int __cdecl CYahooProto::RecvMsg( HANDLE hContact, PROTORECVEVENT* pre )
DBDeleteContactSetting(hContact, "CList", "Hidden");
// NUDGES
- if( !lstrcmpA(pre->szMessage, "<ding>") && ServiceExists("NUDGE/Send")){
+ if ( !lstrcmpA(pre->szMessage, "<ding>") && ServiceExists("NUDGE/Send")) {
DebugLog("[YahooRecvMessage] Doing Nudge Service!");
NotifyEventHooks(hYahooNudge, (WPARAM)hContact, pre->timestamp);
return 0;
diff --git a/protocols/Yahoo/libyahoo2/libyahoo2.c b/protocols/Yahoo/libyahoo2/libyahoo2.c
index e118a76d18..287e4a3b9f 100644
--- a/protocols/Yahoo/libyahoo2/libyahoo2.c
+++ b/protocols/Yahoo/libyahoo2/libyahoo2.c
@@ -471,45 +471,45 @@ static struct yahoo_server_settings * _yahoo_assign_server_settings(va_list ap)
if(key == NULL)
break;
- if(!strcmp(key, "pager_host")) {
+ if (!strcmp(key, "pager_host")) {
svalue = va_arg(ap, char *);
free(yss->pager_host);
yss->pager_host = strdup(svalue);
- } else if(!strcmp(key, "pager_port")) {
+ } else if (!strcmp(key, "pager_port")) {
nvalue = va_arg(ap, int);
yss->pager_port = nvalue;
- } else if(!strcmp(key, "filetransfer_host")) {
+ } else if (!strcmp(key, "filetransfer_host")) {
svalue = va_arg(ap, char *);
free(yss->filetransfer_host);
yss->filetransfer_host = strdup(svalue);
- } else if(!strcmp(key, "filetransfer_port")) {
+ } else if (!strcmp(key, "filetransfer_port")) {
nvalue = va_arg(ap, int);
yss->filetransfer_port = nvalue;
- } else if(!strcmp(key, "webcam_host")) {
+ } else if (!strcmp(key, "webcam_host")) {
svalue = va_arg(ap, char *);
free(yss->webcam_host);
yss->webcam_host = strdup(svalue);
- } else if(!strcmp(key, "webcam_port")) {
+ } else if (!strcmp(key, "webcam_port")) {
nvalue = va_arg(ap, int);
yss->webcam_port = nvalue;
- } else if(!strcmp(key, "webcam_description")) {
+ } else if (!strcmp(key, "webcam_description")) {
svalue = va_arg(ap, char *);
free(yss->webcam_description);
yss->webcam_description = strdup(svalue);
- } else if(!strcmp(key, "local_host")) {
+ } else if (!strcmp(key, "local_host")) {
svalue = va_arg(ap, char *);
free(yss->local_host);
yss->local_host = strdup(svalue);
- } else if(!strcmp(key, "conn_type")) {
+ } else if (!strcmp(key, "conn_type")) {
nvalue = va_arg(ap, int);
yss->conn_type = nvalue;
- } else if(!strcmp(key, "picture_checksum")) {
+ } else if (!strcmp(key, "picture_checksum")) {
nvalue = va_arg(ap, int);
yss->pic_cksum = nvalue;
- } else if(!strcmp(key, "web_messenger")) {
+ } else if (!strcmp(key, "web_messenger")) {
nvalue = va_arg(ap, int);
yss->web_messenger = nvalue;
- } else if(!strcmp(key, "login_host")) {
+ } else if (!strcmp(key, "login_host")) {
svalue = va_arg(ap, char *);
free(yss->login_host);
yss->login_host = strdup(svalue);
@@ -525,7 +525,7 @@ static struct yahoo_server_settings * _yahoo_assign_server_settings(va_list ap)
static void yahoo_free_server_settings(struct yahoo_server_settings *yss)
{
- if(!yss)
+ if (!yss)
return;
free(yss->pager_host);
@@ -642,7 +642,7 @@ static void yahoo_free_buddies(YList * list)
for(l = list; l; l = l->next)
{
struct yahoo_buddy *bud = (struct yahoo_buddy *) l->data;
- if(!bud)
+ if (!bud)
continue;
FREE(bud->group);
@@ -973,7 +973,7 @@ static void yahoo_add_to_send_queue(struct yahoo_input_data *yid, void *data, in
yid->txqueues = y_list_append(yid->txqueues, tx);
- if(!yid->write_tag)
+ if (!yid->write_tag)
yid->write_tag=YAHOO_CALLBACK(ext_yahoo_add_handler)(yid->yd->client_id, yid->fd, YAHOO_INPUT_WRITE, yid);
}
@@ -1004,7 +1004,7 @@ static void yahoo_send_packet(struct yahoo_input_data *yid, struct yahoo_packet
yahoo_packet_read(pkt, data + pos, len - pos);
- if( yid->type == YAHOO_CONNECTION_FT ||
+ if ( yid->type == YAHOO_CONNECTION_FT ||
( yid->type == YAHOO_CONNECTION_PAGER &&
( pkt->service == YAHOO_SERVICE_KEEPALIVE ||
pkt->service == YAHOO_SERVICE_PING ||
@@ -1060,7 +1060,7 @@ static int yahoo_send_data(int fd, const char *data, int len)
void yahoo_close(int id)
{
struct yahoo_data *yd = find_conn_by_id(id);
- if(!yd)
+ if (!yd)
return;
del_from_list(yd);
@@ -1620,16 +1620,16 @@ static void yahoo_process_conference(struct yahoo_input_data *yid, struct yahoo_
utf8 = atoi(pair->value);
}
- if(!room)
+ if (!room)
return;
if(host) {
for(l = members; l; l = l->next) {
char * w = (char *) l->data;
- if(!strcmp(w, host))
+ if (!strcmp(w, host))
break;
}
- if(!l)
+ if (!l)
members = y_list_append(members, strdup(host));
}
/* invite, decline, join, left, message -> status == 1 */
@@ -1765,7 +1765,7 @@ static void yahoo_process_chat(struct yahoo_input_data *yid, struct yahoo_packet
}
}
- if(!room) {
+ if (!room) {
if (pkt->service == YAHOO_SERVICE_CHATLOGOUT) { /* yahoo originated chat logout */
YAHOO_CALLBACK(ext_yahoo_chat_yahoologout)(yid->yd->client_id, id);
return ;
@@ -1845,7 +1845,7 @@ static void yahoo_process_message(struct yahoo_input_data *yid, struct yahoo_pac
switch (pair->key) {
/*case 1: */
case 4:
- if(!message->from)
+ if (!message->from)
message->from = pair->value;
break;
@@ -2979,9 +2979,9 @@ static void yahoo_process_buddyadd(struct yahoo_input_data *yid, struct yahoo_pa
//yahoo_dump_unhandled(pkt);
- if(!who)
+ if (!who)
return;
- if(!where)
+ if (!where)
where = "Unknown";
bud = y_new0(struct yahoo_buddy, 1);
@@ -3037,7 +3037,7 @@ static void yahoo_process_buddydel(struct yahoo_input_data *yid, struct yahoo_pa
}
}
- if(!who || !where)
+ if (!who || !where)
return;
bud = y_new0(struct yahoo_buddy, 1);
@@ -3266,7 +3266,7 @@ void yahoo_send_picture_info(int id, const char *who, int type, const char *pic_
struct yahoo_packet *pkt = NULL;
struct yahoo_server_settings *yss;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -3299,7 +3299,7 @@ void yahoo_send_picture_update(int id, const char *who, int type)
struct yahoo_packet *pkt = NULL;
struct yahoo_server_settings *yss;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -3326,7 +3326,7 @@ void yahoo_send_picture_checksum(int id, const char *who, int cksum)
struct yahoo_packet *pkt = NULL;
struct yahoo_server_settings *yss;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -3359,7 +3359,7 @@ void yahoo_send_picture_status(int id, int buddy_icon)
struct yahoo_packet *pkt = NULL;
struct yahoo_server_settings *yss;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -3693,7 +3693,7 @@ static void yahoo_process_webcam_key(struct yahoo_input_data *yid, struct yahoo_
}
l = webcam_queue;
- if(!l)
+ if (!l)
return;
who = (char *) l->data;
@@ -3871,7 +3871,7 @@ static struct yahoo_packet * yahoo_getdata(struct yahoo_input_data * yid)
int pos = 0;
int pktlen;
- if(!yd)
+ if (!yd)
return NULL;
DEBUG_MSG(("rxlen is %d", yid->rxlen));
@@ -4009,7 +4009,7 @@ static struct yab * yahoo_getyab(struct yahoo_input_data *yid)
int pos = 0, end=0;
struct yahoo_data *yd = yid->yd;
- if(!yd)
+ if (!yd)
return NULL;
//DEBUG_MSG(("rxlen is %d", yid->rxlen));
@@ -4061,7 +4061,7 @@ static char * yahoo_getwebcam_master(struct yahoo_input_data *yid)
char *server=NULL;
struct yahoo_data *yd = yid->yd;
- if(!yid || !yd)
+ if (!yid || !yd)
return NULL;
DEBUG_MSG(("rxlen is %d", yid->rxlen));
@@ -4114,10 +4114,10 @@ static int yahoo_get_webcam_data(struct yahoo_input_data *yid)
int connect=0;
struct yahoo_data *yd = yid->yd;
- if(!yd)
+ if (!yd)
return -1;
- if(!yid->wcm || !yid->wcd || !yid->rxlen)
+ if (!yid->wcm || !yid->wcd || !yid->rxlen)
return -1;
DEBUG_MSG(("rxlen is %d", yid->rxlen));
@@ -4272,7 +4272,7 @@ int yahoo_write_ready(int id, int fd, void *data)
struct data_queue *tx;
LOG(("write callback: id=%d fd=%d data=%p", id, fd, data));
- if(!yid || !yid->txqueues)
+ if (!yid || !yid->txqueues)
return -2;
tx = (struct data_queue *) yid->txqueues->data;
@@ -4313,7 +4313,7 @@ int yahoo_write_ready(int id, int fd, void *data)
free(tx);
yid->txqueues = y_list_remove_link(yid->txqueues, yid->txqueues);
y_list_free_1(l);
- if(!yid->txqueues) {
+ if (!yid->txqueues) {
//LOG(("yahoo_write_ready(%d, %d) !txqueues", id, fd));
YAHOO_CALLBACK(ext_yahoo_remove_handler)(id, yid->write_tag);
yid->write_tag = 0;
@@ -4372,7 +4372,7 @@ static void yahoo_process_yab_connection(struct yahoo_input_data *yid, int over)
while(find_input_by_id_and_type(id, YAHOO_CONNECTION_YAB)
&& (yab = yahoo_getyab(yid)) != NULL) {
- if(!yab->id)
+ if (!yab->id)
continue;
//changed=1;
@@ -4380,7 +4380,7 @@ static void yahoo_process_yab_connection(struct yahoo_input_data *yid, int over)
for(buds = yd->buddies; buds; buds=buds->next) {
struct yahoo_buddy * bud = (struct yahoo_buddy *) buds->data;
- if(!strcmp(bud->id, yab->id)) {
+ if (!strcmp(bud->id, yab->id)) {
yab_used = TRUE;
bud->yab_entry = yab;
if(yab->nname) {
@@ -4432,7 +4432,7 @@ static void yahoo_process_search_connection(struct yahoo_input_data *yid, int ov
pyid = find_input_by_id_and_type(yid->yd->client_id, YAHOO_CONNECTION_PAGER);
- if(!over || !pyid) {
+ if (!over || !pyid) {
LOG(("yahoo_process_search_connection] ?? Not Done yet? Waiting for more packets!"));
return;
}
@@ -4458,7 +4458,7 @@ static void yahoo_process_search_connection(struct yahoo_input_data *yid, int ov
cp = p;
np = strchr(p, 4);
- if(!np)
+ if (!np)
break;
*np = 0;
p = np+1;
@@ -4685,7 +4685,7 @@ int yahoo_read_ready(int id, int fd, void *data)
int len;
//LOG(("read callback: id=%d fd=%d data=%p", id, fd, data));
- if(!yid)
+ if (!yid)
return -2;
@@ -4746,7 +4746,7 @@ int yahoo_init_with_attributes(const char *username, const char *password, const
yd = y_new0(struct yahoo_data, 1);
- if(!yd)
+ if (!yd)
return 0;
yd->user = strdup(username);
@@ -4853,7 +4853,7 @@ void yahoo_login(int id, enum yahoo_status initial)
LOG(("[yahoo_login] id: %d, initial status: %d", id, initial));
- if(!yd)
+ if (!yd)
return;
yss = yd->server_settings;
@@ -4871,7 +4871,7 @@ void yahoo_login(int id, enum yahoo_status initial)
int yahoo_get_fd(int id)
{
struct yahoo_input_data *yid = find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
- if(!yid)
+ if (!yid)
return 0;
else
return yid->fd;
@@ -4884,7 +4884,7 @@ void yahoo_send_im(int id, const char *from, const char *who, int protocol, cons
struct yahoo_data *yd;
struct yahoo_server_settings *yss;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -4941,7 +4941,7 @@ void yahoo_send_typing(int id, const char *from, const char *who, int protocol,
struct yahoo_packet *pkt = NULL;
struct yahoo_server_settings *yss;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -4980,7 +4980,7 @@ void yahoo_set_away(int id, enum yahoo_status state, const char *msg, int away)
//int service;
enum yahoo_status cs;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5059,7 +5059,7 @@ void yahoo_set_stealth(int id, const char *buddy, int protocol, int add)
//int service;
//char s[4];
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5090,7 +5090,7 @@ void yahoo_logoff(int id)
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5127,7 +5127,7 @@ void yahoo_get_list(int id)
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5159,7 +5159,7 @@ void yahoo_get_yab(int id)
char url[1024];
char buff[1024];
- if(!yd)
+ if (!yd)
return;
yid = y_new0(struct yahoo_input_data, 1);
@@ -5188,7 +5188,7 @@ void yahoo_set_yab(int id, struct yab * yab)
char *temp;
int size = sizeof(url)-1;
- if(!yd)
+ if (!yd)
return;
yid = y_new0(struct yahoo_input_data, 1);
@@ -5271,7 +5271,7 @@ void yahoo_set_identity_status(int id, const char * identity, int active)
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5290,7 +5290,7 @@ void yahoo_refresh(int id)
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5306,7 +5306,7 @@ void yahoo_send_ping(int id)
struct yahoo_input_data *yid = find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
struct yahoo_data *yd;
struct yahoo_packet *pkt=NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5320,7 +5320,7 @@ void yahoo_keepalive(int id)
struct yahoo_input_data *yid = find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
struct yahoo_data *yd;
struct yahoo_packet *pkt=NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5352,7 +5352,7 @@ void yahoo_add_buddy(int id, const char *fname, const char *lname, const char *w
struct yahoo_data *yd;
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5410,7 +5410,7 @@ void yahoo_remove_buddy(int id, const char *who, int protocol, const char *group
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5434,7 +5434,7 @@ void yahoo_accept_buddy(int id, const char *who, int protocol)
struct yahoo_data *yd;
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5461,7 +5461,7 @@ void yahoo_reject_buddy(int id, const char *who, int protocol, const char *msg)
struct yahoo_data *yd;
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5489,7 +5489,7 @@ void yahoo_ignore_buddy(int id, const char *who, int unignore)
struct yahoo_data *yd;
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5510,7 +5510,7 @@ void yahoo_change_buddy_group(int id, const char *who, const char *old_group, co
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5549,7 +5549,7 @@ void yahoo_group_rename(int id, const char *old_group, const char *new_group)
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5568,7 +5568,7 @@ void yahoo_conference_addinvite(int id, const char * from, const char *who, cons
struct yahoo_data *yd;
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5579,7 +5579,7 @@ void yahoo_conference_addinvite(int id, const char * from, const char *who, cons
yahoo_packet_hash(pkt, 57, room);
yahoo_packet_hash(pkt, 58, msg);
yahoo_packet_hash(pkt, 13, "0");
- for(; members; members = members->next) {
+ for (; members; members = members->next) {
yahoo_packet_hash(pkt, 52, (char *)members->data);
yahoo_packet_hash(pkt, 53, (char *)members->data);
}
@@ -5596,7 +5596,7 @@ void yahoo_conference_invite(int id, const char * from, YList *who, const char *
struct yahoo_data *yd;
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5604,7 +5604,7 @@ void yahoo_conference_invite(int id, const char * from, YList *who, const char *
yahoo_packet_hash(pkt, 1, (from?from:yd->user));
yahoo_packet_hash(pkt, 50, yd->user);
- for(; who; who = who->next) {
+ for (; who; who = who->next) {
yahoo_packet_hash(pkt, 52, (char *)who->data);
}
yahoo_packet_hash(pkt, 57, room);
@@ -5622,7 +5622,7 @@ void yahoo_conference_logon(int id, const char *from, YList *who, const char *ro
struct yahoo_data *yd;
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5633,7 +5633,7 @@ void yahoo_conference_logon(int id, const char *from, YList *who, const char *ro
yahoo_packet_hash(pkt, 57, room);
- for(; who; who = who->next) {
+ for (; who; who = who->next) {
yahoo_packet_hash(pkt, 3, (char *)who->data);
}
@@ -5648,14 +5648,14 @@ void yahoo_conference_decline(int id, const char * from, YList *who, const char
struct yahoo_data *yd;
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
pkt = yahoo_packet_new(YAHOO_SERVICE_CONFDECLINE, YPACKET_STATUS_DEFAULT, yd->session_id);
yahoo_packet_hash(pkt, 1, (from?from:yd->user));
- for(; who; who = who->next) {
+ for (; who; who = who->next) {
yahoo_packet_hash(pkt, 3, (char *)who->data);
}
yahoo_packet_hash(pkt, 57, room);
@@ -5672,14 +5672,14 @@ void yahoo_conference_logoff(int id, const char * from, YList *who, const char *
struct yahoo_data *yd;
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
pkt = yahoo_packet_new(YAHOO_SERVICE_CONFLOGOFF, YPACKET_STATUS_DEFAULT, yd->session_id);
yahoo_packet_hash(pkt, 1, (from?from:yd->user));
- for(; who; who = who->next) {
+ for (; who; who = who->next) {
yahoo_packet_hash(pkt, 3, (char *)who->data);
}
yahoo_packet_hash(pkt, 57, room);
@@ -5695,14 +5695,14 @@ void yahoo_conference_message(int id, const char * from, YList *who, const char
struct yahoo_data *yd;
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
pkt = yahoo_packet_new(YAHOO_SERVICE_CONFMSG, YPACKET_STATUS_DEFAULT, yd->session_id);
yahoo_packet_hash(pkt, 1, (from?from:yd->user));
- for(; who; who = who->next) {
+ for (; who; who = who->next) {
yahoo_packet_hash(pkt, 53, (char *)who->data);
}
yahoo_packet_hash(pkt, 57, room);
@@ -5723,7 +5723,7 @@ void yahoo_get_chatrooms(int id, int chatroomid)
char url[1024];
char buff[1024];
- if(!yd)
+ if (!yd)
return;
yid = y_new0(struct yahoo_input_data, 1);
@@ -5752,7 +5752,7 @@ void yahoo_chat_logon(int id, const char *from, const char *room, const char *ro
struct yahoo_data *yd;
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5786,7 +5786,7 @@ void yahoo_chat_message(int id, const char *from, const char *room, const char
struct yahoo_data *yd;
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5814,7 +5814,7 @@ void yahoo_chat_logoff(int id, const char *from)
struct yahoo_data *yd;
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -5842,7 +5842,7 @@ void yahoo_webcam_get_feed(int id, const char *who)
struct yahoo_data *yd;
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
/*
@@ -5928,7 +5928,7 @@ void yahoo_webcam_invite(int id, const char *who)
struct yahoo_input_data *yid = find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
struct yahoo_packet *pkt;
- if(!yid)
+ if (!yid)
return;
pkt = yahoo_packet_new(YAHOO_SERVICE_NOTIFY, YPACKET_STATUS_NOTIFY, yid->yd->session_id);
@@ -5951,7 +5951,7 @@ static void yahoo_search_internal(int id, int t, const char *text, int g, int ar
char buff[1024];
char *ctext, *p;
- if(!yd)
+ if (!yd)
return;
yid = y_new0(struct yahoo_input_data, 1);
@@ -5991,10 +5991,10 @@ void yahoo_search(int id, enum yahoo_search_type t, const char *text, enum yahoo
struct yahoo_input_data *yid = find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
struct yahoo_search_state *yss;
- if(!yid)
+ if (!yid)
return;
- if(!yid->ys)
+ if (!yid->ys)
yid->ys = y_new0(struct yahoo_search_state, 1);
yss = yid->ys;
@@ -6015,7 +6015,7 @@ void yahoo_search_again(int id, int start)
struct yahoo_input_data *yid = find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
struct yahoo_search_state *yss;
- if(!yid || !yid->ys)
+ if (!yid || !yid->ys)
return;
yss = yid->ys;
@@ -6070,7 +6070,7 @@ static void _yahoo_send_file_connected(int id, int fd, int error, void *data)
inputs = y_list_remove(inputs, yid);
/*
while(yahoo_tcp_readline(buff, sizeof(buff), nyd->fd) > 0) {
- if(!strcmp(buff, ""))
+ if (!strcmp(buff, ""))
break;
}
@@ -6093,7 +6093,7 @@ void yahoo_send_file(int id, const char *who, const char *msg,
struct send_file_data *sfd;
const char *s;
- if(!yd)
+ if (!yd)
return;
yss = yd->server_settings;
@@ -6147,7 +6147,7 @@ void yahoo_send_file_y7(int id, const char *from, const char *to, const char *re
char url[255];
char *s;
- if(!yd)
+ if (!yd)
return;
yss = yd->server_settings;
@@ -6183,7 +6183,7 @@ void yahoo_send_avatar(int id, const char *name, unsigned long size,
struct send_file_data *sfd;
const char *s;
- if(!yd)
+ if (!yd)
return;
yss = yd->server_settings;
@@ -6237,7 +6237,7 @@ enum yahoo_status yahoo_current_status(int id)
{
struct yahoo_data *yd = find_conn_by_id(id);
- if(!yd)
+ if (!yd)
return YAHOO_STATUS_OFFLINE;
return yd->current_status;
@@ -6246,7 +6246,7 @@ enum yahoo_status yahoo_current_status(int id)
const YList * yahoo_get_buddylist(int id)
{
struct yahoo_data *yd = find_conn_by_id(id);
- if(!yd)
+ if (!yd)
return NULL;
return yd->buddies;
}
@@ -6254,7 +6254,7 @@ const YList * yahoo_get_buddylist(int id)
const YList * yahoo_get_ignorelist(int id)
{
struct yahoo_data *yd = find_conn_by_id(id);
- if(!yd)
+ if (!yd)
return NULL;
return yd->ignore;
}
@@ -6262,7 +6262,7 @@ const YList * yahoo_get_ignorelist(int id)
const YList * yahoo_get_identities(int id)
{
struct yahoo_data *yd = find_conn_by_id(id);
- if(!yd)
+ if (!yd)
return NULL;
return yd->identities;
}
@@ -6270,17 +6270,17 @@ const YList * yahoo_get_identities(int id)
const char * yahoo_get_cookie(int id, const char *which)
{
struct yahoo_data *yd = find_conn_by_id(id);
- if(!yd)
+ if (!yd)
return NULL;
- if(!strncasecmp(which, "y", 1))
+ if (!strncasecmp(which, "y", 1))
return yd->cookie_y;
- if(!strncasecmp(which, "t", 1))
+ if (!strncasecmp(which, "t", 1))
return yd->cookie_t;
- if(!strncasecmp(which, "c", 1))
+ if (!strncasecmp(which, "c", 1))
return yd->cookie_c;
- if(!strncasecmp(which, "login", 5))
+ if (!strncasecmp(which, "login", 5))
return yd->login_cookie;
- if(!strncasecmp(which, "b", 1))
+ if (!strncasecmp(which, "b", 1))
return yd->cookie_b;
return NULL;
}
@@ -6288,7 +6288,7 @@ const char * yahoo_get_cookie(int id, const char *which)
const char * yahoo_get_pw_token(int id)
{
struct yahoo_data *yd = find_conn_by_id(id);
- if(!yd)
+ if (!yd)
return NULL;
return yd->pw_token;
@@ -6298,7 +6298,7 @@ void yahoo_get_url_handle(int id, const char *url,
yahoo_get_url_handle_callback callback, void *data)
{
struct yahoo_data *yd = find_conn_by_id(id);
- if(!yd)
+ if (!yd)
return;
yahoo_get_url_fd(id, url, yd, callback, data);
@@ -6316,7 +6316,7 @@ void yahoo_request_buddy_avatar(int id, const char *buddy)
struct yahoo_packet *pkt = NULL;
struct yahoo_server_settings *yss;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -6342,7 +6342,7 @@ void yahoo_ftdc_deny(int id, const char *buddy, const char *filename, const char
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -6366,7 +6366,7 @@ void yahoo_ft7dc_accept(int id, const char *buddy, const char *ft_token)
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -6388,7 +6388,7 @@ void yahoo_ft7dc_deny(int id, const char *buddy, const char *ft_token)
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -6410,7 +6410,7 @@ void yahoo_ft7dc_abort(int id, const char *buddy, const char *ft_token)
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -6432,7 +6432,7 @@ void yahoo_ft7dc_relay(int id, const char *buddy, const char *ft_token)
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -6454,7 +6454,7 @@ void yahoo_ft7dc_nextfile(int id, const char *buddy, const char *ft_token)
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -6480,7 +6480,7 @@ char *yahoo_ft7dc_send(int id, const char *buddy, YList *files)
md5_byte_t result[16];
md5_state_t ctx;
- if(!yid)
+ if (!yid)
return NULL;
md5_init(&ctx);
@@ -6541,7 +6541,7 @@ void yahoo_send_file7info(int id, const char *me, const char *who, const char *f
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid)
+ if (!yid)
return;
yd = yid->yd;
@@ -6569,7 +6569,7 @@ unsigned char *yahoo_webmessenger_idle_packet(int id, int *len)
int pos = 0;
int web_messenger = 1;
- if(!yid) {
+ if (!yid) {
DEBUG_MSG(("NO Yahoo Input Data???"));
return NULL;
}
@@ -6612,7 +6612,7 @@ void yahoo_send_idle_packet(int id)
struct yahoo_data *yd;
struct yahoo_packet *pkt = NULL;
- if(!yid) {
+ if (!yid) {
DEBUG_MSG(("NO Yahoo Input Data???"));
return;
}
@@ -6638,7 +6638,7 @@ void yahoo_send_im_ack(int id, const char *me, const char *buddy, const char *se
DEBUG_MSG(("[yahoo_send_im_ack] My Id: %s, Buddy: %s, Seq #: %s, Retry: %d", me, buddy, seqn, sendn));
- if(!yid) {
+ if (!yid) {
DEBUG_MSG(("NO Yahoo Input Data???"));
return;
}
diff --git a/protocols/Yahoo/libyahoo2/yahoo_httplib.c b/protocols/Yahoo/libyahoo2/yahoo_httplib.c
index 39b33fa2e1..c7bcb55858 100644
--- a/protocols/Yahoo/libyahoo2/yahoo_httplib.c
+++ b/protocols/Yahoo/libyahoo2/yahoo_httplib.c
@@ -126,14 +126,14 @@ int url_to_host_port_path(const char *url, char *host, int *port, char *path)
slash = strchr(urlcopy, '/');
colon = strchr(urlcopy, ':');
- if(!colon || (slash && slash < colon)) {
+ if (!colon || (slash && slash < colon)) {
*port = 80;
} else {
*colon = 0;
*port = atoi(colon+1);
}
- if(!slash) {
+ if (!slash) {
strcpy(path, "/");
} else {
strcpy(path, slash);
@@ -158,13 +158,13 @@ char *yahoo_urlencode(const char *instr)
char *str = NULL;
int len = strlen(instr);
- if(!(str = y_new(char, 3*len + 1) ))
+ if (!(str = y_new(char, 3*len + 1) ))
return "";
while(instr[ipos]) {
while(isurlchar(instr[ipos]))
str[bpos++] = instr[ipos++];
- if(!instr[ipos])
+ if (!instr[ipos])
break;
snprintf(&str[bpos], 4, "%%%.2x", instr[ipos]);
@@ -188,7 +188,7 @@ char *yahoo_urldecode(const char *instr)
unsigned dec;
int len = strlen(instr);
- if(!(str = y_new(char, len+1) ))
+ if (!(str = y_new(char, len+1) ))
return "";
while(instr[ipos]) {
@@ -198,7 +198,7 @@ char *yahoo_urldecode(const char *instr)
ipos++;
} else
str[bpos++] = instr[ipos++];
- if(!instr[ipos])
+ if (!instr[ipos])
break;
if(instr[ipos+1] && instr[ipos+2]) {
@@ -235,7 +235,7 @@ char *yahoo_xmldecode(const char *instr)
unsigned dec;
int len = strlen(instr);
- if(!(str = y_new(char, len+1) ))
+ if (!(str = y_new(char, len+1) ))
return "";
while(instr[ipos]) {
@@ -245,7 +245,7 @@ char *yahoo_xmldecode(const char *instr)
ipos++;
} else
str[bpos++] = instr[ipos++];
- if(!instr[ipos] || !instr[ipos+1])
+ if (!instr[ipos] || !instr[ipos+1])
break;
ipos++;
@@ -260,7 +260,7 @@ char *yahoo_xmldecode(const char *instr)
} else {
int i;
for (i=0; i<5; i++)
- if(!strncmp(instr+ipos, entitymap[i][0],
+ if (!strncmp(instr+ipos, entitymap[i][0],
strlen(entitymap[i][0]))) {
str[bpos++] = entitymap[i][1][0];
ipos += strlen(entitymap[i][0]);
@@ -319,7 +319,7 @@ void yahoo_http_post(int id, const char *url, const char *cookies, long content_
char ck[2048];
char buff[4096];
- if(!url_to_host_port_path(url, host, &port, path))
+ if (!url_to_host_port_path(url, host, &port, path))
return;
if (cookies == NULL || cookies[0] == '\0')
@@ -351,7 +351,7 @@ void yahoo_http_get(int id, const char *url, const char *cookies,
char ck[2048];
char buff[4096];
- if(!url_to_host_port_path(url, host, &port, path))
+ if (!url_to_host_port_path(url, host, &port, path))
return;
if (cookies == NULL || cookies[0] == '\0')
@@ -394,17 +394,17 @@ static void yahoo_got_url_fd(int id, int fd, int error, void *data)
while((n=yahoo_tcp_readline(buff, sizeof(buff), fd)) > 0) {
LOG(("Read:%s:\n", buff));
- if(!strcmp(buff, ""))
+ if (!strcmp(buff, ""))
break;
- if( !strncasecmp(buff, "Content-length:",
+ if ( !strncasecmp(buff, "Content-length:",
strlen("Content-length:")) ) {
tmp = strrchr(buff, ' ');
if(tmp)
filesize = atol(tmp);
}
- if( !strncasecmp(buff, "Content-disposition:",
+ if ( !strncasecmp(buff, "Content-disposition:",
strlen("Content-disposition:")) ) {
tmp = strstr(buff, "name=");
if(tmp) {
@@ -418,9 +418,9 @@ static void yahoo_got_url_fd(int id, int fd, int error, void *data)
} else {
char *tmp2;
tmp2 = strchr(tmp, ';');
- if(!tmp2)
+ if (!tmp2)
tmp2 = strchr(tmp, '\r');
- if(!tmp2)
+ if (!tmp2)
tmp2 = strchr(tmp, '\n');
if(tmp2)
*tmp2 = '\0';
diff --git a/protocols/Yahoo/libyahoo2/yahoo_list.c b/protocols/Yahoo/libyahoo2/yahoo_list.c
index ae7e86b9c6..b3e40c208e 100644
--- a/protocols/Yahoo/libyahoo2/yahoo_list.c
+++ b/protocols/Yahoo/libyahoo2/yahoo_list.c
@@ -66,10 +66,10 @@ YList *y_list_concat(YList * list, YList * add)
{
YList *l;
- if(!list)
+ if (!list)
return add;
- if(!add)
+ if (!add)
return list;
for (l = list; l->next; l = l->next)
@@ -132,7 +132,7 @@ int y_list_length(const YList * list)
*/
int y_list_empty(const YList * list)
{
- if(!list)
+ if (!list)
return 1;
else
return 0;
@@ -140,7 +140,7 @@ int y_list_empty(const YList * list)
int y_list_singleton(const YList * list)
{
- if(!list || list->next)
+ if (!list || list->next)
return 0;
return 1;
}
diff --git a/protocols/Yahoo/options.cpp b/protocols/Yahoo/options.cpp
index 764fe0c56e..01fa96330a 100644
--- a/protocols/Yahoo/options.cpp
+++ b/protocols/Yahoo/options.cpp
@@ -171,7 +171,7 @@ static INT_PTR CALLBACK DlgProcYahooOptsConn(HWND hwndDlg, UINT msg, WPARAM wPar
ppro = ( CYahooProto* )lParam;
SetWindowLongPtr( hwndDlg, GWLP_USERDATA, lParam );
- if ( !ppro->GetString( YAHOO_LOGINSERVER, &dbv )){
+ if ( !ppro->GetString( YAHOO_LOGINSERVER, &dbv )) {
SetDlgItemTextA( hwndDlg, IDC_LOGINSERVER, dbv.pszVal );
DBFreeVariant( &dbv );
}
diff --git a/protocols/Yahoo/proto.cpp b/protocols/Yahoo/proto.cpp
index 2aad750efa..e5de41ae29 100644
--- a/protocols/Yahoo/proto.cpp
+++ b/protocols/Yahoo/proto.cpp
@@ -241,7 +241,7 @@ int CYahooProto::Authorize( HANDLE hdbe )
/* Need to remove the buddy from our Miranda Lists */
DBVARIANT dbv;
- if (hContact != NULL && !DBGetContactSettingString( hContact, m_szModuleName, YAHOO_LOGINID, &dbv )){
+ if (hContact != NULL && !DBGetContactSettingString( hContact, m_szModuleName, YAHOO_LOGINID, &dbv )) {
DebugLog("Accepting buddy:%s", dbv.pszVal);
accept(dbv.pszVal, GetWord(hContact, "yprotoid", 0));
DBFreeVariant(&dbv);
@@ -263,23 +263,23 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason )
memset( &dbei, 0, sizeof( dbei ));
dbei.cbSize = sizeof( dbei );
- if (( dbei.cbBlob = YAHOO_CallService( MS_DB_EVENT_GETBLOBSIZE, ( WPARAM )hdbe, 0 )) == -1 ){
+ if (( dbei.cbBlob = YAHOO_CallService( MS_DB_EVENT_GETBLOBSIZE, ( WPARAM )hdbe, 0 )) == -1 ) {
DebugLog("[YahooAuthDeny] ERROR: Can't get blob size");
return 1;
}
dbei.pBlob = ( PBYTE )alloca( dbei.cbBlob );
- if ( YAHOO_CallService( MS_DB_EVENT_GET, ( WPARAM )hdbe, ( LPARAM )&dbei )){
+ if ( YAHOO_CallService( MS_DB_EVENT_GET, ( WPARAM )hdbe, ( LPARAM )&dbei )) {
DebugLog("YahooAuthDeny - Can't get db event!");
return 1;
}
- if ( dbei.eventType != EVENTTYPE_AUTHREQUEST ){
+ if ( dbei.eventType != EVENTTYPE_AUTHREQUEST ) {
DebugLog("YahooAuthDeny - not Authorization event");
return 1;
}
- if ( strcmp( dbei.szModule, m_szModuleName )){
+ if ( strcmp( dbei.szModule, m_szModuleName )) {
DebugLog("YahooAuthDeny - wrong module?");
return 1;
}
@@ -289,7 +289,7 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason )
/* Need to remove the buddy from our Miranda Lists */
DBVARIANT dbv;
- if (hContact != NULL && !DBGetContactSettingString( hContact, m_szModuleName, YAHOO_LOGINID, &dbv )){
+ if (hContact != NULL && !DBGetContactSettingString( hContact, m_szModuleName, YAHOO_LOGINID, &dbv )) {
char *u_reason;
u_reason = mir_utf8encodeT(reason);
@@ -720,7 +720,7 @@ int __cdecl CYahooProto::SetAwayMsg( int status, const PROTOCHAR* msg )
DebugLog("[YahooSetAwayMessage] Status: %s, Msg: %s",(char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, status, 0), (char*) c);
- if(!m_bLoggedIn){
+ if (!m_bLoggedIn){
if (m_iStatus == ID_STATUS_OFFLINE) {
DebugLog("[YahooSetAwayMessage] WARNING: WE ARE OFFLINE!");
mir_free(c);
diff --git a/protocols/Yahoo/services.cpp b/protocols/Yahoo/services.cpp
index 0245ca1d8d..77e99626ed 100644
--- a/protocols/Yahoo/services.cpp
+++ b/protocols/Yahoo/services.cpp
@@ -105,7 +105,7 @@ INT_PTR __cdecl CYahooProto::OnContactDeleted( WPARAM wParam, LPARAM lParam )
return 0;
}
- if ( !DBGetContactSettingString(hContact, m_szModuleName, YAHOO_LOGINID, &dbv )){
+ if ( !DBGetContactSettingString(hContact, m_szModuleName, YAHOO_LOGINID, &dbv )) {
DebugLog("[YahooContactDeleted] Removing %s", dbv.pszVal);
remove_buddy(dbv.pszVal, GetWord(hContact, "yprotoid", 0));
@@ -331,7 +331,7 @@ INT_PTR __cdecl CYahooProto::OnCalendarCommand( WPARAM wParam, LPARAM lParam )
//=======================================================
INT_PTR __cdecl CYahooProto::OnRefreshCommand( WPARAM wParam, LPARAM lParam )
{
- if ( !m_bLoggedIn ){
+ if ( !m_bLoggedIn ) {
ShowNotification(Translate("Yahoo Error"), Translate("You need to be connected to refresh your buddy list"), NIIF_ERROR);
return 0;
}
diff --git a/protocols/Yahoo/util.cpp b/protocols/Yahoo/util.cpp
index 08844f22f8..f259b12d33 100644
--- a/protocols/Yahoo/util.cpp
+++ b/protocols/Yahoo/util.cpp
@@ -314,7 +314,7 @@ INT_PTR __cdecl CYahooProto::OnSettingChanged(WPARAM wParam, LPARAM lParam)
if (cws->value.type == DBVT_DELETED || (cws->value.type == DBVT_BYTE && cws->value.bVal == 0)) {
DBVARIANT dbv;
- if ( !DBGetContactSettingString( (HANDLE) wParam, m_szModuleName, YAHOO_LOGINID, &dbv )){
+ if ( !DBGetContactSettingString( (HANDLE) wParam, m_szModuleName, YAHOO_LOGINID, &dbv )) {
DebugLog("Adding Permanently %s to list.", dbv.pszVal);
AddBuddy(dbv.pszVal,GetWord((HANDLE) wParam, "yprotoid", 0), "miranda", NULL);
DBFreeVariant(&dbv);
@@ -326,7 +326,7 @@ INT_PTR __cdecl CYahooProto::OnSettingChanged(WPARAM wParam, LPARAM lParam)
DebugLog("DB Setting changed. YAHOO user's visible setting changed.");
- if ( !DBGetContactSettingString( (HANDLE) wParam, m_szModuleName, YAHOO_LOGINID, &dbv )){
+ if ( !DBGetContactSettingString( (HANDLE) wParam, m_szModuleName, YAHOO_LOGINID, &dbv )) {
int iAdd = (ID_STATUS_OFFLINE == DBGetContactSettingWord((HANDLE) wParam, m_szModuleName, "ApparentMode", 0));
stealth(dbv.pszVal, iAdd);
DBFreeVariant(&dbv);
diff --git a/protocols/Yahoo/yahoo.cpp b/protocols/Yahoo/yahoo.cpp
index 4383278e0d..f14a311d0a 100644
--- a/protocols/Yahoo/yahoo.cpp
+++ b/protocols/Yahoo/yahoo.cpp
@@ -238,12 +238,12 @@ void CYahooProto::AddBuddy( const char *who, int protocol, const char *group, co
No refresh needed. */
- if ( !DBGetContactSettingString( NULL, m_szModuleName, "First Name", &dbv )){
+ if ( !DBGetContactSettingString( NULL, m_szModuleName, "First Name", &dbv )) {
fname = strdup(dbv.pszVal);
DBFreeVariant(&dbv);
}
- if ( !DBGetContactSettingString( NULL, m_szModuleName, "Last Name", &dbv )){
+ if ( !DBGetContactSettingString( NULL, m_szModuleName, "Last Name", &dbv )) {
lname = strdup(dbv.pszVal);
DBFreeVariant(&dbv);
}
@@ -627,7 +627,7 @@ void CYahooProto::ext_got_buddies(YList * buds)
}
YAHOO_DEBUGLOG(("[ext_got_buddies] Walking buddy list..."));
- for(; buds; buds = buds->next) {
+ for (; buds; buds = buds->next) {
HANDLE hContact;
yahoo_buddy *bud = ( yahoo_buddy* )buds->data;
@@ -979,7 +979,7 @@ void CYahooProto::ext_mail_notify(const char *from, const char *subj, int cnt)
snprintf(z, sizeof(z), Translate("From: %s\nSubject: %s"), from, subj);
}
- if(!ShowPopup( title, z, "http://mail.yahoo.com" ))
+ if (!ShowPopup( title, z, "http://mail.yahoo.com" ))
ShowNotification(title, z, NIIF_INFO);
}
}
@@ -1239,7 +1239,7 @@ void CYahooProto::ext_send_http_request(enum yahoo_connection_type type, const c
LOG(("[ext_send_http_request] type: %d, method: %s, url: %s, cookies: %s, content length: %ld",
type, method, url, cookies, content_length));
- if(!url_to_host_port_path(url, host, &port, path))
+ if (!url_to_host_port_path(url, host, &port, path))
return;
fd = ext_connect(host, port, type);
diff --git a/src/core/miranda.cpp b/src/core/miranda.cpp
index 8ce9c0b0be..3ed03f8a2c 100644
--- a/src/core/miranda.cpp
+++ b/src/core/miranda.cpp
@@ -368,7 +368,7 @@ void* GetCurrentThreadEntryPoint()
if(NtQueryInformationThread == NULL) return 0;
hCurrentProcess = GetCurrentProcess();
- if(!DuplicateHandle(hCurrentProcess, GetCurrentThread(), hCurrentProcess, &hDupHandle, THREAD_QUERY_INFORMATION, FALSE, 0)){
+ if(!DuplicateHandle(hCurrentProcess, GetCurrentThread(), hCurrentProcess, &hDupHandle, THREAD_QUERY_INFORMATION, FALSE, 0)) {
SetLastError(ERROR_ACCESS_DENIED);
return NULL;
}
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp
index 01e6645593..46b622f2a9 100644
--- a/src/modules/database/dbini.cpp
+++ b/src/modules/database/dbini.cpp
@@ -321,9 +321,9 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf
case 'g':
case 'G':
{ char *pstr;
- for(pstr=szValue+1;*pstr;pstr++){
- if(*pstr=='\\'){
- switch(pstr[1]){
+ for(pstr=szValue+1;*pstr;pstr++) {
+ if(*pstr=='\\') {
+ switch(pstr[1]) {
case 'n': *pstr='\n'; break;
case 't': *pstr='\t'; break;
case 'r': *pstr='\r'; break;
diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp
index b0bef4fef4..48dc0163eb 100644
--- a/src/modules/findadd/findadd.cpp
+++ b/src/modules/findadd/findadd.cpp
@@ -801,7 +801,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
dat->bFlexSearchResult=TRUE;
psr=&(csr->psr);
// check if this is column names data (psr->cbSize==0)
- if ( psr->cbSize==0 ){ // blob contain info about columns
+ if ( psr->cbSize==0 ) { // blob contain info about columns
int iColumn;
LVCOLUMN lvc={0};
diff --git a/src/modules/xml/xmlParser.cpp b/src/modules/xml/xmlParser.cpp
index f2afae563f..3d8dfd7b4c 100644
--- a/src/modules/xml/xmlParser.cpp
+++ b/src/modules/xml/xmlParser.cpp
@@ -725,8 +725,8 @@ out_of_loop1:
return r;
}
-ToXMLStringTool::~ToXMLStringTool(){ freeBuffer(); }
-void ToXMLStringTool::freeBuffer(){ if (buf) free(buf); buf=NULL; buflen=0; }
+ToXMLStringTool::~ToXMLStringTool() { freeBuffer(); }
+void ToXMLStringTool::freeBuffer() { if (buf) free(buf); buf=NULL; buflen=0; }
XMLSTR ToXMLStringTool::toXML(XMLCSTR source)
{
if (!source)
@@ -2889,9 +2889,9 @@ const unsigned char base64DecodeTable[] = {
98,98,98,98,98,98,98,98,98,98, 98,98,98,98,98,98 //240 -255
};
-XMLParserBase64Tool::~XMLParserBase64Tool(){ freeBuffer(); }
+XMLParserBase64Tool::~XMLParserBase64Tool() { freeBuffer(); }
-void XMLParserBase64Tool::freeBuffer(){ if (buf) free(buf); buf=NULL; buflen=0; }
+void XMLParserBase64Tool::freeBuffer() { if (buf) free(buf); buf=NULL; buflen=0; }
int XMLParserBase64Tool::encodeLength(int inlen, char formatted)
{
@@ -3033,7 +3033,7 @@ unsigned char *XMLParserBase64Tool::decode(XMLCSTR data, int *outlen, XMLError *
if (outlen) *outlen=len;
if (!len) return NULL;
alloc(len+1);
- if(!decode(data,(unsigned char*)buf,len,xe)){ return NULL; }
+ if(!decode(data,(unsigned char*)buf,len,xe)) { return NULL; }
return (unsigned char*)buf;
}