Skip to content

Commit

Permalink
libcupsfilters: Code clean-up for code of cfFilterPDFToPDF()
Browse files Browse the repository at this point in the history
Cleaned up the first bunch of source code files of libcupsfilters in
the cupsfilters/ directory itself (no sub-directory) following the
coding stype rules in the DEVELOPING.md file of the CUPS source code.

Comments are re-formatted to use "// ..." instead of "/* ... */", like
in PAPPL, so C and C++ files get the same comment style.

This improves the readability of the code a lot, especially as missing
spaces got inserted in comma-separated lists ("xxx,yyy,zzz" -> "xxx,
yyy, zzz") and around operators ("x=a*(b+c)%4" -> "x = a * (b + c) %
4"), what got nearly completely missed out by several contributors.

Also we get rid of the mix of many different coding styles which came
together from the many code contributions rteceived during more than a
decade, even before the start of the cups-filters project.
  • Loading branch information
tillkamppeter committed Sep 10, 2022
1 parent 05f17e2 commit 6709100
Show file tree
Hide file tree
Showing 21 changed files with 3,041 additions and 2,881 deletions.
1,650 changes: 837 additions & 813 deletions cupsfilters/bannertopdf.c

Large diffs are not rendered by default.

717 changes: 380 additions & 337 deletions cupsfilters/bitmap.c

Large diffs are not rendered by default.

59 changes: 30 additions & 29 deletions cupsfilters/bitmap.h
@@ -1,34 +1,34 @@
/*
Copyright (c) 2020, Vikrant Malik
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
MIT Open Source License - http://www.opensource.org/
*/


//
// Copyright (c) 2020, Vikrant Malik
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// MIT Open Source License - http://www.opensource.org/
//

#ifndef _CUPS_FILTERS_BITMAP_H_
# define _CUPS_FILTERS_BITMAP_H_

# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
# endif // __cplusplus

#include <cups/raster.h>

Expand All @@ -51,5 +51,6 @@ unsigned char *cfRGB8toKCMYcm(unsigned char *src, unsigned char *dst,

# ifdef __cplusplus
}
# endif /* __cplusplus */
# endif // __cplusplus

#endif // !_CUPS_FILTERS_BITMAP_H_

0 comments on commit 6709100

Please sign in to comment.