summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-03-01 00:37:43 +0000
committerJeremy Allison <jra@samba.org>2001-03-01 00:37:43 +0000
commita7702fa2af76d84d1255222890f0382e3714c746 (patch)
treec6d57b5336de942407dc873feef57ff4a235c689 /source
parent0ccb1fc890f3869dcaacfc8ce34e0adcbc1ffe19 (diff)
downloadsamba-a7702fa2af76d84d1255222890f0382e3714c746.tar.gz
samba-a7702fa2af76d84d1255222890f0382e3714c746.tar.xz
samba-a7702fa2af76d84d1255222890f0382e3714c746.zip
Removed unused code.
Jeremy.
Diffstat (limited to 'source')
-rw-r--r--source/include/proto.h4
-rw-r--r--source/rpc_parse/parse_spoolss.c120
-rw-r--r--source/rpc_server/srv_spoolss_nt.c6
3 files changed, 6 insertions, 124 deletions
diff --git a/source/include/proto.h b/source/include/proto.h
index 810744870cf..ba90374bdbc 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -3389,11 +3389,7 @@ void free_devmode(DEVICEMODE *devmode);
void free_printer_info_1(PRINTER_INFO_1 *printer);
void free_printer_info_2(PRINTER_INFO_2 *printer);
void free_printer_info_3(PRINTER_INFO_3 *printer);
-void free_print2_array(uint32 num_entries, PRINTER_INFO_2 **entries);
-void free_print1_array(uint32 num_entries, PRINTER_INFO_1 **entries);
-void free_job1_array(uint32 num_entries, JOB_INFO_1 **entries);
void free_job_info_2(JOB_INFO_2 *job);
-void free_job2_array(uint32 num_entries, JOB_INFO_2 **entries);
BOOL make_spoolss_q_replyopenprinter(SPOOL_Q_REPLYOPENPRINTER *q_u,
const fstring string, uint32 printer, uint32 type);
BOOL spoolss_io_q_replyopenprinter(char *desc, SPOOL_Q_REPLYOPENPRINTER *q_u, prs_struct *ps, int depth);
diff --git a/source/rpc_parse/parse_spoolss.c b/source/rpc_parse/parse_spoolss.c
index d6bf86cd904..d729ef4388e 100644
--- a/source/rpc_parse/parse_spoolss.c
+++ b/source/rpc_parse/parse_spoolss.c
@@ -4701,7 +4701,7 @@ BOOL make_spool_buffer5(TALLOC_CTX *ctx, BUFFER5 *buf5, uint32 len, uint16 *src)
buf5->buf_len = len;
if((buf5->buffer=(uint16*)talloc(ctx, sizeof(uint16)*len)) == NULL)
{
- DEBUG(0,("make_spool_buffer5: Unable to malloc memory for buffer!\n"));
+ DEBUG(0,("make_spool_buffer5: Unable to talloc memory for buffer!\n"));
return False;
}
@@ -5623,124 +5623,10 @@ void free_printer_info_3(PRINTER_INFO_3 *printer)
}
}
-static PRINTER_INFO_2 *prt2_dup(const PRINTER_INFO_2* from)
-{
- PRINTER_INFO_2 *copy = (PRINTER_INFO_2 *)malloc(sizeof(PRINTER_INFO_2));
- if (copy != NULL) {
- if (from != NULL)
- memcpy(copy, from, sizeof(*copy));
- else
- ZERO_STRUCTP(copy);
- }
- return copy;
-}
-
-void free_print2_array(uint32 num_entries, PRINTER_INFO_2 **entries)
-{
- void(*fn)(void*) = (void(*)(void*))&free_printer_info_2;
- free_void_array(num_entries, (void**)entries, *fn);
-}
-
-PRINTER_INFO_2 *add_print2_to_array(uint32 *len, PRINTER_INFO_2 ***array,
- const PRINTER_INFO_2 *prt)
-{
- void*(*fn)(const void*) = (void*(*)(const void*))&prt2_dup;
- return (PRINTER_INFO_2*)add_copy_to_array(len,
- (void***)array, (const void*)prt, *fn, True);
-}
-
-static PRINTER_INFO_1 *prt1_dup(const PRINTER_INFO_1* from)
-{
- PRINTER_INFO_1 *copy = (PRINTER_INFO_1 *)malloc(sizeof(PRINTER_INFO_1));
- if (copy != NULL) {
- if (from != NULL)
- memcpy(copy, from, sizeof(*copy));
- else
- ZERO_STRUCTP(copy);
- }
- return copy;
-}
-
-void free_print1_array(uint32 num_entries, PRINTER_INFO_1 **entries)
-{
- void(*fn)(void*) = (void(*)(void*))&free;
- free_void_array(num_entries, (void**)entries, *fn);
-}
-
-PRINTER_INFO_1 *add_print1_to_array(uint32 *len, PRINTER_INFO_1 ***array,
- const PRINTER_INFO_1 *prt)
-{
- void*(*fn)(const void*) = (void*(*)(const void*))&prt1_dup;
- return (PRINTER_INFO_1*)add_copy_to_array(len,
- (void***)array, (const void*)prt, *fn, True);
-}
-
-static JOB_INFO_1 *job1_dup(const JOB_INFO_1* from)
-{
- JOB_INFO_1 *copy = (JOB_INFO_1 *)malloc(sizeof(JOB_INFO_1));
- if (copy != NULL)
- {
- if (from != NULL)
- {
- memcpy(copy, from, sizeof(*copy));
- }
- else
- {
- ZERO_STRUCTP(copy);
- }
- }
- return copy;
-}
-
-void free_job1_array(uint32 num_entries, JOB_INFO_1 **entries)
-{
- void(*fn)(void*) = (void(*)(void*))&free;
- free_void_array(num_entries, (void**)entries, *fn);
-}
-
-JOB_INFO_1 *add_job1_to_array(uint32 *len, JOB_INFO_1 ***array,
- const JOB_INFO_1 *job)
-{
- void*(*fn)(const void*) = (void*(*)(const void*))&job1_dup;
- return (JOB_INFO_1*)add_copy_to_array(len,
- (void***)array, (const void*)job, *fn, True);
-}
-
-static JOB_INFO_2 *job2_dup(const JOB_INFO_2* from)
-{
- JOB_INFO_2 *copy = (JOB_INFO_2 *)malloc(sizeof(JOB_INFO_2));
- if (copy != NULL)
- {
- if (from != NULL)
- {
- memcpy(copy, from, sizeof(*copy));
- }
- else
- {
- ZERO_STRUCTP(copy);
- }
- }
- return copy;
-}
-
void free_job_info_2(JOB_INFO_2 *job)
{
- if (job!=NULL)
- free_devmode(job->devmode);
-}
-
-void free_job2_array(uint32 num_entries, JOB_INFO_2 **entries)
-{
- void(*fn)(void*) = (void(*)(void*))&free_job_info_2;
- free_void_array(num_entries, (void**)entries, *fn);
-}
-
-JOB_INFO_2 *add_job2_to_array(uint32 *len, JOB_INFO_2 ***array,
- const JOB_INFO_2 *job)
-{
- void*(*fn)(const void*) = (void*(*)(const void*))&job2_dup;
- return (JOB_INFO_2*)add_copy_to_array(len,
- (void***)array, (const void*)job, *fn, True);
+ if (job!=NULL)
+ free_devmode(job->devmode);
}
/*******************************************************************
diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c
index b9f02bdba3b..538af83172e 100644
--- a/source/rpc_server/srv_spoolss_nt.c
+++ b/source/rpc_server/srv_spoolss_nt.c
@@ -2869,7 +2869,7 @@ static BOOL enum_all_printers_info_1(uint32 flags, NEW_BUFFER *buffer, uint32 of
return ERROR_NOT_ENOUGH_MEMORY;
}
DEBUG(4,("ReAlloced memory for [%d] PRINTER_INFO_1\n", *returned));
- memcpy(&(printers[*returned]), &current_prt, sizeof(PRINTER_INFO_1));
+ memcpy(&printers[*returned], &current_prt, sizeof(PRINTER_INFO_1));
(*returned)++;
}
}
@@ -2877,14 +2877,14 @@ static BOOL enum_all_printers_info_1(uint32 flags, NEW_BUFFER *buffer, uint32 of
/* check the required size. */
for (i=0; i<*returned; i++)
- (*needed) += spoolss_size_printer_info_1(&(printers[i]));
+ (*needed) += spoolss_size_printer_info_1(&printers[i]);
if (!alloc_buffer_size(buffer, *needed))
return ERROR_INSUFFICIENT_BUFFER;
/* fill the buffer with the structures */
for (i=0; i<*returned; i++)
- new_smb_io_printer_info_1("", buffer, &(printers[i]), 0);
+ new_smb_io_printer_info_1("", buffer, &printers[i], 0);
/* clear memory */
safe_free(printers);