Index: includes/actions.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/actions.inc,v
retrieving revision 1.32
diff -u -p -r1.32 actions.inc
--- includes/actions.inc	20 Sep 2009 07:47:44 -0000	1.32
+++ includes/actions.inc	2 Oct 2009 18:22:54 -0000
@@ -134,7 +134,7 @@ function actions_list($reset = FALSE) {
   static $actions;
   if (!isset($actions) || $reset) {
     $actions = module_invoke_all('action_info');
-    drupal_alter('action_info', $actions);
+    drupal_alter('action_info', array(&$actions));
   }
 
   // See module_implements() for an explanation of this cast.
Index: includes/ajax.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/ajax.inc,v
retrieving revision 1.12
diff -u -p -r1.12 ajax.inc
--- includes/ajax.inc	2 Oct 2009 14:55:40 -0000	1.12
+++ includes/ajax.inc	2 Oct 2009 18:22:54 -0000
@@ -136,7 +136,7 @@ function ajax_render($commands = array()
   }
 
   // Allow modules to alter any AJAX response.
-  drupal_alter('ajax_render', $commands);
+  drupal_alter('ajax_render', array(&$commands));
 
   // Use === here so that bool TRUE doesn't match 'multipart'.
   if ($header === 'multipart') {
Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.307
diff -u -p -r1.307 bootstrap.inc
--- includes/bootstrap.inc	30 Sep 2009 18:36:01 -0000	1.307
+++ includes/bootstrap.inc	2 Oct 2009 18:22:54 -0000
@@ -1781,7 +1781,7 @@ function drupal_get_schema($table = NULL
         $schema = array_merge($schema, $current);
       }
 
-      drupal_alter('schema', $schema);
+      drupal_alter('schema', array(&$schema));
       // If the schema is empty, avoid saving it: some database engines require
       // the schema to perform queries, and this could lead to infinite loops.
       if (!empty($schema) && (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL)) {
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1004
diff -u -p -r1.1004 common.inc
--- includes/common.inc	2 Oct 2009 00:50:45 -0000	1.1004
+++ includes/common.inc	2 Oct 2009 18:23:41 -0000
@@ -621,7 +621,7 @@ function drupal_goto($path = '', array $
     'fragment' => &$fragment,
     'http_response_code' => &$http_response_code,
   );
-  drupal_alter('drupal_goto', $args);
+  drupal_alter('drupal_goto', array(&$args));
 
   $url = url($path, array('query' => $query, 'fragment' => $fragment, 'absolute' => TRUE));
 
@@ -2864,7 +2864,7 @@ function drupal_get_css($css = NULL) {
   $query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1);
 
   // Allow modules to alter the css items.
-  drupal_alter('css', $css);
+  drupal_alter('css', array(&$css));
 
   // Sort css items according to their weights.
   uasort($css, 'drupal_sort_weight');
@@ -3319,7 +3319,7 @@ function drupal_get_js($scope = 'header'
   }
 
   // Allow modules to alter the JavaScript.
-  drupal_alter('js', $javascript);
+  drupal_alter('js', array(&$javascript));
 
   // Filter out elements of the given scope.
   $items = array();
@@ -3584,7 +3584,7 @@ function drupal_get_library($module, $na
 
     // Allow modules to alter the module's registered libraries.
     if (!empty($module_libraries)) {
-      drupal_alter('library', $module_libraries, $module);
+      drupal_alter('library', array(&$module_libraries, $module));
     }
     $libraries[$module] = $module_libraries;
   }
@@ -4003,7 +4003,7 @@ function drupal_cron_run() {
   $return = FALSE;
   // Grab the defined cron queues.
   $queues = module_invoke_all('cron_queue_info');
-  drupal_alter('cron_queue_info', $queues);
+  drupal_alter('cron_queue_info', array(&$queues));
 
   if ($semaphore) {
     if (REQUEST_TIME - $semaphore > 3600) {
@@ -4145,42 +4145,16 @@ function drupal_system_listing($mask, $d
  *   The data type of the structured array. 'form', 'links',
  *   'node_content', and so on are several examples.
  * @param $data
- *   The structured array to be altered.
- * @param ...
- *   Any additional params will be passed on to the called
- *   hook_$type_alter functions.
+ *   A list of variables to be altered, which are passed to hook implementations.
+ *   Alterable arguments should be explicitly passed by reference, e.g.:
+ *   @code
+ *     drupal_alter('mymodule_type', array(&$alterable, $unalterable));
+ *   @endcode
  */
-function drupal_alter($type, &$data) {
-  // PHP's func_get_args() always returns copies of params, not references, so
-  // drupal_alter() can only manipulate data that comes in via the required first
-  // param. For the edge case functions that must pass in an arbitrary number of
-  // alterable parameters (hook_form_alter() being the best example), an array of
-  // those params can be placed in the __drupal_alter_by_ref key of the $data
-  // array. This is somewhat ugly, but is an unavoidable consequence of a flexible
-  // drupal_alter() function, and the limitations of func_get_args().
-  // @todo: Remove this in Drupal 7.
-  if (is_array($data) && isset($data['__drupal_alter_by_ref'])) {
-    $by_ref_parameters = $data['__drupal_alter_by_ref'];
-    unset($data['__drupal_alter_by_ref']);
-  }
-
-  // Hang onto a reference to the data array so that it isn't blown away later.
-  // Also, merge in any parameters that need to be passed by reference.
-  $args = array(&$data);
-  if (isset($by_ref_parameters)) {
-    $args = array_merge($args, $by_ref_parameters);
-  }
-
-  // Now, use func_get_args() to pull in any additional parameters passed into
-  // the drupal_alter() call.
-  $additional_args = func_get_args();
-  array_shift($additional_args);
-  array_shift($additional_args);
-  $args = array_merge($args, $additional_args);
-
+function drupal_alter($type, $data) {
   foreach (module_implements($type . '_alter') as $module) {
     $function = $module . '_' . $type . '_alter';
-    call_user_func_array($function, $args);
+    call_user_func_array($function, $data);
   }
 }
 
@@ -4234,7 +4208,7 @@ function drupal_render_page($page) {
   }
   // Modules alter the $page as needed. Blocks are populated into regions like
   // 'sidebar_first', 'footer', etc.
-  drupal_alter('page', $page);
+  drupal_alter('page', array(&$page));
 
   return drupal_render($page);
 }
@@ -4615,7 +4589,7 @@ function element_info($type) {
       $cache[$element_type]['#type'] = $element_type;
     }
     // Allow modules to alter the element type defaults.
-    drupal_alter('element_info', $cache);
+    drupal_alter('element_info', array(&$cache));
   }
 
   return isset($cache[$type]) ? $cache[$type] : array();
@@ -5580,7 +5554,7 @@ function entity_get_info($entity_type = 
         );
       }
       // Let other modules alter the entity info.
-      drupal_alter('entity_info', $entity_info);
+      drupal_alter('entity_info', array(&$entity_info));
       cache_set('entity_info', $entity_info);
     }
   }
Index: includes/file.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/file.inc,v
retrieving revision 1.192
diff -u -p -r1.192 file.inc
--- includes/file.inc	30 Sep 2009 18:36:01 -0000	1.192
+++ includes/file.inc	2 Oct 2009 18:22:54 -0000
@@ -97,7 +97,7 @@ function file_get_stream_wrappers() {
 
   if (!isset($wrappers)) {
     $wrappers = module_invoke_all('stream_wrappers');
-    drupal_alter('stream_wrappers', $wrappers);
+    drupal_alter('stream_wrappers', array(&$wrappers));
     $existing = stream_get_wrappers();
     foreach ($wrappers as $scheme => $info) {
       // We only register classes that implement our interface.
@@ -311,7 +311,7 @@ function file_stream_wrapper_get_instanc
 function file_create_url($uri) {
   // Allow the URI to be altered, e.g. to serve a file from a CDN or static
   // file server.
-  drupal_alter('file_url', $uri);
+  drupal_alter('file_url', array(&$uri));
 
   $scheme = file_uri_scheme($uri);
 
Index: includes/file.mimetypes.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/file.mimetypes.inc,v
retrieving revision 1.4
diff -u -p -r1.4 file.mimetypes.inc
--- includes/file.mimetypes.inc	31 Aug 2009 05:47:33 -0000	1.4
+++ includes/file.mimetypes.inc	2 Oct 2009 18:22:54 -0000
@@ -20,7 +20,7 @@ function file_mimetype_mapping() {
   if (!isset($mapping)) {
     $mapping = file_default_mimetype_mapping();
     // Allow modules to alter the default mapping.
-    drupal_alter('file_mimetype_mapping', $mapping);
+    drupal_alter('file_mimetype_mapping', array(&$mapping));
   }
   return $mapping;
 }
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.376
diff -u -p -r1.376 form.inc
--- includes/form.inc	29 Sep 2009 15:31:13 -0000	1.376
+++ includes/form.inc	2 Oct 2009 18:22:54 -0000
@@ -669,20 +669,11 @@ function drupal_prepare_form($form_id, &
     }
   }
 
-  // Normally, we would call drupal_alter($form_id, $form, $form_state).
-  // However, drupal_alter() normally supports just one byref parameter. Using
-  // the __drupal_alter_by_ref key, we can store any additional parameters
-  // that need to be altered, and they'll be split out into additional params
-  // for the hook_form_alter() implementations.
-  // @todo: Remove this in Drupal 7.
-  $data = &$form;
-  $data['__drupal_alter_by_ref'] = array(&$form_state);
-  drupal_alter('form_' . $form_id, $data);
-
-  // __drupal_alter_by_ref is unset in the drupal_alter() function, we need
-  // to repopulate it to ensure both calls get the data.
-  $data['__drupal_alter_by_ref'] = array(&$form_state);
-  drupal_alter('form', $data, $form_id);
+  // Invoke hook_form_FORM_ID_alter() implementations.
+  drupal_alter('form_' . $form_id, array(&$form, &$form_state));
+
+  // Invoke hook_form_alter() implementations.
+  drupal_alter('form', array(&$form, &$form_state, $form_id));
 }
 
 
Index: includes/locale.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/locale.inc,v
retrieving revision 1.229
diff -u -p -r1.229 locale.inc
--- includes/locale.inc	29 Sep 2009 15:13:54 -0000	1.229
+++ includes/locale.inc	2 Oct 2009 18:22:54 -0000
@@ -2718,7 +2718,7 @@ function country_get_list() {
   include_once DRUPAL_ROOT . '/includes/iso.inc';
   $countries = _country_get_predefined_list();
   // Allow other modules to modify the country list.
-  drupal_alter('countries', $countries);
+  drupal_alter('countries', array(&$countries));
   return $countries;
 }
 
Index: includes/mail.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/mail.inc,v
retrieving revision 1.25
diff -u -p -r1.25 mail.inc
--- includes/mail.inc	1 Sep 2009 17:40:27 -0000	1.25
+++ includes/mail.inc	2 Oct 2009 18:22:54 -0000
@@ -127,7 +127,7 @@ function drupal_mail($module, $key, $to,
   }
 
   // Invoke hook_mail_alter() to allow all modules to alter the resulting e-mail.
-  drupal_alter('mail', $message);
+  drupal_alter('mail', array(&$message));
 
   // Concatenate and wrap the e-mail body.
   $message['body'] = is_array($message['body']) ? drupal_wrap_mail(implode("\n\n", $message['body'])) : drupal_wrap_mail($message['body']);
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.348
diff -u -p -r1.348 menu.inc
--- includes/menu.inc	1 Oct 2009 19:07:12 -0000	1.348
+++ includes/menu.inc	2 Oct 2009 18:22:54 -0000
@@ -751,7 +751,7 @@ function _menu_link_translate(&$item) {
   // options array. For performance reasons we only invoke this hook if the link
   // has the 'alter' flag set in the options array.
   if (!empty($item['options']['alter'])) {
-    drupal_alter('translated_menu_link', $item, $map);
+    drupal_alter('translated_menu_link', array(&$item, $map));
   }
 
   return $map;
@@ -2028,7 +2028,7 @@ function menu_router_build() {
     }
   }
   // Alter the menu as defined in modules, keys are like user/%user.
-  drupal_alter('menu', $callbacks);
+  drupal_alter('menu', array(&$callbacks));
   list($menu, $masks) = _menu_router_build($callbacks);
   _menu_router_cache($menu);
 
@@ -2251,7 +2251,7 @@ function _menu_delete_item($item, $force
  */
 function menu_link_save(&$item) {
 
-  drupal_alter('menu_link', $item);
+  drupal_alter('menu_link', array(&$item));
 
   // This is the easiest way to handle the unique internal path '<front>',
   // since a path marked as external does not need to match a router path.
Index: includes/registry.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/registry.inc,v
retrieving revision 1.24
diff -u -p -r1.24 registry.inc
--- includes/registry.inc	24 Aug 2009 00:14:18 -0000	1.24
+++ includes/registry.inc	2 Oct 2009 18:22:54 -0000
@@ -60,7 +60,7 @@ function _registry_rebuild() {
   // includes the list of files registered to each module. Any files in the
   // list can then be added to the list of files that the registry will parse,
   // or modify attributes of a file.
-  drupal_alter('registry_files', $files, $modules);
+  drupal_alter('registry_files', array(&$files, $modules));
   foreach (registry_get_parsed_files() as $filename => $file) {
     // Add the file creation and modification dates to those files we have
     // already parsed.
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.527
diff -u -p -r1.527 theme.inc
--- includes/theme.inc	30 Sep 2009 13:09:29 -0000	1.527
+++ includes/theme.inc	2 Oct 2009 18:22:54 -0000
@@ -503,7 +503,7 @@ function _theme_build_registry($theme, $
   _theme_process_registry($cache, $theme->name, 'theme', $theme->name, dirname($theme->filename));
 
   // Let modules alter the registry.
-  drupal_alter('theme_registry', $cache);
+  drupal_alter('theme_registry', array(&$cache));
 
   // Optimize the registry to not have empty arrays for functions.
   foreach ($cache as $hook => $info) {
Index: includes/token.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/token.inc,v
retrieving revision 1.5
diff -u -p -r1.5 token.inc
--- includes/token.inc	25 Aug 2009 02:50:08 -0000	1.5
+++ includes/token.inc	2 Oct 2009 18:22:54 -0000
@@ -229,7 +229,7 @@ function token_info() {
   if (!isset($data)) {
     _token_initialize();
     $data = module_invoke_all('token_info');
-    drupal_alter('token_info', $data);
+    drupal_alter('token_info', array(&$data));
   }
   return $data;
 }
Index: includes/database/select.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/select.inc,v
retrieving revision 1.24
diff -u -p -r1.24 select.inc
--- includes/database/select.inc	18 Sep 2009 00:04:21 -0000	1.24
+++ includes/database/select.inc	2 Oct 2009 18:22:54 -0000
@@ -1065,10 +1065,10 @@ class SelectQuery extends Query implemen
     }
 
     // Modules may alter all queries or only those having a particular tag.
-    drupal_alter('query', $query);
+    drupal_alter('query', array(&$query));
     if (isset($this->alterTags)) {
       foreach ($this->alterTags as $tag => $value) {
-        drupal_alter("query_$tag", $query);
+        drupal_alter("query_$tag", array(&$query));
       }
     }
     return $this->prepared = TRUE;
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.380
diff -u -p -r1.380 block.module
--- modules/block/block.module	30 Sep 2009 13:09:29 -0000	1.380
+++ modules/block/block.module	2 Oct 2009 18:22:54 -0000
@@ -549,7 +549,7 @@ function _block_load_blocks() {
 
   $block_info = $result->fetchAllAssoc('bid');
   // Allow modules to modify the block list.
-  drupal_alter('block_info', $block_info);
+  drupal_alter('block_info', array(&$block_info));
 
   $blocks = array();
   foreach ($block_info as $block) {
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.775
diff -u -p -r1.775 comment.module
--- modules/comment/comment.module	29 Sep 2009 15:31:14 -0000	1.775
+++ modules/comment/comment.module	2 Oct 2009 18:22:54 -0000
@@ -844,7 +844,7 @@ function comment_build_content($comment,
   module_invoke_all('comment_view', $comment, $build_mode);
 
   // Allow modules to modify the structured comment.
-  drupal_alter('comment_build', $comment, $build_mode);
+  drupal_alter('comment_build', array(&$comment, $build_mode));
 }
 
 /**
Index: modules/field/field.attach.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.attach.inc,v
retrieving revision 1.51
diff -u -p -r1.51 field.attach.inc
--- modules/field/field.attach.inc	2 Oct 2009 14:39:43 -0000	1.51
+++ modules/field/field.attach.inc	2 Oct 2009 18:22:54 -0000
@@ -1193,7 +1193,7 @@ function field_attach_view($obj_type, $o
   $output['#extra_fields'] = field_extra_fields($bundle);
 
   // Let other modules make changes after rendering the view.
-  drupal_alter('field_attach_view', $output, $obj_type, $object, $build_mode, $langcode);
+  drupal_alter('field_attach_view', array(&$output, $obj_type, $object, $build_mode, $langcode));
 
   return $output;
 }
@@ -1228,7 +1228,7 @@ function field_attach_preprocess($obj_ty
   }
 
   // Let other modules make changes to the $variables array.
-  drupal_alter('field_attach_preprocess', $variables, $obj_type, $object, $element);
+  drupal_alter('field_attach_preprocess', array(&$variables, $obj_type, $object, $element));
 }
 
 /**
Index: modules/field/field.info.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.info.inc,v
retrieving revision 1.19
diff -u -p -r1.19 field.info.inc
--- modules/field/field.info.inc	27 Sep 2009 12:52:55 -0000	1.19
+++ modules/field/field.info.inc	2 Oct 2009 18:22:54 -0000
@@ -95,7 +95,7 @@ function _field_info_collate_types($rese
           $info['field types'][$name]['module'] = $module;
         }
       }
-      drupal_alter('field_info', $info['field types']);
+      drupal_alter('field_info', array(&$info['field types']));
 
       // Populate widget types.
       foreach (module_implements('field_widget_info') as $module) {
@@ -109,7 +109,7 @@ function _field_info_collate_types($rese
           $info['widget types'][$name]['module'] = $module;
         }
       }
-      drupal_alter('field_widget_info', $info['widget types']);
+      drupal_alter('field_widget_info', array(&$info['widget types']));
 
       // Populate formatter types.
       foreach (module_implements('field_formatter_info') as $module) {
@@ -123,7 +123,7 @@ function _field_info_collate_types($rese
           $info['formatter types'][$name]['module'] = $module;
         }
       }
-      drupal_alter('field_formatter_info', $info['formatter types']);
+      drupal_alter('field_formatter_info', array(&$info['formatter types']));
 
       // Populate storage types.
       foreach (module_implements('field_storage_info') as $module) {
@@ -137,7 +137,7 @@ function _field_info_collate_types($rese
           $info['storage types'][$name]['module'] = $module;
         }
       }
-      drupal_alter('field_storage_info', $info['storage types']);
+      drupal_alter('field_storage_info', array(&$info['storage types']));
 
       // Populate information about 'fieldable' entities.
       foreach (module_implements('entity_info') as $module) {
@@ -165,7 +165,7 @@ function _field_info_collate_types($rese
           }
         }
       }
-      drupal_alter('entity_info', $info['fieldable types']);
+      drupal_alter('entity_info', array(&$info['fieldable types']));
 
       cache_set('field_info_types', $info, 'cache_field');
     }
Index: modules/field/field.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.module,v
retrieving revision 1.37
diff -u -p -r1.37 field.module
--- modules/field/field.module	1 Oct 2009 19:16:57 -0000	1.37
+++ modules/field/field.module	2 Oct 2009 18:22:54 -0000
@@ -382,7 +382,7 @@ function field_extra_fields($bundle_name
     foreach ($bundles as $bundle => $bundle_label) {
       // Gather information about non-field object additions.
       $extra = module_invoke_all('field_extra_fields', $bundle);
-      drupal_alter('field_extra_fields', $extra, $bundle);
+      drupal_alter('field_extra_fields', array(&$extra, $bundle));
 
       // Add saved weights.
       foreach (variable_get("field_extra_weights_$bundle", array()) as $key => $value) {
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.291
diff -u -p -r1.291 filter.module
--- modules/filter/filter.module	20 Sep 2009 07:32:18 -0000	1.291
+++ modules/filter/filter.module	2 Oct 2009 18:22:54 -0000
@@ -572,7 +572,7 @@ function filter_get_filters() {
       }
     }
     // Allow modules to alter filter definitions.
-    drupal_alter('filter_info', $filters);
+    drupal_alter('filter_info', array(&$filters));
 
     uasort($filters, '_filter_list_cmp');
   }
Index: modules/locale/locale.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v
retrieving revision 1.259
diff -u -p -r1.259 locale.module
--- modules/locale/locale.module	22 Sep 2009 07:50:16 -0000	1.259
+++ modules/locale/locale.module	2 Oct 2009 18:22:54 -0000
@@ -653,7 +653,7 @@ function locale_block_view($delta = '') 
     }
 
     // Allow modules to provide translations for specific links.
-    drupal_alter('translation_link', $links, $path);
+    drupal_alter('translation_link', array(&$links, $path));
 
     $block['subject'] = t('Languages');
     $block['content'] = theme('links', $links, array());
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1135
diff -u -p -r1.1135 node.module
--- modules/node/node.module	30 Sep 2009 18:36:02 -0000	1.1135
+++ modules/node/node.module	2 Oct 2009 18:22:54 -0000
@@ -1124,7 +1124,7 @@ function node_build_content($node, $buil
   module_invoke_all('node_view', $node, $build_mode);
 
   // Allow modules to modify the structured node.
-  drupal_alter('node_build', $node, $build_mode);
+  drupal_alter('node_build', array(&$node, $build_mode));
 }
 
 /**
@@ -2421,7 +2421,7 @@ function node_access_grants($op, $accoun
   // Fetch node access grants from other modules.
   $grants = module_invoke_all('node_grants', $account, $op);
   // Allow modules to alter the assigned grants.
-  drupal_alter('node_grants', $grants, $account, $op);
+  drupal_alter('node_grants', array(&$grants, $account, $op));
 
   return array_merge(array('all' => array(0)), $grants);
 }
@@ -2525,7 +2525,7 @@ function node_query_node_access_alter(Qu
 function node_access_acquire_grants($node) {
   $grants = module_invoke_all('node_access_records', $node);
   // Let modules alter the grants.
-  drupal_alter('node_access_records', $grants, $node);
+  drupal_alter('node_access_records', array(&$grants, $node));
   // If no grants are set, then use the default grant.
   if (empty($grants)) {
     $grants[] = array('realm' => 'all', 'gid' => 0, 'grant_view' => 1, 'grant_update' => 0, 'grant_delete' => 0);
Index: modules/node/node.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.test,v
retrieving revision 1.46
diff -u -p -r1.46 node.test
--- modules/node/node.test	2 Oct 2009 14:39:43 -0000	1.46
+++ modules/node/node.test	2 Oct 2009 18:22:54 -0000
@@ -752,7 +752,8 @@ class NodeAccessRecordsUnitTest extends 
     $web_user = $this->drupalCreateUser(array('access content'));
     foreach ($operations as $op) {
       $grants = node_test_node_grants($op, $web_user);
-      $altered_grants = drupal_alter($grants, $web_user, $op);
+      $altered_grants = $grants;
+      drupal_alter('node_grants', array(&$altered_grants, $web_user, $op));
       $this->assertNotEqual($grants, $altered_grants, t('Altered the %op grant for a user.', array('%op' => $op)));
     }
   }
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.800
diff -u -p -r1.800 system.module
--- modules/system/system.module	30 Sep 2009 18:36:02 -0000	1.800
+++ modules/system/system.module	2 Oct 2009 18:22:54 -0000
@@ -1893,7 +1893,7 @@ function _system_get_module_data() {
 
     // Invoke hook_system_info_alter() to give installed modules a chance to
     // modify the data in the .info files if necessary.
-    drupal_alter('system_info', $modules[$key]->info, $modules[$key], 'module');
+    drupal_alter('system_info', array(&$modules[$key]->info, $modules[$key], 'module'));
   }
 
   // The install profile is required.
@@ -1986,7 +1986,7 @@ function _system_get_theme_data() {
 
       // Invoke hook_system_info_alter() to give installed modules a chance to
       // modify the data in the .info files if necessary.
-      drupal_alter('system_info', $themes[$key]->info, $themes[$key], 'theme');
+      drupal_alter('system_info', array(&$themes[$key]->info, $themes[$key], 'theme'));
 
       if (!empty($themes[$key]->info['base theme'])) {
         $sub_themes[] = $key;
Index: modules/trigger/trigger.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.admin.inc,v
retrieving revision 1.18
diff -u -p -r1.18 trigger.admin.inc
--- modules/trigger/trigger.admin.inc	19 Sep 2009 11:07:36 -0000	1.18
+++ modules/trigger/trigger.admin.inc	2 Oct 2009 18:22:54 -0000
@@ -24,7 +24,7 @@ function trigger_assign($module_to_displ
 
   $build = array();
   $trigger_info = module_invoke_all('trigger_info');
-  drupal_alter('trigger_info', $trigger_info);
+  drupal_alter('trigger_info', array(&$trigger_info));
   foreach ($trigger_info as $module => $hooks) {
     if ($module == $module_to_display) {
       foreach ($hooks as $hook => $description) {
Index: modules/trigger/trigger.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.module,v
retrieving revision 1.48
diff -u -p -r1.48 trigger.module
--- modules/trigger/trigger.module	19 Sep 2009 11:07:36 -0000	1.48
+++ modules/trigger/trigger.module	2 Oct 2009 18:22:54 -0000
@@ -46,7 +46,7 @@ function trigger_menu() {
   // We want contributed modules to be able to describe
   // their hooks and have actions assignable to them.
   $trigger_info = module_invoke_all('trigger_info');
-  drupal_alter('trigger_info', $trigger_info);
+  drupal_alter('trigger_info', array(&$trigger_info));
 
   foreach ($trigger_info as $module => $hooks) {
     $info = db_select('system')
@@ -585,12 +585,13 @@ function trigger_actions_delete($aid) {
  */
 function _trigger_get_all_info() {
   static $triggers = NULL;
-  if( $triggers ) {
+
+  if ($triggers) {
     return $triggers;
   }
 
   $triggers = module_invoke_all('trigger_info');
-  drupal_alter('trigger_info', $triggers);
+  drupal_alter('trigger_info', array(&$triggers));
   return $triggers;
 }
 
Index: modules/update/update.compare.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/update/update.compare.inc,v
retrieving revision 1.31
diff -u -p -r1.31 update.compare.inc
--- modules/update/update.compare.inc	29 Sep 2009 16:30:29 -0000	1.31
+++ modules/update/update.compare.inc	2 Oct 2009 18:22:54 -0000
@@ -45,7 +45,7 @@ function update_get_projects() {
         _update_process_info_list($projects, $theme_data, 'theme', FALSE);
       }
       // Allow other modules to alter projects before fetching and comparing.
-      drupal_alter('update_projects', $projects);
+      drupal_alter('update_projects', array(&$projects));
       // Cache the site's project data for at most 1 hour.
       _update_cache_set('update_project_projects', $projects, REQUEST_TIME + 3600);
     }
@@ -636,7 +636,7 @@ function update_calculate_project_data($
   // Give other modules a chance to alter the status (for example, to allow a
   // contrib module to provide fine-grained settings to ignore specific
   // projects or releases).
-  drupal_alter('update_status', $projects);
+  drupal_alter('update_status', array(&$projects));
 
   // Cache the site's update status for at most 1 hour.
   _update_cache_set('update_project_data', $projects, REQUEST_TIME + 3600);
Index: modules/upload/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v
retrieving revision 1.260
diff -u -p -r1.260 upload.module
--- modules/upload/upload.module	25 Sep 2009 14:24:34 -0000	1.260
+++ modules/upload/upload.module	2 Oct 2009 18:22:54 -0000
@@ -688,7 +688,7 @@ function upload_js() {
     '#tree' => FALSE,
     '#parents' => array(),
   );
-  drupal_alter('form', $form, array(), 'upload_js');
+  drupal_alter('form', array(&$form, array(), 'upload_js'));
   $form_state = array('submitted' => FALSE, 'programmed' => FALSE);
   $form = form_builder('upload_js', $form, $form_state);
   $output = theme('status_messages') . drupal_render($form);
Index: modules/user/user.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.pages.inc,v
retrieving revision 1.57
diff -u -p -r1.57 user.pages.inc
--- modules/user/user.pages.inc	29 Sep 2009 15:31:17 -0000	1.57
+++ modules/user/user.pages.inc	2 Oct 2009 18:22:54 -0000
@@ -444,7 +444,7 @@ function user_cancel_methods() {
     ),
   );
   // Allow modules to customize account cancellation methods.
-  drupal_alter('user_cancel_methods', $methods);
+  drupal_alter('user_cancel_methods', array(&$methods));
 
   // Turn all methods into real form elements.
   $default_method = variable_get('user_cancel_method', 'user_cancel_block');
