diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2014-02-06 18:33:34 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2014-02-06 18:33:34 +0000 |
commit | 7e86f2f686334cb3db458b4585dfce9c1b712bc4 (patch) | |
tree | 88b4a0536faefcada96437e7cddd3a36cfdee0a4 /scheduler/mime.c | |
parent | b1564baed9db112cb1334027f1d141877d88fcf4 (diff) | |
download | cups-7e86f2f686334cb3db458b4585dfce9c1b712bc4.tar.gz |
Full sweep of all Clang warnings, plus some bug fixes for incorrect memcpy usage.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11558 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'scheduler/mime.c')
-rw-r--r-- | scheduler/mime.c | 54 |
1 files changed, 15 insertions, 39 deletions
diff --git a/scheduler/mime.c b/scheduler/mime.c index 94ad96554..56181501a 100644 --- a/scheduler/mime.c +++ b/scheduler/mime.c @@ -1,40 +1,16 @@ /* * "$Id$" * - * MIME database file routines for CUPS. + * MIME database file routines for CUPS. * - * Copyright 2007-2013 by Apple Inc. - * Copyright 1997-2006 by Easy Software Products, all rights reserved. + * Copyright 2007-2014 by Apple Inc. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. * - * These coded instructions, statements, and computer programs are the - * property of Apple Inc. and are protected by Federal copyright - * law. Distribution and use rights are outlined in the file "LICENSE.txt" - * which should have been included with this file. If this file is - * file is missing or damaged, see the license at "http://www.cups.org/". - * - * Contents: - * - * mimeDelete() - Delete (free) a MIME database. - * mimeDeleteFilter() - Delete a filter from the MIME database. - * mimeDeleteType() - Delete a type from the MIME database. - * _mimeError() - Show an error message. - * mimeFirstFilter() - Get the first filter in the MIME database. - * mimeFirstType() - Get the first type in the MIME database. - * mimeLoad() - Create a new MIME database from disk. - * mimeLoadFilters() - Load filter definitions from disk. - * mimeLoadTypes() - Load type definitions from disk. - * mimeNew() - Create a new, empty MIME database. - * mimeNextFilter() - Get the next filter in the MIME database. - * mimeNextType() - Get the next type in the MIME database. - * mimeNumFilters() - Get the number of filters in a MIME database. - * mimeNumTypes() - Get the number of types in a MIME database. - * mimeSetErrorCallback() - Set the callback for error messages. - * mime_add_fcache() - Add a filter to the filter cache. - * mime_compare_fcache() - Compare two filter cache entries. - * mime_delete_fcache() - Free all memory used by the filter cache. - * mime_delete_rules() - Free all memory for the given rule tree. - * mime_load_convs() - Load a xyz.convs file. - * mime_load_types() - Load a xyz.types file. + * These coded instructions, statements, and computer programs are the + * property of Apple Inc. and are protected by Federal copyright + * law. Distribution and use rights are outlined in the file "LICENSE.txt" + * which should have been included with this file. If this file is + * file is missing or damaged, see the license at "http://www.cups.org/". */ /* @@ -744,7 +720,7 @@ mime_load_convs( while (*lineptr != '/' && *lineptr != '\n' && *lineptr != '\0' && (temp - super + 1) < MIME_MAX_SUPER) - *temp++ = tolower(*lineptr++ & 255); + *temp++ = (char)tolower(*lineptr++ & 255); *temp = '\0'; @@ -756,7 +732,7 @@ mime_load_convs( while (*lineptr != ' ' && *lineptr != '\t' && *lineptr != '\n' && *lineptr != '\0' && (temp - type + 1) < MIME_MAX_TYPE) - *temp++ = tolower(*lineptr++ & 255); + *temp++ = (char)tolower(*lineptr++ & 255); *temp = '\0'; @@ -817,7 +793,7 @@ mime_load_convs( while (*lineptr != '/' && *lineptr != '\n' && *lineptr != '\0' && (temp - super + 1) < MIME_MAX_SUPER) - *temp++ = tolower(*lineptr++ & 255); + *temp++ = (char)tolower(*lineptr++ & 255); *temp = '\0'; @@ -829,7 +805,7 @@ mime_load_convs( while (*lineptr != ' ' && *lineptr != '\t' && *lineptr != '\n' && *lineptr != '\0' && (temp - type + 1) < MIME_MAX_TYPE) - *temp++ = tolower(*lineptr++ & 255); + *temp++ = (char)tolower(*lineptr++ & 255); *temp = '\0'; @@ -868,7 +844,7 @@ mime_load_types(mime_t *mime, /* I - MIME database */ const char *filename) /* I - Types file to load */ { cups_file_t *fp; /* Types file */ - int linelen; /* Length of line */ + size_t linelen; /* Length of line */ char line[32768], /* Input line from file */ *lineptr, /* Current position in line */ super[MIME_MAX_SUPER], /* Super-type name */ @@ -930,7 +906,7 @@ mime_load_types(mime_t *mime, /* I - MIME database */ while (*lineptr != '/' && *lineptr != '\n' && *lineptr != '\0' && (temp - super + 1) < MIME_MAX_SUPER) - *temp++ = tolower(*lineptr++ & 255); + *temp++ = (char)tolower(*lineptr++ & 255); *temp = '\0'; @@ -942,7 +918,7 @@ mime_load_types(mime_t *mime, /* I - MIME database */ while (*lineptr != ' ' && *lineptr != '\t' && *lineptr != '\n' && *lineptr != '\0' && (temp - type + 1) < MIME_MAX_TYPE) - *temp++ = tolower(*lineptr++ & 255); + *temp++ = (char)tolower(*lineptr++ & 255); *temp = '\0'; |